Windows CMD dir /S File and Subfolder Enumeration

Flags cmd.exe executions using dir with the /S flag to enumerate files in a directory and all subdirectories.

FreeReviewedSigma · Low · v2
Product
windows
Category
process_creation
Author
frack113 (SigmaHQ), DRL 1.1
Published
2021-12-13
Updated
2026-07-31

ATT&CK techniques

Discovery
  1. Recon

  2. Resource Dev

  3. Initial Access

  4. Execution

  5. Persistence

  6. Priv Esc

  7. Defense Evasion

  8. Cred Access

  9. Lateral Movement

  10. Collection

  11. C2

  12. Exfiltration

  13. Impact

What it detects

This rule identifies process executions of Windows Command Prompt (cmd.exe) where the command line includes the 'dir ' output pattern and the '/S' flag to enumerate files within a specified directory and its subdirectories. Attackers may use this discovery behavior to inventory accessible files prior to further actions. It relies on process creation telemetry capturing cmd.exe (by image or OriginalFileName) and the command line containing the relevant 'dir ' and '/S' indicators, while excluding command lines that include 'rmdir'.

Related detections3 linkedT1217 — drag to rearrange
Windows File Access to Browser Credential Storage by Non-Browser Processes
Windows process execution of where.exe with browser bookmark database or history artifacts
PowerShell Script Block Collection of Browser Bookmarks via Get-ChildItem
Windows CMD dir /S File and Subfolder Enumeration
Pivot detection · T1217 · 3 related

Changelog

v2
  1. v2
    Candidate ingested via manual entry.2026-07-31
  2. v1
    No changelog recorded for this version.2026-07-30

Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.