Detection rules › Sigma

PowerShell Script Run in AppData

Status
test
Severity
medium
Log source
product windows, category process_creation
Author
Florian Roth (Nextron Systems), Jonhnathan Ribeiro, oscd.community
Source
github.com/SigmaHQ/sigma

Detects a suspicious command line execution that invokes PowerShell with reference to an AppData folder

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: PowerShell Script Run in AppData
id: ac175779-025a-4f12-98b0-acdaeb77ea85
status: test
description: Detects a suspicious command line execution that invokes PowerShell with reference to an AppData folder
references:
    - https://twitter.com/JohnLaTwC/status/1082851155481288706
    - https://app.any.run/tasks/f87f1c4e-47e2-4c46-9cf4-31454c06ce03
author: Florian Roth (Nextron Systems), Jonhnathan Ribeiro, oscd.community
date: 2019-01-09
modified: 2022-07-14
tags:
    - attack.execution
    - attack.t1059.001
logsource:
    category: process_creation
    product: windows
detection:
    selection1:
        CommandLine|contains:
            - 'powershell.exe'
            - '\powershell'
            - '\pwsh'
            - 'pwsh.exe'
    selection2:
        CommandLine|contains|all:
            - '/c '
            - '\AppData\'
        CommandLine|contains:
            - 'Local\'
            - 'Roaming\'
    condition: all of selection*
falsepositives:
    - Administrative scripts
level: medium

Stages and Predicates

Stage 0: condition

all of selection*

Stage 1: selection1

selection1:
    CommandLine|contains:
        - 'powershell.exe'
        - '\powershell'
        - '\pwsh'
        - 'pwsh.exe'

Stage 2: selection2

selection2:
    CommandLine|contains|all:
        - '/c '
        - '\AppData\'
    CommandLine|contains:
        - 'Local\'
        - 'Roaming\'

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
  • /c corpus 4 (sigma 4)
  • Local\
  • Roaming\
  • \AppData\ corpus 8 (sigma 8)
  • \powershell
  • \pwsh
  • powershell.exe corpus 2 (sigma 2)
  • pwsh.exe corpus 2 (sigma 2)