Potential Persistence Attempt Via Existing Service Tampering
A Sigma rule for process creation on Windows, by Sreeman.
medium 2 ATT&CK techniques
What it looks for
detection:
selection_reg_ext:
CommandLine|contains:
- '.sh'
- '.exe'
- '.dll'
- '.bin$'
- '.bat'
- '.cmd'
- '.js'
- '.msh$'
- '.reg$'
- '.scr'
- '.ps'
- '.vb'
- '.jar'
- '.pl'
selection_reg_img:
- CommandLine|contains|all:
- 'reg '
- 'add '
- 'FailureCommand'
- CommandLine|contains|all:
- 'reg '
- 'add '
- 'ImagePath'
selection_sc:
- CommandLine|contains|all:
- 'sc '
- 'config '
- 'binpath='
- CommandLine|contains|all:
- 'sc '
- 'failure'
- 'command='
condition: selection_sc or all of selection_reg_*
The rule’s detection, its selections and fields in order of name. The whole rule, with its references and false positives, is on SigmaHQ, by Sreeman, under the Detection Rule License 1.1. CmdID evaluates it on a command line alone: a test on what a command line cannot show, such as the parent process or the user, is not met.
Command lines that trip it
The commands LOLBAS or GTFOBins documents for sc.exe trip it: each is on its program’s page, read by CmdID.