Detection rules › Elastic
Remote File Execution via MSIEXEC
Identifies the execution of the built-in Windows Installer, MSIEXEC, with a url in the command line. Adversaries may abuse msiexec.exe to launch local or network accessible MSI files.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule body
[rule]
description = """
Identifies the execution of the built-in Windows Installer, MSIEXEC, with a url in the command line. Adversaries may
abuse msiexec.exe to launch local or network accessible MSI files.
"""
id = "8ba98e28-d83e-451e-8df7-f0964f7e69b6"
license = "Elastic License v2"
name = "Remote File Execution via MSIEXEC"
os_list = ["windows"]
reference = [
"https://lolbas-project.github.io/lolbas/Binaries/Msiexec/",
"https://lolbas-project.github.io/lolbas/OtherMSBinaries/Devinit/",
"https://www.elastic.co/security-labs/spring-cleaning-with-latrodectus",
"https://www.guardicore.com/labs/purple-fox-rootkit-now-propagates-as-a-worm/",
]
version = "1.0.47"
query = '''
sequence with maxspan=1m
[process where event.action == "start" and
(
((process.pe.original_file_name : "devinit.dll" or process.name : "devinit.exe") and
process.args : "msi-install" and process.command_line : "*http*") or
(process.name : "msiexec.exe" and process.args :("/i", "-i") and
process.args : ("/q", "-q", "/qn", "-qn") and process.args : "\\\\*@*\\*.msi") or
(process.name : "msiexec.exe" and process.args : ("-PaCKagE", "/PaCKagE", "-fv") and
process.args : ("/qn", "-qn", "-q", "/q", "/quiet") and process.command_line : "*http*") or
(process.name : "msiexec.exe" and process.args :("/i", "-i") and
process.args : ("/qn", "-qn", "-q", "/q") and
process.command_line : ("*transforms*http:*", "*transforms*https:*", "*http*INSTALLDIR=%LOCALAPPDATA%*") and
not process.parent.executable : ("D:\\Visma\\Install\\FDN\\PIN\\Client\\Base\\SW\\24200\\PublicInstallerNextGen.exe",
"C:\\Program Files (x86)\\ManageEngine\\UEMS_Agent\\Updates\\AgentUpgrader.exe")) or
(process.name : "powershell.exe" and process.command_line : "*WindowsInstaller*" and
process.command_line : "*http*" and process.command_line : "*InstallProduct*") or
(process.name : "msiexec.exe" and
process.parent.name : ("explorer.exe", "python.exe") and process.args : ("/i", "-i") and
process.command_line : "*http*") or
((process.pe.original_file_name : "msiexec.exe" or process.name : "msiexec.exe") and
process.command_line : "*http*" and process.args_count <= 5 and
(
(process.args : ("/i", "-i") and process.args : ("/q", "/quiet", "/qn", "-q", "-quiet", "-qn", "-Q+")) or
process.args : ("*-Q-I*", "*-I-Q*", "*/q-i*", "*-q/i*", "*/q/i*") or
(process.parent.name : "cmd.exe" and process.parent.args : "/v/r*")
)
and
not descendant of
[process where event.action == "start" and process.name : "*setup*" and process.code_signature.trusted == true] and
not process.Ext.token.integrity_level_name == "system")
) and
not process.args :
("https://download.microsoft.com/download/*.msi",
"APIURL=http*",
"TRANSFORMS=C:\\Program Files (x86)\\ManageEngine\\UEMS_Agent\\\\Updates\\UEMSAgent.mst",
"SERVERNAME=*.manageengine.com",
"C:\\Program Files (x86)\\ManageEngine\\UEMS_DistributionServer\\\\Updates\\UEMSDistributionServer.msi",
"https://awscli.amazonaws.com/AWSCLIV2.msi",
"SERVERURL=https://*.apparmor.com",
"INSTALLARGS=--url=https://*.fleet.us-east-2.aws.elastic-cloud.com:443*",
"https://cdn.zabbix.com/zabbix/binaries/stable/*.msi",
"INSTALLARGS=--url=https://*--enrollment-token=*",
"C:\\WINDOWS\\_ScriptingFramework\\Logs\\Software\\*.log",
"?:\\*\\http*.msi",
"C:\\WINDOWS\\ccmcache\\*.msi",
"C:\\Windows\\Temp\\*.msi",
"\\\\*\\NETLOGON\\*.msi") and
not process.parent.executable :
("C:\\Program Files (x86)\\Novell\\ZENworks\\bin\\ZenworksWindowsService.exe",
"C:\\Program Files (x86)\\ManageEngine\\UEMS_Agent\\Updates\\AgentUpgrader.exe",
"C:\\Program Files (x86)\\FastTrack Software\\Admin By Request\\AdminByRequest.exe") and
not process.executable : "C:\\Program Files (x86)\\AMS Services\\TransactNOW\\OALaunch.exe"
]
[process where event.action in ("start", "already_running") and
(
(process.name : "msiexec.exe" and process.args == "/V") or
(process.parent.name : "msiexec.exe" and process.parent.args == "/V")
)]
'''
min_endpoint_version = "7.15.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1
tree = true
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 1
[[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 : "devinit.dll" or process.name : "devinit.exe") and
process.args : "msi-install" and process.command_line : "*http*") or
(process.name : "msiexec.exe" and process.args :("/i", "-i") and
process.args : ("/q", "-q", "/qn", "-qn") and process.args : "\\\\*@*\\*.msi") or
(process.name : "msiexec.exe" and process.args : ("-PaCKagE", "/PaCKagE", "-fv") and
process.args : ("/qn", "-qn", "-q", "/q", "/quiet") and process.command_line : "*http*") or
(process.name : "msiexec.exe" and process.args :("/i", "-i") and
process.args : ("/qn", "-qn", "-q", "/q") and
process.command_line : ("*transforms*http:*", "*transforms*https:*", "*http*INSTALLDIR=%LOCALAPPDATA%*") and
not process.parent.executable : ("D:\\Visma\\Install\\FDN\\PIN\\Client\\Base\\SW\\24200\\PublicInstallerNextGen.exe",
"C:\\Program Files (x86)\\ManageEngine\\UEMS_Agent\\Updates\\AgentUpgrader.exe")) or
(process.name : "powershell.exe" and process.command_line : "*WindowsInstaller*" and
process.command_line : "*http*" and process.command_line : "*InstallProduct*") or
(process.name : "msiexec.exe" and
process.parent.name : ("explorer.exe", "python.exe") and process.args : ("/i", "-i") and
process.command_line : "*http*") or
((process.pe.original_file_name : "msiexec.exe" or process.name : "msiexec.exe") and
process.command_line : "*http*" and process.args_count <= 5 and
(
(process.args : ("/i", "-i") and process.args : ("/q", "/quiet", "/qn", "-q", "-quiet", "-qn", "-Q+")) or
process.args : ("*-Q-I*", "*-I-Q*", "*/q-i*", "*-q/i*", "*/q/i*") or
(process.parent.name : "cmd.exe" and process.parent.args : "/v/r*")
)
and
not descendant of
[process where event.action == "start" and process.name : "*setup*" and process.code_signature.trusted == true] and
not process.Ext.token.integrity_level_name == "system")
) and
not process.args :
("https://download.microsoft.com/download/*.msi",
"APIURL=http*",
"TRANSFORMS=C:\\Program Files (x86)\\ManageEngine\\UEMS_Agent\\\\Updates\\UEMSAgent.mst",
"SERVERNAME=*.manageengine.com",
"C:\\Program Files (x86)\\ManageEngine\\UEMS_DistributionServer\\\\Updates\\UEMSDistributionServer.msi",
"https://awscli.amazonaws.com/AWSCLIV2.msi",
"SERVERURL=https://*.apparmor.com",
"INSTALLARGS=--url=https://*.fleet.us-east-2.aws.elastic-cloud.com:443*",
"https://cdn.zabbix.com/zabbix/binaries/stable/*.msi",
"INSTALLARGS=--url=https://*--enrollment-token=*",
"C:\\WINDOWS\\_ScriptingFramework\\Logs\\Software\\*.log",
"?:\\*\\http*.msi",
"C:\\WINDOWS\\ccmcache\\*.msi",
"C:\\Windows\\Temp\\*.msi",
"\\\\*\\NETLOGON\\*.msi") and
not process.parent.executable :
("C:\\Program Files (x86)\\Novell\\ZENworks\\bin\\ZenworksWindowsService.exe",
"C:\\Program Files (x86)\\ManageEngine\\UEMS_Agent\\Updates\\AgentUpgrader.exe",
"C:\\Program Files (x86)\\FastTrack Software\\Admin By Request\\AdminByRequest.exe") and
not process.executable : "C:\\Program Files (x86)\\AMS Services\\TransactNOW\\OALaunch.exe"
]
Stage 2: process
[process where event.action in ("start", "already_running") and
(
(process.name : "msiexec.exe" and process.args == "/V") or
(process.parent.name : "msiexec.exe" and process.parent.args == "/V")
)]
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.args | wildcard | https://download.microsoft.com/download/*.msi, APIURL=http*, TRANSFORMS=C:\Program Files (x86)\ManageEngine\UEMS_Agent\\Updates\UEMSAgent.mst, SERVERNAME=*.manageengine.com, C:\Program Files (x86)\ManageEngine\UEMS_DistributionServer\\Updates\UEMSDistributionServer.msi, https://awscli.amazonaws.com/AWSCLIV2.msi, SERVERURL=https://*.apparmor.com, INSTALLARGS=--url=https://*.fleet.us-east-2.aws.elastic-cloud.com:443*, https://cdn.zabbix.com/zabbix/binaries/stable/*.msi, INSTALLARGS=--url=https://*--enrollment-token=*, C:\WINDOWS\_ScriptingFramework\Logs\Software\*.log, ?:\*\http*.msi, C:\WINDOWS\ccmcache\*.msi, C:\Windows\Temp\*.msi, \\*\NETLOGON\*.msi | excludes:process.args |
process.executable | eq | C:\Program Files (x86)\AMS Services\TransactNOW\OALaunch.exe | excludes:process.executable field:"process.executable" value:"C:\Program Files (x86)\AMS Services\TransactNOW\OALaunch.exe" |
process.parent.executable | eq | C:\Program Files (x86)\Novell\ZENworks\bin\ZenworksWindowsService.exe, C:\Program Files (x86)\ManageEngine\UEMS_Agent\Updates\AgentUpgrader.exe, C:\Program Files (x86)\FastTrack Software\Admin By Request\AdminByRequest.exe | excludes:process.parent.executable field:"process.parent.executable" value:"C:\Program Files (x86)\Novell\ZENworks\bin\ZenworksWindowsService.exe" field:"process.parent.executable" value:"C:\Program Files (x86)\ManageEngine\UEMS_Agent\Updates\AgentUpgrader.exe" field:"process.parent.executable" value:"C:\Program Files (x86)\FastTrack Software\Admin By Request\AdminByRequest.exe" |
Indicators
These rows show field, operator, and value matches.