Detection rules › Sigma

Powershell Directory Enumeration

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

Detects technique used by MAZE ransomware to enumerate directories using Powershell

MITRE ATT&CK coverage

TacticTechniques
DiscoveryT1083 File and Directory Discovery

Event coverage

Rule body yaml

title: Powershell Directory Enumeration
id: 162e69a7-7981-4344-84a9-0f1c9a217a52
status: test
description: Detects technique used by MAZE ransomware to enumerate directories using Powershell
references:
    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1083/T1083.md
    - https://www.mandiant.com/resources/tactics-techniques-procedures-associated-with-maze-ransomware-incidents
author: frack113
date: 2022-03-17
tags:
    - attack.discovery
    - attack.t1083
logsource:
    product: windows
    category: ps_script
    definition: 'Requirements: Script Block Logging must be enabled'
detection:
    selection:
        ScriptBlockText|contains|all:
            - foreach
            - Get-ChildItem
            - '-Path '
            - '-ErrorAction '
            - SilentlyContinue
            - 'Out-File '
            - '-append'
    condition: selection
falsepositives:
    - Legitimate PowerShell scripts
level: medium

Stages and Predicates

Stage 0: condition

selection

Stage 1: selection

selection:
    ScriptBlockText|contains|all:
        - foreach
        - Get-ChildItem
        - '-Path '
        - '-ErrorAction '
        - SilentlyContinue
        - 'Out-File '
        - '-append'

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
ScriptBlockTextmatch
  • -ErrorAction
  • -Path corpus 3 (sigma 3)
  • -append
  • Get-ChildItem corpus 4 (sigma 4)
  • Out-File
  • SilentlyContinue
  • foreach corpus 2 (sigma 2)