Detectionhightest

Potential PowerShell Command Line Obfuscation

Detects the PowerShell command lines with special characters

Convert In Phoenix Studio

Open this Sigma rule in the converter with the YAML preloaded and ready for backend selection.

Launch
Teymur Kheirkhabarov, Vasiliy Burov, oscd.community, Tim SheltonCreated Thu Oct 15Updated Mon Apr 15d7bcd677-645d-4691-a8d4-7a5602b780d1windows
Log Source
WindowsProcess Creation
ProductWindows← raw: windows
CategoryProcess Creation← raw: process_creation

Events generated when a new process is spawned on the system. Covers command-line arguments, parent/child relationships, and process metadata.

Detection Logic
Detection Logic4 selectors
detection:
    selection_img:
        - Image|endswith:
              - '\powershell.exe'
              - '\pwsh.exe'
        - OriginalFileName:
              - 'PowerShell.EXE'
              - 'pwsh.dll'
    selection_re:
        # TODO: Optimize for PySIGMA
        - 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_*
False Positives

Amazon SSM Document Worker

Windows Defender ATP

Rule Metadata
Rule ID
d7bcd677-645d-4691-a8d4-7a5602b780d1
Status
test
Level
high
Type
Detection
Created
Thu Oct 15
Modified
Mon Apr 15
Path
rules/windows/process_creation/proc_creation_win_powershell_cmdline_special_characters.yml
Raw Tags
attack.executionattack.defense-evasionattack.t1027attack.t1059.001
View on GitHub