Windows sc.exe Service Query Execution via Process Creation
Flags sc.exe executions with command lines containing " query", consistent with Windows service information discovery.
- Product
- windows
- Category
- process_creation
- Author
- frack113 (SigmaHQ), DRL 1.1
- Published
- 2021-12-06
- Updated
- 2026-07-31
ATT&CK techniques
DiscoveryRecon
Resource Dev
Initial Access
Execution
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule identifies process executions of sc.exe where the command line includes the string " query", indicating an attempt to query information about registered Windows services. Attackers and administrators may use sc.exe for service discovery and status checks, which can support broader reconnaissance or troubleshooting. It relies on Windows process creation telemetry, matching on the image path/name and the presence of the query keyword in the command line while excluding one specific benign Keybase service query pattern.
Reporting behind it
Changelog
v5- v5Candidate ingested via manual entry.2026-07-31
- v4Candidate ingested via manual entry.2026-07-31
- v3Candidate ingested via manual entry.2026-07-31
- v2Candidate ingested via manual entry.2026-07-31
- v1No changelog recorded for this version.2026-07-30
Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.
title: Windows sc.exe Service Query Execution via Process Creation
id: 98451f66-5f67-4096-a8a5-f1746418a67d
status: test
description: This rule identifies process executions of sc.exe where the command line includes the string " query", indicating an attempt to query information about registered Windows services. Attackers and administrators may use sc.exe for service discovery and status checks, which can support broader reconnaissance or troubleshooting. It relies on Windows process creation telemetry, matching on the image path/name and the presence of the query keyword in the command line while excluding one specific benign Keybase service query pattern.
references:
- https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1007/T1007.md#atomic-test-1---system-service-discovery
- https://github.com/SigmaHQ/sigma/blob/master/rules-threat-hunting/windows/process_creation/proc_creation_win_sc_query.yml
author: frack113, Huntrule Team
date: 2021-12-06
modified: 2024-02-08
tags:
- attack.discovery
- attack.t1007
- detection.threat-hunting
logsource:
category: process_creation
product: windows
detection:
selection_img:
Image|endswith: \sc.exe
OriginalFileName: sc.exe
selection_cli:
CommandLine|contains: " query"
filter_optional_keybase:
CommandLine: sc query dokan1
condition: all of selection_* and not 1 of filter_optional_*
falsepositives:
- Legitimate query of a service by an administrator to get more information such as the state or PID
- Keybase process "kbfsdokan.exe" query the dokan1 service with the following commandline "sc query dokan1"
level: low
license: DRL-1.1
related:
- id: 57712d7a-679c-4a41-a913-87e7175ae429
type: derived