Detection rules › Sigma

Execution of Powershell Script in Public Folder

Status
test
Severity
high
Log source
product windows, category process_creation
Author
Max Altgelt (Nextron Systems)
Source
github.com/SigmaHQ/sigma

This rule detects execution of PowerShell scripts located in the "C:\Users\Public" folder

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: Execution of Powershell Script in Public Folder
id: fb9d3ff7-7348-46ab-af8c-b55f5fbf39b4
status: test
description: This rule detects execution of PowerShell scripts located in the "C:\Users\Public" folder
references:
    - https://www.mandiant.com/resources/evolution-of-fin7
author: Max Altgelt (Nextron Systems)
date: 2022-04-06
modified: 2022-07-14
tags:
    - attack.execution
    - attack.t1059.001
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        Image|endswith:
            - '\powershell.exe'
            - '\pwsh.exe'
        CommandLine|contains:
            - '-f C:\Users\Public'
            - '-f "C:\Users\Public'
            - '-f %Public%'
            - '-fi C:\Users\Public'
            - '-fi "C:\Users\Public'
            - '-fi %Public%'
            - '-fil C:\Users\Public'
            - '-fil "C:\Users\Public'
            - '-fil %Public%'
            - '-file C:\Users\Public'
            - '-file "C:\Users\Public'
            - '-file %Public%'
    condition: selection
falsepositives:
    - Unlikely
level: high

Stages and Predicates

Stage 0: condition

selection

Stage 1: selection

selection:
    Image|endswith:
        - '\powershell.exe'
        - '\pwsh.exe'
    CommandLine|contains:
        - '-f C:\Users\Public'
        - '-f "C:\Users\Public'
        - '-f %Public%'
        - '-fi C:\Users\Public'
        - '-fi "C:\Users\Public'
        - '-fi %Public%'
        - '-fil C:\Users\Public'
        - '-fil "C:\Users\Public'
        - '-fil %Public%'
        - '-file C:\Users\Public'
        - '-file "C:\Users\Public'
        - '-file %Public%'

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
  • -f "C:\Users\Public
  • -f %Public%
  • -f C:\Users\Public
  • -fi "C:\Users\Public
  • -fi %Public%
  • -fi C:\Users\Public
  • -fil "C:\Users\Public
  • -fil %Public%
  • -fil C:\Users\Public
  • -file "C:\Users\Public
  • -file %Public%
  • -file C:\Users\Public
Imageends_with
  • \powershell.exe corpus 182 (sigma 182)
  • \pwsh.exe corpus 168 (sigma 168)