Detection rules › Sigma

Suspicious Execution of Powershell with Base64

Status
test
Severity
medium
Log source
product windows, category process_creation
Author
frack113
Source
github.com/SigmaHQ/sigma

Commandline to launch powershell with a base64 payload

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: Suspicious Execution of Powershell with Base64
id: fb843269-508c-4b76-8b8d-88679db22ce7
status: test
description: Commandline to launch powershell with a base64 payload
references:
    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1059.001/T1059.001.md#atomic-test-20---powershell-invoke-known-malicious-cmdlets
    - https://unit42.paloaltonetworks.com/unit42-pulling-back-the-curtains-on-encodedcommand-powershell-attacks/
    - https://mikefrobbins.com/2017/06/15/simple-obfuscation-with-powershell-using-base64-encoding/
author: frack113
date: 2022-01-02
modified: 2023-01-05
tags:
    - attack.execution
    - attack.t1059.001
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        Image|endswith:
            - \powershell.exe
            - \pwsh.exe
        CommandLine|contains:
            - ' -e '
            - ' -en '
            - ' -enc '
            - ' -enco'
            - ' -ec '
    filter_encoding:
        CommandLine|contains: ' -Encoding '
    filter_azure:
        ParentImage|contains:
            - 'C:\Packages\Plugins\Microsoft.GuestConfiguration.ConfigurationforWindows\'
            - '\gc_worker.exe'
    condition: selection and not 1 of filter_*
falsepositives:
    - Unknown
level: medium

Stages and Predicates

Stage 0: condition

selection and not 1 of filter_*

Stage 1: selection

selection:
    Image|endswith:
        - \powershell.exe
        - \pwsh.exe
    CommandLine|contains:
        - ' -e '
        - ' -en '
        - ' -enc '
        - ' -enco'
        - ' -ec '

Stage 2: not filter_*

filter_encoding:
    CommandLine|contains: ' -Encoding '
filter_azure:
    ParentImage|contains:
        - 'C:\Packages\Plugins\Microsoft.GuestConfiguration.ConfigurationforWindows\'
        - '\gc_worker.exe'

Exclusions

Top-level NOT(...) conjuncts: predicates this rule actively suppresses.

FieldKindExcluded values
CommandLinematch -Encoding
ParentImagematchC:\Packages\Plugins\Microsoft.GuestConfiguration.ConfigurationforWindows\
ParentImagematch\gc_worker.exe

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
CommandLinematch
  • -e corpus 14 (sigma 14)
  • -ec corpus 2 (sigma 2)
  • -en corpus 3 (sigma 3)
  • -enc corpus 6 (sigma 6)
  • -enco corpus 2 (sigma 2)
Imageends_with
  • \powershell.exe corpus 182 (sigma 182)
  • \pwsh.exe corpus 168 (sigma 168)