cscli scenarios install sigmahq/proc_creation_win_powershell_cmdline_special_characters
1type: trigger2name: sigmahq/proc_creation_win_powershell_cmdline_special_characters3description: |4 Detects the PowerShell command lines with special characters5filter: |6 (evt.Meta.service == 'sysmon' && evt.Parsed.EventID == '1') && ((evt.Parsed.Image endsWith '\\powershell.exe' || evt.Parsed.Image endsWith '\\pwsh.exe' || evt.Parsed.OriginalFileName in ['PowerShell.EXE', 'pwsh.dll']) && (evt.Parsed.CommandLine matches '\\+.*\\+.*\\+.*\\+.*\\+.*\\+.*\\+.*\\+.*\\+.*\\+.*\\+.*\\+.*\\+.*\\+' || evt.Parsed.CommandLine matches '\\{.*\\{.*\\{.*\\{.*\\{.*\\{.*\\{.*\\{.*\\{.*\\{' || evt.Parsed.CommandLine matches '\\^.*\\^.*\\^.*\\^.*\\^' || evt.Parsed.CommandLine matches '`.*`.*`.*`.*`') && not (evt.Parsed.ParentImage == 'C:\\Program Files\\Amazon\\SSM\\ssm-document-worker.exe' || evt.Parsed.CommandLine contains 'new EventSource("Microsoft.Windows.Sense.Client.Management"' || evt.Parsed.CommandLine contains 'public static extern bool InstallELAMCertificateInfo(SafeFileHandle handle);'))7blackhole: 2m8#status: test9labels:10 service: windows11 confidence: 112 spoofable: 013 classification:14 - attack.t102715 - attack.t1059.0011617 label: "Potential PowerShell Command Line Obfuscation"18 behavior : "windows:audit"19 remediation: false2021scope:22 type: ParentProcessId23 expression: evt.Parsed.ParentProcessId2425