Detection rules › Elastic
Execution via WMI followed by Network Connection
Identifies the execution of a process via Windows Management Instrumentation (WMI) and where the effective parent is performing network connections to the internet.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Execution |
Rule body
[rule]
description = """
Identifies the execution of a process via Windows Management Instrumentation (WMI) and where the effective parent is
performing network connections to the internet.
"""
id = "cf738466-9fff-44d9-8603-4a7e6e6c8d1f"
license = "Elastic License v2"
name = "Execution via WMI followed by Network Connection"
os_list = ["windows"]
version = "1.0.8"
query = '''
sequence with maxspan=5m
[process where event.action == "start" and
process.parent.name : "WmiPrvSE.exe" and process.Ext.effective_parent.executable : "C:\\*" and
not (process.executable : "?:\\Windows\\System32\\spool\\drivers\\*" and
process.Ext.effective_parent.executable : "?:\\Windows\\LTSvc\\LTSVC.exe") and
not (process.name : "WerFault.exe" and process.Ext.effective_parent.name : ("WmiPrvSE.exe", "svchost.exe")) and
not process.hash.sha256 :
("f4620b3925a5671585e658d009a0909971c75ff24618d95ef366f0b237608ef0",
"0e8606ba02828d403e321e37f1568aa321a95d3bdbdb83b73583105b666d79ba") and
not (process.Ext.effective_parent.executable : "C:\\Windows\\System32\\inetsrv\\w3wp.exe" and
process.command_line : "C:\\Windows\\system32\\cmd.exe /c C:\\SysMgmt\\service\\mwtools\\SD_Installer_Start.cmd") and
not (process.code_signature.subject_name : ("FUJITSU CLIENT COMPUTING LIMITED", "Siemens AG") and process.code_signature.trusted == true) and
not process.Ext.effective_parent.executable :
("I:\\SCCM\\bin\\X64\\smsexec.exe",
"?:\\Program Files\\*.exe",
"?:\\Program Files (x86)\\*.exe",
"?:\\Windows\\System32\\wbem\\WmiPrvSE.exe",
"?:\\Windows\\CCM\\ClientUX\\SCClient.exe",
"C:\\Windows\\CCM\\CcmExec.exe",
"C:\\Windows\\ccmcache\\*.exe",
"C:\\Windows\\System32\\taskhostw.exe")] by process.Ext.effective_parent.entity_id
[network where
/* omitted 192.168.0.0 for testing */
not cidrmatch(destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24",
"192.0.0.0/29", "192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32",
"192.0.2.0/24", "192.31.196.0/24", "192.52.193.0/24", "192.88.99.0/24", "224.0.0.0/4",
"100.64.0.0/10", "192.175.48.0/24","198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1",
"FE80::/10", "FF00::/8")] by process.entity_id
'''
min_endpoint_version = "8.4.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.4.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 5m, correlated by process.Ext.effective_parent.entity_id, process.entity_id.
Stage 1: process
[process where event.action == "start" and
process.parent.name : "WmiPrvSE.exe" and process.Ext.effective_parent.executable : "C:\\*" and
not (process.executable : "?:\\Windows\\System32\\spool\\drivers\\*" and
process.Ext.effective_parent.executable : "?:\\Windows\\LTSvc\\LTSVC.exe") and
not (process.name : "WerFault.exe" and process.Ext.effective_parent.name : ("WmiPrvSE.exe", "svchost.exe")) and
not process.hash.sha256 :
("f4620b3925a5671585e658d009a0909971c75ff24618d95ef366f0b237608ef0",
"0e8606ba02828d403e321e37f1568aa321a95d3bdbdb83b73583105b666d79ba") and
not (process.Ext.effective_parent.executable : "C:\\Windows\\System32\\inetsrv\\w3wp.exe" and
process.command_line : "C:\\Windows\\system32\\cmd.exe /c C:\\SysMgmt\\service\\mwtools\\SD_Installer_Start.cmd") and
not (process.code_signature.subject_name : ("FUJITSU CLIENT COMPUTING LIMITED", "Siemens AG") and process.code_signature.trusted == true) and
not process.Ext.effective_parent.executable :
("I:\\SCCM\\bin\\X64\\smsexec.exe",
"?:\\Program Files\\*.exe",
"?:\\Program Files (x86)\\*.exe",
"?:\\Windows\\System32\\wbem\\WmiPrvSE.exe",
"?:\\Windows\\CCM\\ClientUX\\SCClient.exe",
"C:\\Windows\\CCM\\CcmExec.exe",
"C:\\Windows\\ccmcache\\*.exe",
"C:\\Windows\\System32\\taskhostw.exe")] by process.Ext.effective_parent.entity_id
Stage 2: network
[network where
not cidrmatch(destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24",
"192.0.0.0/29", "192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32",
"192.0.2.0/24", "192.31.196.0/24", "192.52.193.0/24", "192.88.99.0/24", "224.0.0.0/4",
"100.64.0.0/10", "192.175.48.0/24","198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1",
"FE80::/10", "FF00::/8")] by process.entity_id
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.Ext.effective_parent.executable | eq | ?:\Windows\LTSvc\LTSVC.exe | excludes:process.Ext.effective_parent.executable field:"process.Ext.effective_parent.executable" value:"?:\Windows\LTSvc\LTSVC.exe" |
process.executable | starts_with | ?:\Windows\System32\spool\drivers\ | excludes:process.executable field:"process.executable" value:"?:\Windows\System32\spool\drivers\" |
process.Ext.effective_parent.executable | eq | C:\Windows\System32\inetsrv\w3wp.exe | excludes:process.Ext.effective_parent.executable field:"process.Ext.effective_parent.executable" value:"C:\Windows\System32\inetsrv\w3wp.exe" |
process.command_line | eq | C:\Windows\system32\cmd.exe /c C:\SysMgmt\service\mwtools\SD_Installer_Start.cmd | excludes:process.command_line field:"process.command_line" value:"C:\Windows\system32\cmd.exe /c C:\SysMgmt\service\mwtools\SD_Installer_Start.cmd" |
process.Ext.effective_parent.name | eq | WmiPrvSE.exe, svchost.exe | excludes:process.Ext.effective_parent.name field:"process.Ext.effective_parent.name" value:"WmiPrvSE.exe" field:"process.Ext.effective_parent.name" value:"svchost.exe" |
process.name | eq | WerFault.exe | excludes:process.name field:"process.name" value:"WerFault.exe" |
process.code_signature.subject_name | eq | FUJITSU CLIENT COMPUTING LIMITED, Siemens AG | excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"FUJITSU CLIENT COMPUTING LIMITED" field:"process.code_signature.subject_name" value:"Siemens AG" |
process.code_signature.trusted | eq | true | excludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true" |
process.Ext.effective_parent.executable | wildcard | I:\SCCM\bin\X64\smsexec.exe, ?:\Program Files\*.exe, ?:\Program Files (x86)\*.exe, ?:\Windows\System32\wbem\WmiPrvSE.exe, ?:\Windows\CCM\ClientUX\SCClient.exe, C:\Windows\CCM\CcmExec.exe, C:\Windows\ccmcache\*.exe, C:\Windows\System32\taskhostw.exe | excludes:process.Ext.effective_parent.executable |
process.hash.sha256 | eq | f4620b3925a5671585e658d009a0909971c75ff24618d95ef366f0b237608ef0, 0e8606ba02828d403e321e37f1568aa321a95d3bdbdb83b73583105b666d79ba | excludes:process.hash.sha256 field:"process.hash.sha256" value:"f4620b3925a5671585e658d009a0909971c75ff24618d95ef366f0b237608ef0" field:"process.hash.sha256" value:"0e8606ba02828d403e321e37f1568aa321a95d3bdbdb83b73583105b666d79ba" |
destination.ip | cidr_match | 10.0.0.0/8, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.0.0/29, 192.0.0.8/32, 192.0.0.9/32, 192.0.0.10/32, 192.0.0.170/32, 192.0.0.171/32, 192.0.2.0/24, 192.31.196.0/24, 192.52.193.0/24, 192.88.99.0/24, 224.0.0.0/4, 100.64.0.0/10, 192.175.48.0/24, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 240.0.0.0/4, ::1, FE80::/10, FF00::/8 | excludes:destination.ip |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
process.Ext.effective_parent.executable | wildcard |
| field:"process.Ext.effective_parent.executable" kind:wildcard value:"C:\*" |
process.parent.name | wildcard |
| field:"parent_process_name" kind:wildcard value:"WmiPrvSE.exe" |