Detection rules › Elastic

Potential Injection via the Console Window Class

Source
github.com/elastic/protections-artifacts

Identifies the execution of a process from the Windows Console host and from an unbacked memeory region. This may indicate an attempt to inject code via the ConsoleWindowClass method.

MITRE ATT&CK coverage

TacticTechniques
Stealth

Rule body

[rule]
description = """
Identifies the execution of a process from the Windows Console host and from an unbacked memeory region. This may
indicate an attempt to inject code via the ConsoleWindowClass method.
"""
id = "2ad63716-3dc3-49ba-b682-ef4b9e4a4d87"
license = "Elastic License v2"
name = "Potential Injection via the Console Window Class"
os_list = ["windows"]
reference = [
    "https://github.com/odzhan/injection/tree/master/conhost",
    "https://modexp.wordpress.com/2018/09/12/process-injection-user-data/",
    "https://www.elastic.co/security-labs/upping-the-ante-detecting-in-memory-threats-with-kernel-call-stacks",
]
version = "1.0.19"

query = '''
process where event.action == "start" and
 process.parent.name : "conhost.exe" and
 process.parent.thread.Ext.call_stack_contains_unbacked == true and
 process.parent.thread.Ext.call_stack_summary : "*kernelbase.dll|Unbacked*" and
 not process.executable : "C:\\Program Files (x86)\\Microsoft Intune Management Extension\\AgentExecutor.exe"
'''

min_endpoint_version = "8.8.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"


[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "8.8.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
 process.parent.name : "conhost.exe" and
 process.parent.thread.Ext.call_stack_contains_unbacked == true and
 process.parent.thread.Ext.call_stack_summary : "*kernelbase.dll|Unbacked*" and
 not process.executable : "C:\\Program Files (x86)\\Microsoft Intune Management Extension\\AgentExecutor.exe"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executableeqC:\Program Files (x86)\Microsoft Intune Management Extension\AgentExecutor.exeexcludes:process.executable field:"process.executable" value:"C:\Program Files (x86)\Microsoft Intune Management Extension\AgentExecutor.exe"

Indicators

These rows show field, operator, and value matches.