Detection rules › Splunk

Suspicious Conhost.exe Commands (Windows Event Log)

Group by
_time, host
Source
github.com/anvilogic-forge/armory

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

References

Event coverage

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.

FieldKindValues
EventCodeeq
  • 4688 corpus 313 (splunk 283, kusto 30)
processregex_match
  • "(?i)conhost.exe.*?.exe" corpus 2 (splunk 2)

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.

StageTerm
1TERM
1"<EventID>4688<"
1TERM
1conhost