Possible File And SubFolder Enumeration Through Dir Command (via process_creation)
This rule detects use of the "dir" command part of Windows CMD with the "/S" command line flag to enumerate files in a specified directory and all subdirectories.
SigmalowWindowsv1
sigma
possible-file-and-subfolder-enumeration-through-dir-command-via-process-creation
title: Possible File And SubFolder Enumeration Through Dir Command (via process_creation)
id: ec28b6c2-3cf2-5eb2-9c6d-776f06048294
status: stable
description: This rule detects use of the "dir" command part of Windows CMD with the "/S" command line flag to enumerate files in a specified directory and all subdirectories.
references:
- https://attack.mitre.org/techniques/T1217/
- https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1217/T1217.md
author: Huntrule Team
date: 2026-04-28
tags:
- attack.discovery
- attack.t1217
logsource:
category: process_creation
product: windows
detection:
selection_cmd:
- Image|endswith: '\cmd.exe'
- OriginalFileName: Cmd.Exe
selection_cli:
CommandLine|contains|windash: '-s'
CommandLine|contains: 'dir '
filter_main_rmdir:
CommandLine|contains: 'rmdir'
condition: all of selection_* and not 1 of filter_main_*
falsepositives:
- Unknown
level: low
regression_tests_path: regression_data/rules/windows/process_creation/proc_creation_win_cmd_dir_execution/info.yml
simulation:
- type: atomic-red-team
name: List Internet Explorer Bookmarks using the command prompt
technique: T1217
atomic_guid: 727dbcdb-e495-4ab1-a6c4-80c7f77aef85
Known false positives
- Unknown
Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.