Sigma rule: Forfiles Command Execution
A detection rule from the SigmaHQ repository, shown as its author published it. Dataset version ref-3735d298bac9, updated 2024-03-05T00:00:00.000Z.
Rule
- Title
- Forfiles Command Execution
- Status
- test
- Level
- medium
- Author
- Tim Rauch, Elastic, E.M. Anhaus (originally from Atomic Blue Detections, Endgame), oscd.community
- Date
- 2022-06-14
- Modified
- 2024-03-05
- File
- rules/windows/process_creation/proc_creation_win_forfiles_proxy_execution_.yml
- Commit
- ccbb0369507f796db0b0ae6854c8a2be471b9d84
Detects the execution of "forfiles" with the "/c" flag.
While this is an expected behavior of the tool, it can be abused in order to proxy execution through it with any binary.
Can be used to bypass application whitelisting.
Log source
- product
- windows
- category
- process_creation
Detection
selection_img:
- Image|endswith: '\forfiles.exe'
- OriginalFileName: 'forfiles.exe'
selection_cli:
CommandLine|contains|windash: ' -c '
condition: all of selection_*False positives (as the rule lists them)
- Legitimate use via a batch script or by an administrator.
Tags
- attack.execution
- attack.t1059
MITRE ATT&CK ids this rule names
Related rules
References
- https://lolbas-project.github.io/lolbas/Binaries/Forfiles/
- https://pentestlab.blog/2020/07/06/indirect-command-execution/
Read on 2026-11-03T00:58:21.399Z under licence sigma-drl-1.1@d5f4c36a from https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/windows/process_creation/proc_creation_win_forfiles_proxy_execution_.yml
Sources and licences
SigmaHQ
"Forfiles Command Execution" by Tim Rauch, Elastic, E.M. Anhaus (originally from Atomic Blue Detections, Endgame), oscd.community (SigmaHQ). Rule: https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/windows/process_creation/proc_creation_win_forfiles_proxy_execution_.yml.
Licensed under the Detection Rule License (DRL) 1.1: https://github.com/SigmaHQ/Detection-Rule-License
Cite this page
Dragons Eye Ransomware Tracker, "Sigma rule: Forfiles Command Execution",
entity page, dataset version ref-3735d298bac9, updated 2024-03-05T00:00:00.000Z,
https://ransomware-tracker.com/detections/sigma/9aa5106d-bce3-4b13-86df-3a20f1d5cf0b (accessed 2026-11-03).
Underlying source: SigmaHQ rule 9aa5106d-bce3-4b13-86df-3a20f1d5cf0b, commit ccbb0369507f796db0b0ae6854c8a2be471b9d84.
Pages change. The dataset version identifies the data, but no archive of old versions is kept, so this citation cannot be replayed later.