Detection rules › Splunk
Suspicious Conhost.exe Commands (Sysmon)
Adversaries may abuse utilities that allow for command execution to bypass security restrictions that limit the use of command-line interpreters. This use case detects commands using conhost.exe to launch other executables, which may be used by adversaries to evade detection and bypass restrictions
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Stealth |
References
Telemetry coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 1: Process creation |
Rule body
id: '17711.29614'
title: Suspicious Conhost.exe Commands
description: 'Adversaries may abuse utilities that allow for command execution to
bypass security restrictions that limit the use of command-line interpreters. This
use case detects commands using conhost.exe to launch other executables, which may
be used by adversaries to evade detection and bypass restrictions. -- Software Association:
Qakbot -- Atomics T1202 Test #3'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_sysmon` (TERM(EventCode=1) OR "<EventID>1<")
TERM(conhost) | regex process="(?i)conhost\.exe.*?\.exe"| rex field=process "(?i)conhost\.exe\s+\"(?<spawned_process>[^\"]+)\.exe"
| table _time, host, user parent_*, process, process_*, signature_id, spawned_process|
bin span=1s | stats values(*) as * by _time, host '
techniques:
- defense-evasion:indirect command execution
- defense-evasion:exploitation for defense evasion
technique_id:
- T1202
- T1211
data_category:
- Windows Sysmon
- Process command-line parameters
references:
- http://www.hexacorn.com/blog/2020/05/25/how-to-con-your-host/
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1202/T1202.md#atomic-test-3---indirect-command-execution---conhostexe
Stages and Predicates
Stage 1: search
`get_endpoint_data` `get_endpoint_data_sysmon` (TERM(EventCode=1) OR "<EventID>1<") TERM(conhost)
Stage 2: regex
| regex process="(?i)conhost\.exe.*?\.exe"
Stage 3: rex
| rex field=process "(?i)conhost\.exe\s+\"(?<spawned_process>[^\"]+)\.exe"
Stage 4: table
| table _time, host, user parent_*, process, process_*, signature_id, spawned_process
Stage 5: bucket
| bin span=1s
Stage 6: stats
| stats values(*) as * by _time, host
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
EventCode | eq |
| field:"EventID" kind:eq value:"1" |
process | regex_match |
| field:"CommandLine" kind:regex_match |
Search terms
These SPL tokens match against raw event text.
| Stage | Term |
|---|---|
| 1 | "<EventID>1<" |
| 1 | conhost |