Detectionhightest

Suspicious PowerShell Encoded Command Patterns

Detects PowerShell command line patterns in combincation with encoded commands that often appear in malware infection chains

Convert In Phoenix Studio

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

Launch
Florian Roth (Nextron Systems)Created Tue May 24Updated Thu Jan 05b9d9cc83-380b-4ba3-8d8f-60c0e7e2930cwindows
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_flags:
        CommandLine|contains:
            - ' -e '
            - ' -en '
            - ' -enc '
            - ' -enco'
    selection_encoded:
        CommandLine|contains:
            - ' JAB'
            - ' SUVYI'
            - ' SQBFAFgA'
            - ' aWV4I'
            - ' IAB'
            - ' PAA'
            - ' aQBlAHgA'
    filter_gcworker:
        ParentImage|contains:
            - 'C:\Packages\Plugins\Microsoft.GuestConfiguration.ConfigurationforWindows\'
            - '\gc_worker.exe'
    condition: all of selection_* and not 1 of filter_*
False Positives

Other tools that work with encoded scripts in the command line instead of script files

MITRE ATT&CK
Rule Metadata
Rule ID
b9d9cc83-380b-4ba3-8d8f-60c0e7e2930c
Status
test
Level
high
Type
Detection
Created
Tue May 24
Modified
Thu Jan 05
Path
rules/windows/process_creation/proc_creation_win_powershell_base64_encoded_cmd_patterns.yml
Raw Tags
attack.executionattack.t1059.001
View on GitHub