Detectionlowtest

Potential Encoded PowerShell Patterns In CommandLine

Detects specific combinations of encoding methods in PowerShell via the commandline

Open in Detection LabConvert ruleBuild Package
Teymur Kheirkhabarov, Vasiliy Burov, oscd.community, Tim SheltonCreated 2020-10-11Updated 2023-01-26cdf05894-89e7-4ead-b2b0-0a5f97a90f2fwindows
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 Logic5 selectors
detection:
    selection_img:
        - Image|endswith:
              - '\powershell.exe'
              - '\pwsh.exe'
        - OriginalFileName:
              - 'PowerShell.EXE'
              - 'pwsh.dll'
    selection_to_1:
        CommandLine|contains:
            - 'ToInt'
            - 'ToDecimal'
            - 'ToByte'
            - 'ToUint'
            - 'ToSingle'
            - 'ToSByte'
    selection_to_2:
        CommandLine|contains:
            - 'ToChar'
            - 'ToString'
            - 'String'
    selection_gen_1:
        CommandLine|contains|all:
            - 'char'
            - 'join'
    selection_gen_2:
        CommandLine|contains|all:
            - 'split'
            - 'join'
    condition: selection_img and (all of selection_to_* or 1 of selection_gen_*)
False Positives
Unknown

False positive likelihood has not been assessed. Additional context may be needed during triage.

Related Rules
Similar

5b572dcf-254b-425c-a8c5-d9af6bea35a6

Rule not found
Rule Metadata
Rule ID
cdf05894-89e7-4ead-b2b0-0a5f97a90f2f
Status
test
Level
low
Type
Detection
Created
2020-10-11
Modified
2023-01-26
Path
rules/windows/process_creation/proc_creation_win_powershell_encoding_patterns.yml
Raw Tags
attack.stealthattack.t1027attack.executionattack.t1059.001
View on GitHub