Detection rules › Elastic
Execution via WMI CommandLine Event Consumer
Identifies the creation or execution via the Windows Management Instrumentation CommandLine Event Consumer class. The CommandLineEventConsumer class starts an arbitrary process in the local system when an event is delivered to it.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Execution |
Rule body
[rule]
description = """
Identifies the creation or execution via the Windows Management Instrumentation CommandLine Event Consumer class. The
CommandLineEventConsumer class starts an arbitrary process in the local system when an event is delivered to it.
"""
id = "fd597bc7-8cf6-4dec-8bc0-bda7696bbbdb"
license = "Elastic License v2"
name = "Execution via WMI CommandLine Event Consumer"
os_list = ["windows"]
reference = [
"https://in.security/2019/04/03/an-intro-into-abusing-and-identifying-wmi-event-subscriptions-for-persistence/",
"https://learn.microsoft.com/en-us/windows/win32/wmisdk/commandlineeventconsumer",
]
version = "1.0.10"
query = '''
process where event.action == "start" and
(
(process.parent.executable : "?:\\Windows\\Sys*\\wbem\\WmiPrvSE.exe" and
/* wbemcons.dll - WMI Standard Event Consumers */
process.parent.thread.Ext.call_stack_summary : "*wbemcons.dll*") or
(process.pe.original_file_name : "wmic.exe" and process.command_line : "*create*" and process.command_line : "*CommandLineEventConsumer*")
) and
not (process.executable : ("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*.exe") and
process.code_signature.trusted == true and not process.code_signature.subject_name : "Microsoft*") and
not process.executable : "?:\\Windows\\System32\\chkntfs.exe" and
not process.hash.sha256 : "c4ecbd9e75fbe2d8ab5f4d94d663207d2b73ec924ba9e27b5df9560818ff1105"
'''
min_endpoint_version = "8.7.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1047"
name = "Windows Management Instrumentation"
reference = "https://attack.mitre.org/techniques/T1047/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[internal]
min_endpoint_version = "8.7.0"
Stages and Predicates
Stage 1: process
process where event.action == "start" and
(
(process.parent.executable : "?:\\Windows\\Sys*\\wbem\\WmiPrvSE.exe" and
process.parent.thread.Ext.call_stack_summary : "*wbemcons.dll*") or
(process.pe.original_file_name : "wmic.exe" and process.command_line : "*create*" and process.command_line : "*CommandLineEventConsumer*")
) and
not (process.executable : ("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*.exe") and
process.code_signature.trusted == true and not process.code_signature.subject_name : "Microsoft*") and
not process.executable : "?:\\Windows\\System32\\chkntfs.exe" and
not process.hash.sha256 : "c4ecbd9e75fbe2d8ab5f4d94d663207d2b73ec924ba9e27b5df9560818ff1105"
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.code_signature.subject_name | starts_with | Microsoft | excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Microsoft" |
process.code_signature.trusted | eq | true | excludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true" |
process.executable | wildcard | ?:\Program Files\*.exe, ?:\Program Files (x86)\*.exe | excludes:process.executable field:"process.executable" value:"?:\Program Files\*.exe" field:"process.executable" value:"?:\Program Files (x86)\*.exe" |
process.executable | eq | ?:\Windows\System32\chkntfs.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\System32\chkntfs.exe" |
process.hash.sha256 | eq | c4ecbd9e75fbe2d8ab5f4d94d663207d2b73ec924ba9e27b5df9560818ff1105 | excludes:process.hash.sha256 field:"process.hash.sha256" value:"c4ecbd9e75fbe2d8ab5f4d94d663207d2b73ec924ba9e27b5df9560818ff1105" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
process.code_signature.subject_name | wildcard |
| field:"Signature" kind:wildcard value:"Microsoft*" |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard |
process.parent.executable | wildcard |
| field:"ParentImage" kind:wildcard value:"?:\Windows\Sys*\wbem\WmiPrvSE.exe" |
process.parent.thread.Ext.call_stack_summary | wildcard |
| field:"process.parent.thread.Ext.call_stack_summary" kind:wildcard value:"*wbemcons.dll*" |
process.pe.original_file_name | wildcard |
| field:"OriginalFileName" kind:wildcard value:"wmic.exe" |