Detection rules › Sigma
SC.EXE Query Execution
Detects execution of "sc.exe" to query information about registered services on the system
Known false positives
- 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"
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Discovery |
Telemetry coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 1: Process creation |
Rule body
title: SC.EXE Query Execution
id: 57712d7a-679c-4a41-a913-87e7175ae429
status: test
description: Detects execution of "sc.exe" to query information about registered services on the system
references:
- https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1007/T1007.md#atomic-test-1---system-service-discovery
author: frack113
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
Stages and Predicates
Stage 0: condition
all of selection_* and not 1 of filter_optional_*Stage 1: selection_img
selection_img:
Image|endswith: '\sc.exe'
OriginalFileName: 'sc.exe'
Stage 2: selection_cli
selection_cli:
CommandLine|contains: ' query'
Stage 3: not filter_optional_keybase
filter_optional_keybase:
CommandLine: 'sc query dokan1'
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
CommandLine | eq | sc query dokan1 | excludes:CommandLine field:"CommandLine" value:"sc query dokan1" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
CommandLine | match |
| field:"CommandLine" kind:match value:" query" |
Image | ends_with |
| field:"Image" kind:ends_with value:"\sc.exe" |
OriginalFileName | eq |
| field:"OriginalFileName" kind:eq value:"sc.exe" |