Detection rules › Splunk

Suspicious Conhost.exe Commands (Sysmon)

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

Telemetry coverage

ProviderRecord / event type
SysmonEvent 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"

The parser skipped this rex command.

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.

FieldKindValuesSearch
EventCodeeq
  • 1 corpus 241 (splunk 225, kusto 15, elastic 1)
field:"EventID" kind:eq value:"1"
processregex_match
  • "(?i)conhost.exe.*?.exe" corpus 2 (splunk 2)
field:"CommandLine" kind:regex_match

Search terms

These SPL tokens match against raw event text.

StageTerm
1"<EventID>1<"
1conhost