Detection rules › Splunk
Suspicious Conhost.exe Commands (Windows Event Log)
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 | T1202 Indirect Command Execution, T1211 Exploitation for Stealth |
References
Event coverage
| Provider | Event | Title |
|---|---|---|
| Security-Auditing | Event ID 4688 | A new process has been created. |
Rule body yaml
id: '17711.29476'
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_winevent` (TERM(EventCode=4688) OR
"<EventID>4688<" OR Type=Process) 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:
- Process command-line parameters
- Windows event logs
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_winevent` (TERM(EventCode=4688) OR "<EventID>4688<" OR Type=Process) TERM(conhost)
Stage 2: regex
| regex process="(?i)conhost\.exe.*?\.exe"
Stage 3: eval
| 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
Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.
Search terms
Bare-string tokens in the SPL search body. Splunk matches each token against _raw (the untyped raw event text) anywhere it appears, not against a specific field. These don't surface in the Indicators table because they aren't predicates on a known field.
| Stage | Term |
|---|---|
| 1 | TERM |
| 1 | "<EventID>4688<" |
| 1 | TERM |
| 1 | conhost |