Detectionmediumtest
Powershell Sensitive File Discovery
Detect adversaries enumerate sensitive files
Log Source
WindowsPowerShell Script
ProductWindows← raw: windows
CategoryPowerShell Script← raw: ps_script
Definition
Requirements: Script Block Logging must be enabled
Detection Logic
Detection Logic3 selectors
detection:
selection_action:
# Whole words only: as plain substrings, 'ls' and 'gci' also match words such as 'false' or 'credentials'
ScriptBlockText|re|i: '\b(?:get-childitem|gci|ls|dir)\b'
selection_recurse:
ScriptBlockText|contains: '-recurse'
selection_file:
ScriptBlockText|contains:
- '.pass'
- '.kdbx'
- '.kdb'
condition: all of selection_*False Positives
Unknown
False positive likelihood has not been assessed. Additional context may be needed during triage.
References
MITRE ATT&CK
Tactics
Techniques
Related Rules
Derived
Rule not foundd23f2ba5-9da0-4463-8908-8ee47f614bb9
Rule Metadata
Rule ID
7d416556-6502-45b2-9bad-9d2f05f38997
Status
test
Level
medium
Type
Detection
Created
2022-09-16
Modified
2026-10-14
Author
Path
rules/windows/powershell/powershell_script/posh_ps_sensitive_file_discovery.yml
Raw Tags
attack.discoveryattack.t1083