Detection logic
Original SigmaHQ detection and related fields from the pinned file. The source file includes its full metadata.
logsource:
product: windows
service: powershell
definition: Script block logging must be enabled for 4104, Module Logging must be enabled for 4103
detection:
selection_convert_b64:
'|all':
- '-nop'
- ' -w '
- 'hidden'
- ' -c '
- '[Convert]::FromBase64String'
selection_iex:
'|all':
- ' -w '
- 'hidden'
- '-noni'
- '-nop'
- ' -c '
- 'iex'
- 'New-Object'
selection_enc:
'|all':
- ' -w '
- 'hidden'
- '-ep'
- 'bypass'
- '-Enc'
selection_reg:
'|all':
- 'powershell'
- 'reg'
- 'add'
- 'HKCU\software\microsoft\windows\currentversion\run'
selection_webclient:
'|all':
- 'bypass'
- '-noprofile'
- '-windowstyle'
- 'hidden'
- 'new-object'
- 'system.net.webclient'
- '.download'
selection_iex_webclient:
'|all':
- 'iex'
- 'New-Object'
- 'Net.WebClient'
- '.Download'
filter_chocolatey:
- "(New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1"
- "(New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')"
- 'Write-ChocolateyWarning'
condition: 1 of selection_* and not 1 of filter_*
falsepositives:
- Unknown