Windows rmdir Directory Removal via cmd.exe Execution
Monitors cmd.exe process creation where rmdir is used with /s and/or /q to delete directories and reduce forensic artifacts.
- Product
- windows
- Category
- process_creation
- Author
- frack113 (SigmaHQ), DRL 1.1
- Published
- 2022-01-15
- Updated
- 2026-07-31
ATT&CK techniques
Defense EvasionRecon
Resource Dev
Initial Access
Execution
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule identifies process creation where Windows cmd.exe runs a command line containing rmdir and optional flags for recursive deletion (/s) and quiet mode (/q). Directory removal is a common post-action step that can reduce leftover artifacts from intrusion activity or other automated cleanup. It relies on Windows process creation telemetry, including process image/filename and the command line arguments.
Reporting behind it
- github.comhttps://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1070.004/T1070.004.md
- learn.microsoft.comhttps://learn.microsoft.com/en-us/windows-server/administration/windows-commands/erase
- github.comhttps://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_cmd_rmdir_execution.yml
Changelog
v2- v2Candidate ingested via manual entry.2026-07-31
- v1No 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.
title: Windows rmdir Directory Removal via cmd.exe Execution
id: 35616cae-7a92-402f-9014-ca7aafa9a6d1
status: test
description: This rule identifies process creation where Windows cmd.exe runs a command line containing rmdir and optional flags for recursive deletion (/s) and quiet mode (/q). Directory removal is a common post-action step that can reduce leftover artifacts from intrusion activity or other automated cleanup. It relies on Windows process creation telemetry, including process image/filename and the command line arguments.
references:
- https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1070.004/T1070.004.md
- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/erase
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_cmd_rmdir_execution.yml
author: frack113, Huntrule Team
date: 2022-01-15
modified: 2023-03-07
tags:
- attack.stealth
- attack.t1070.004
logsource:
category: process_creation
product: windows
detection:
selection_img:
- Image|endswith: \cmd.exe
- OriginalFileName: Cmd.Exe
selection_rmdir:
CommandLine|contains: rmdir
selection_flags:
CommandLine|contains:
- /s
- /q
condition: all of selection_*
falsepositives:
- Unknown
level: low
regression_tests_path: regression_data/rules/windows/process_creation/proc_creation_win_cmd_rmdir_execution/info.yml
license: DRL-1.1
related:
- id: 41ca393d-538c-408a-ac27-cf1e038be80c
type: derived