Remote File Execution via MSIEXEC
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.
Query · eql
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")
)]