Detection logic
Original SigmaHQ detection and related fields from the pinned file. The source file includes its full metadata.
logsource:
product: windows
category: process_creation
detection:
selection_img:
- Image|endswith:
- '\powershell.exe'
- '\pwsh.exe'
- OriginalFileName:
- 'PowerShell.EXE'
- 'pwsh.dll'
selection_cmdlet:
CommandLine|contains:
- 'Import-Module '
- 'ipmo '
filter_main_vsstudio:
ParentImage|contains:
- ':\Program Files\WindowsApps\Microsoft.WindowsTerminal_'
- ':\Windows\System32\cmd.exe'
CommandLine|contains|all:
- ':\Program Files\Microsoft Visual Studio\'
- 'Tools\Microsoft.VisualStudio.DevShell.dll'
condition: all of selection_* and not 1 of filter_main_*
falsepositives:
- Depending on the environment, many legitimate scripts will import modules inline. This rule is targeted for hunting purposes.