Detectionhightest

PowerShell Base64 Encoded Invoke Keyword

Detects UTF-8 and UTF-16 Base64 encoded powershell 'Invoke-' calls

Open in Detection LabConvert ruleBuild Package
Martin Mueller, Harjot SinghCreated 2022-05-20Updated 2023-04-066385697e-9f1b-40bd-8817-f4a91f40508ewindows
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 Logic3 selectors
detection:
    selection_img:
        - Image|endswith:
              - '\powershell.exe'
              - '\pwsh.exe'
        - OriginalFileName:
              - 'PowerShell.EXE'
              - 'pwsh.dll'
    selection_cli_enc:
        CommandLine|contains: ' -e'
    selection_cli_invoke:
        CommandLine|contains:
            # Invoke-
            # UTF-16LE
            - 'SQBuAHYAbwBrAGUALQ'
            - 'kAbgB2AG8AawBlAC0A'
            - 'JAG4AdgBvAGsAZQAtA'
            # UTF-8
            - 'SW52b2tlL'
            - 'ludm9rZS'
            - 'JbnZva2Ut'
    condition: all of selection_*
False Positives
Unknown

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

Testing & Validation

Simulations

atomic red teamT1047

Create a Process using WMI Query and an Encoded Command

GUID: 7db7a7f9-9531-4840-9b30-46220135441c

Regression Tests

by Swachchhanda Shrawan Poudel (Nextron Systems)
Positive Detection Test1 matchevtx

Microsoft-Windows-Sysmon

Related Rules
Similar

fd6e2919-3936-40c9-99db-0aa922c356f7

Rule not found
Rule Metadata
Rule ID
6385697e-9f1b-40bd-8817-f4a91f40508e
Status
test
Level
high
Type
Detection
Created
2022-05-20
Modified
2023-04-06
Path
rules/windows/process_creation/proc_creation_win_powershell_base64_invoke.yml
Raw Tags
attack.executionattack.stealthattack.t1059.001attack.t1027
View on GitHub