{"id":"d7bcd677-645d-4691-a8d4-7a5602b780d1","title":"Potential PowerShell Command Line Obfuscation","description":"Detects the PowerShell command lines with special characters","author":"Teymur Kheirkhabarov (idea), Vasiliy Burov (rule), oscd.community, Tim Shelton (fp)","status":"test","level":"high","date":"2020-10-15","modified":"2024-04-15","tags":["attack.execution","attack.stealth","attack.t1027","attack.t1059.001"],"technique_ids":["T1027","T1059.001"],"logsource":{"category":"process_creation","product":"windows"},"falsepositives":["Amazon SSM Document Worker","Windows Defender ATP"],"references":["https://speakerdeck.com/heirhabarov/hunting-for-powershell-abuse?slide=64"],"source_path":"rules/windows/process_creation/proc_creation_win_powershell_cmdline_special_characters.yml","source_sha256":"f0d498c97c676400730442fd44eb2f3cbc5a8241dc88453f916e0e7c0da6f9e3","source_url":"https://github.com/anpa1200/sigma/blob/b249e9683190cffdcaf188ccbfb90bf4759844e1/rules/windows/process_creation/proc_creation_win_powershell_cmdline_special_characters.yml","license":"Detection Rule License 1.1","license_url":"https://github.com/SigmaHQ/Detection-Rule-License/blob/main/LICENSE.Detection.Rules.md","yaml":"title: Potential PowerShell Command Line Obfuscation\nid: d7bcd677-645d-4691-a8d4-7a5602b780d1\nstatus: test\ndescription: Detects the PowerShell command lines with special characters\nreferences:\n    - https://speakerdeck.com/heirhabarov/hunting-for-powershell-abuse?slide=64\nauthor: Teymur Kheirkhabarov (idea), Vasiliy Burov (rule), oscd.community, Tim Shelton (fp)\ndate: 2020-10-15\nmodified: 2024-04-15\ntags:\n    - attack.execution\n    - attack.stealth\n    - attack.t1027\n    - attack.t1059.001\nlogsource:\n    category: process_creation\n    product: windows\ndetection:\n    selection_img:\n        - Image|endswith:\n              - '\\powershell.exe'\n              - '\\pwsh.exe'\n        - OriginalFileName:\n              - 'PowerShell.EXE'\n              - 'pwsh.dll'\n    selection_re:\n        # TODO: Optimize for PySIGMA\n        - CommandLine|re: '\\+.*\\+.*\\+.*\\+.*\\+.*\\+.*\\+.*\\+.*\\+.*\\+.*\\+.*\\+.*\\+.*\\+'\n        - CommandLine|re: '\\{.*\\{.*\\{.*\\{.*\\{.*\\{.*\\{.*\\{.*\\{.*\\{'\n        - CommandLine|re: '\\^.*\\^.*\\^.*\\^.*\\^'\n        - CommandLine|re: '`.*`.*`.*`.*`'\n    filter_optional_amazonSSM:\n        ParentImage: C:\\Program Files\\Amazon\\SSM\\ssm-document-worker.exe\n    filter_optional_defender_atp:\n        CommandLine|contains:\n            - 'new EventSource(\"Microsoft.Windows.Sense.Client.Management\"'\n            - 'public static extern bool InstallELAMCertificateInfo(SafeFileHandle handle);'\n    condition: all of selection_* and not 1 of filter_optional_*\nfalsepositives:\n    - Amazon SSM Document Worker\n    - Windows Defender ATP\nlevel: high\n","validation":"yaml_parsed_not_backend_compiled_or_live_validated","techniques":[{"key":"enterprise/T1027","id":"T1027","name":"Obfuscated Files or Information","page":"techniques/enterprise/T1027/"},{"key":"enterprise/T1059.001","id":"T1059.001","name":"PowerShell","page":"techniques/enterprise/T1059.001/"}],"data_path":"data/detection-rules/d7bcd677-645d-4691-a8d4-7a5602b780d1.json","kind":"sigma"}
