SC.EXE Query Execution
A Sigma rule for process creation on Windows, from SigmaHQ’s threat hunting rules, by frack113.
low 1 ATT&CK technique 1 program it names 9 everyday examples trip it
What it looks for
detection:
filter_optional_keybase:
CommandLine: 'sc query dokan1'
selection_cli:
CommandLine|contains: ' query'
selection_img:
Image|endswith: '\sc.exe'
OriginalFileName: 'sc.exe'
condition: all of selection_* and not 1 of filter_optional_*
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 frack113, 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
Show the status of a service (no service name will list all services) on the page for sc.exe
sc query service_nameIdentifyTo display information for active services only, type either of the following commands on the page for sc query
sc.exe query
sc.exe query type= serviceIdentifyTo display information for active services, and to specify a buffer size of 2,000 bytes, type on the page for sc query
sc.exe query type= all bufsize= 2000IdentifyTo display information for the wuauserv service, type on the page for sc query
sc.exe query wuauservIdentifyTo display information for all services (active and inactive), type on the page for sc query
sc.exe query state= allIdentifyTo display information for all services (active and inactive), beginning at line 56, type on the page for sc query
sc.exe query state= all ri= 56IdentifyTo display information for interactive services, type on the page for sc query
sc.exe query type= service type= interactIdentify