Detection rules › Elastic
Suspicious DLLRegisterServer Execution via MSIEXEC
Identifies the execution of the built-in Windows Installer, MSIEXEC, to execute code via calling the exported function DLLRegisterServer from a suspicious module.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule body
[rule]
description = """
Identifies the execution of the built-in Windows Installer, MSIEXEC, to execute code via calling the exported function
DLLRegisterServer from a suspicious module.
"""
id = "ed77616c-8f97-472b-bb15-532af004e82a"
license = "Elastic License v2"
name = "Suspicious DLLRegisterServer Execution via MSIEXEC"
os_list = ["windows"]
reference = [
"https://lolbas-project.github.io/lolbas/Binaries/Msiexec/",
"https://www.elastic.co/security-labs/Hunting-for-Suspicious-Windows-Libraries-for-Execution-and-Evasion",
]
version = "1.0.25"
query = '''
process where event.action == "start" and
process.pe.original_file_name : "msiexec.exe" and process.args : ("/z", "/y", "-y", "-z") and
not process.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*") and
not process.Ext.token.integrity_level_name == "system" and
not (process.parent.executable : "?:\\Windows\\Sys*\\msiexec.exe" and process.parent.args : "/V") and
not (process.args : "?:\\windows\\system32\\nise.dll" and process.parent.executable : "?:\\Windows\\System32\\runonce.exe")
'''
min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
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/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Stage 1: process
process where event.action == "start" and
process.pe.original_file_name : "msiexec.exe" and process.args : ("/z", "/y", "-y", "-z") and
not process.args : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*") and
not process.Ext.token.integrity_level_name == "system" and
not (process.parent.executable : "?:\\Windows\\Sys*\\msiexec.exe" and process.parent.args : "/V") and
not (process.args : "?:\\windows\\system32\\nise.dll" and process.parent.executable : "?:\\Windows\\System32\\runonce.exe")
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | eq | ?:\windows\system32\nise.dll | excludes:process.args field:"process.args" value:"?:\windows\system32\nise.dll" |
process.parent.executable | eq | ?:\Windows\System32\runonce.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Windows\System32\runonce.exe" |
process.parent.args | eq | /V | excludes:process.parent.args field:"process.parent.args" value:"/V" |
process.parent.executable | wildcard | ?:\Windows\Sys*\msiexec.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Windows\Sys*\msiexec.exe" |
process.Ext.token.integrity_level_name | eq | system | excludes:process.Ext.token.integrity_level_name field:"process.Ext.token.integrity_level_name" value:"system" |
process.args | starts_with | ?:\Program Files\, ?:\Program Files (x86)\ | excludes:process.args field:"process.args" value:"?:\Program Files\" field:"process.args" value:"?:\Program Files (x86)\" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.pe.original_file_name | wildcard |
| field:"OriginalFileName" kind:wildcard value:"msiexec.exe" |