Sigma rule: Potential File Override/Append Via SET Command
A detection rule from the SigmaHQ repository, shown as its author published it. Dataset version ref-cfca2c932c1c, updated 2024-08-22T00:00:00.000Z.
Rule
- Title
- Potential File Override/Append Via SET Command
- Status
- test
- Level
- low
- Author
- Nasreddine Bencherchali (Nextron Systems), MahirAli Khan (in/mahiralikhan)
- Date
- 2024-08-22
- File
- rules-threat-hunting/windows/process_creation/proc_creation_win_cmd_set_prompt_abuse.yml
- Commit
- ccbb0369507f796db0b0ae6854c8a2be471b9d84
Detects the use of the "SET" internal command of Cmd.EXE with the /p flag followed directly by an "=" sign.
Attackers used this technique along with an append redirection operator ">>" in order to update the content of a file indirectly.
Ex: cmd /c >> example.txt set /p="test data". This will append "test data" to contents of "example.txt".
The typical use case of the "set /p=" command is to prompt the user for input.
Log source
- product
- windows
- category
- process_creation
Detection
selection_img:
- Image|endswith: '\cmd.exe'
- OriginalFileName: 'Cmd.Exe'
selection_cli:
CommandLine|contains:
- '/c set /p='
- '"set /p='
- '>>*set /p=' # To catch edge cases where the attacker passes it via a "cmd /c"
condition: all of selection_*False positives (as the rule lists them)
- Legitimate use of the SET with the "/p" flag for user prompting. command in administrative scripts or user-generated scripts.
Tags
- attack.execution
- detection.threat-hunting
- attack.stealth
References
- https://news.sophos.com/en-us/2024/08/07/sophos-mdr-hunt-tracks-mimic-ransomware-campaign-against-organizations-in-india/
- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/set_1
- https://ss64.com/nt/set.html
Read on 2026-11-03T00:58:21.399Z under licence sigma-drl-1.1@d5f4c36a from https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules-threat-hunting/windows/process_creation/proc_creation_win_cmd_set_prompt_abuse.yml
Sources and licences
SigmaHQ
"Potential File Override/Append Via SET Command" by Nasreddine Bencherchali (Nextron Systems), MahirAli Khan (in/mahiralikhan) (SigmaHQ). Rule: https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules-threat-hunting/windows/process_creation/proc_creation_win_cmd_set_prompt_abuse.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: Potential File Override/Append Via SET Command",
entity page, dataset version ref-cfca2c932c1c, updated 2024-08-22T00:00:00.000Z,
https://ransomware-tracker.com/detections/sigma/65e4c134-ee52-4099-9e35-5e17a4b45c62 (accessed 2026-11-03).
Underlying source: SigmaHQ rule 65e4c134-ee52-4099-9e35-5e17a4b45c62, 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.