Windows del/erase Command-Line File Deletion via cmd.exe
Flags cmd.exe executions running del/erase for file removal, including common flags like /f, /s, and /q.
- 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 flags process creation events where cmd.exe executes built-in del or erase commands to delete files. File deletion can help attackers remove artifacts created during intrusion activity or post-intrusion cleanup to reduce observable traces. The detection relies on Windows process creation telemetry, matching cmd.exe execution along with del/erase command-line substrings and optional flags such as -f, -s, and -q.
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_del_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 del/erase Command-Line File Deletion via cmd.exe
id: e43827b7-1d34-4e1a-8153-574bcf3d2599
status: test
description: This rule flags process creation events where cmd.exe executes built-in del or erase commands to delete files. File deletion can help attackers remove artifacts created during intrusion activity or post-intrusion cleanup to reduce observable traces. The detection relies on Windows process creation telemetry, matching cmd.exe execution along with del/erase command-line substrings and optional flags such as -f, -s, and -q.
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_del_execution.yml
author: frack113, Huntrule Team
date: 2022-01-15
modified: 2024-03-05
tags:
- attack.stealth
- attack.t1070.004
logsource:
category: process_creation
product: windows
detection:
selection_img:
- Image|endswith: \cmd.exe
- OriginalFileName: Cmd.Exe
selection_del:
CommandLine|contains:
- "del "
- "erase "
selection_flags:
CommandLine|contains|windash:
- " -f"
- " -s"
- " -q"
condition: all of selection_*
falsepositives:
- False positives levels will differ Depending on the environment. You can use a combination of ParentImage and other keywords from the CommandLine field to filter legitimate activity
level: low
license: DRL-1.1
related:
- id: 379fa130-190e-4c3f-b7bc-6c8e834485f3
type: derived