Detectionhightest

PowerShell Execution With Potential Decryption Capabilities

Detects PowerShell commands that decrypt an ".LNK" "file to drop the next stage of the malware.

Open in Detection LabConvert ruleBuild Package
X__Junior (Nextron Systems), Nasreddine BencherchaliCreated 2023-06-30Updated 2023-12-05434c08ba-8406-4d15-8b24-782cb071a691windows
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_cli_dir:
        CommandLine|contains:
            - "Get-ChildItem "
            - "dir "
            - "gci "
            - "ls "
    selection_cli_gc:
        CommandLine|contains:
            - "Get-Content "
            - "gc "
            - 'cat '
            - 'type '
            - 'ReadAllBytes'
    selection_cli_specific:
        - CommandLine|contains|all:
              - ' ^| '
              - '\*.lnk'
              - '-Recurse'
              - '-Skip '
        - CommandLine|contains|all:
              - ' -ExpandProperty '
              - '\*.lnk'
              - 'WriteAllBytes'
              - ' .length '
    condition: all of selection_*
False Positives
Unlikely

False positives are unlikely for most environments. High confidence detection.

MITRE ATT&CK
Rule Metadata
Rule ID
434c08ba-8406-4d15-8b24-782cb071a691
Status
test
Level
high
Type
Detection
Created
2023-06-30
Modified
2023-12-05
Path
rules/windows/process_creation/proc_creation_win_powershell_decrypt_pattern.yml
Raw Tags
attack.execution
View on GitHub