Detection rules › Elastic
Potential Remote Execution via IMsiServer
Identifies potential attempts to abuse the IMsiServer Component Object Model (COM) interface to start a remote instance of the msiexec.exe service for lateral movement.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Stealth | |
| Lateral Movement |
Rule body
[rule]
description = """
Identifies potential attempts to abuse the IMsiServer Component Object Model (COM) interface to start a remote instance
of the msiexec.exe service for lateral movement.
"""
id = "40696acd-67c8-473e-a8ee-9ade3506d141"
license = "Elastic License v2"
name = "Potential Remote Execution via IMsiServer"
os_list = ["windows"]
reference = ["https://www.deepinstinct.com/blog/forget-psexec-dcom-upload-execute-backdoor"]
version = "1.0.3"
query = '''
sequence by source.ip with maxspan=5s
[authentication where event.action == "log_on" and process.Ext.session_info.logon_type == "Network" and
(user.effective.id != null and user.effective.id like ("S-1-5-21*", "S-1-12-*"))]
[network where event.action in ("connection_accepted", "disconnect_received") and process.name == "msiexec.exe" and
source.port >= 49152 and destination.port >= 49152 and not cidrmatch(source.ip, "127.0.0.0/8", "::1")]
'''
min_endpoint_version = "8.15.1"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[[threat.technique.subtechnique]]
id = "T1218.007"
name = "Msiexec"
reference = "https://attack.mitre.org/techniques/T1218/007/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1021"
name = "Remote Services"
reference = "https://attack.mitre.org/techniques/T1021/"
[threat.tactic]
id = "TA0008"
name = "Lateral Movement"
reference = "https://attack.mitre.org/tactics/TA0008/"
[internal]
min_endpoint_version = "8.15.1"
Stages and Predicates
Ordered sequence: each step below must occur in order within 5s, correlated by source.ip.
Stage 1: authentication
[authentication where event.action == "log_on" and process.Ext.session_info.logon_type == "Network" and
(user.effective.id != null and user.effective.id like ("S-1-5-21*", "S-1-12-*"))]
Stage 2: network
[network where event.action in ("connection_accepted", "disconnect_received") and process.name == "msiexec.exe" and
source.port >= 49152 and destination.port >= 49152 and not cidrmatch(source.ip, "127.0.0.0/8", "::1")]
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
source.ip | cidr_match | 127.0.0.0/8, ::1 | excludes:source.ip field:"source.ip" value:"127.0.0.0/8" field:"source.ip" value:"::1" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
destination.port | ge |
| field:"DestinationPort" kind:ge value:"49152" |
event.action | eq |
| field:"EventType" kind:eq value:"log_on" |
event.action | in |
| field:"EventType" kind:in |
process.Ext.session_info.logon_type | eq |
| field:"process.Ext.session_info.logon_type" kind:eq value:"Network" |
process.name | eq |
| field:"process_name" kind:eq value:"msiexec.exe" |
source.port | ge |
| field:"SourcePort" kind:ge value:"49152" |
user.effective.id | is_not_null | field:"user.effective.id" kind:is_not_null | |
user.effective.id | wildcard |
| field:"user.effective.id" kind:wildcard |