Powershell Sensitive File Discovery

Detect adversaries enumerate sensitive files

Sigma rule (View on GitHub)

 1title: Powershell Sensitive File Discovery
 2id: 7d416556-6502-45b2-9bad-9d2f05f38997
 3related:
 4    - id: d23f2ba5-9da0-4463-8908-8ee47f614bb9
 5      type: derived
 6status: test
 7description: Detect adversaries enumerate sensitive files
 8references:
 9    - https://twitter.com/malmoeb/status/1570814999370801158
10author: frack113
11date: 2022-09-16
12modified: 2026-10-14
13tags:
14    - attack.discovery
15    - attack.t1083
16logsource:
17    product: windows
18    category: ps_script
19    definition: 'Requirements: Script Block Logging must be enabled'
20detection:
21    selection_action:
22        # Whole words only: as plain substrings, 'ls' and 'gci' also match words such as 'false' or 'credentials'
23        ScriptBlockText|re|i: '\b(?:get-childitem|gci|ls|dir)\b'
24    selection_recurse:
25        ScriptBlockText|contains: '-recurse'
26    selection_file:
27        ScriptBlockText|contains:
28            - '.pass'
29            - '.kdbx'
30            - '.kdb'
31    condition: all of selection_*
32falsepositives:
33    - Unknown
34level: medium
35regression_tests_path: regression_data/rules/windows/powershell/powershell_script/posh_ps_sensitive_file_discovery/info.yml

References

Related rules

to-top