Potential File Override/Append Via SET Command
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.
Query · sigma
selection_img: - Image|endswith: \cmd.exe - OriginalFileName: Cmd.Exe selection_cli: CommandLine|contains: - /c set /p= - '"set /p=' - '>>*set /p=' condition: all of selection_*
Known false positives
- Legitimate use of the SET with the "/p" flag for user prompting. command in administrative scripts or user-generated scripts.