Potential PowerShell Command Line Obfuscation
Description
Detects the PowerShell command lines with special characters
Query · sigma
selection_img:
- Image|endswith:
- \powershell.exe
- \pwsh.exe
- OriginalFileName:
- PowerShell.EXE
- pwsh.dll
selection_re:
- CommandLine|re: \+.*\+.*\+.*\+.*\+.*\+.*\+.*\+.*\+.*\+.*\+.*\+.*\+.*\+
- CommandLine|re: \{.*\{.*\{.*\{.*\{.*\{.*\{.*\{.*\{.*\{
- CommandLine|re: \^.*\^.*\^.*\^.*\^
- CommandLine|re: '`.*`.*`.*`.*`'
filter_optional_amazonSSM:
ParentImage: C:\Program Files\Amazon\SSM\ssm-document-worker.exe
filter_optional_defender_atp:
CommandLine|contains:
- new EventSource("Microsoft.Windows.Sense.Client.Management"
- public static extern bool InstallELAMCertificateInfo(SafeFileHandle handle);
condition: all of selection_* and not 1 of filter_optional_*
Known false positives
- Amazon SSM Document Worker
- Windows Defender ATP