Potential File Override/Append Via SET Command
Last updated on:
In this page
About the rule
Rule Type
Standard
Rule Description
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.
Severity
Attention
Rule Requirement
Criteria
Action1: actionname = "Process started" AND (PROCESSNAME endswith "\cmd.exe" OR ORIGINALFILENAME = "Cmd.Exe") AND COMMANDLINE contains "/c set /p=,"set /p=,>>*set /p=" select Action1.HOSTNAME,Action1.MESSAGE,Action1.COMMANDLINE,Action1.FILE_NAME,Action1.PROCESSNAME,Action1.USERNAME,Action1.PARENTPROCESSNAME
Detection
Execution Mode
realtime
Log Sources
Windows
Author
Nasreddine Bencherchali (Nextron Systems), MahirAli Khan (in/mahiralikhan)


