Msiexec
Adversaries may abuse msiexec.exe to proxy execution of malicious payloads. Msiexec.exe is the command-line utility for the Windows Installer and is commonly associated with executing installation packages (.msi). Since it is a signed Microsoft binary, msiexec.exe can bypass application control solutions. Adversaries use it to launch local or remote MSI files and to execute DLLs. Execution may also be elevated to SYSTEM if the AlwaysInstallElevated policy is enabled. Widely abused by malware families including QakBot, IcedID, Emotet, Clop, Maze, Ragnar Locker, Latrodectus, Raspberry Robin, TA505, Rancor, ZIRCONIUM, and many others.
DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName =~ "msiexec.exe"
| extend RemoteMSI = ProcessCommandLine has_any ("http://", "https://", "ftp://")
| extend UNCPath = ProcessCommandLine matches regex @"\\\\.+\\\.+\.msi"
| extend SilentInstall = ProcessCommandLine has_any ("/q", "/quiet", "/passive")
| extend DLLExecution = ProcessCommandLine has "/y"
| extend SuspiciousPath = ProcessCommandLine has_any ("Temp", "AppData", "Downloads", "Public", "Desktop")
| extend SuspiciousParent = InitiatingProcessFileName has_any ("cmd.exe", "powershell.exe", "wscript.exe", "cscript.exe", "mshta.exe", "winword.exe", "excel.exe", "outlook.exe")
| extend PropertyPair = ProcessCommandLine matches regex @"[A-Z]+=.{10,}"
| where RemoteMSI or DLLExecution or (SilentInstall and SuspiciousPath) or (SuspiciousParent and SuspiciousPath) or SuspiciousParent
| project Timestamp, DeviceName, AccountName, ProcessCommandLine, InitiatingProcessFileName,
InitiatingProcessCommandLine, RemoteMSI, SilentInstall, DLLExecution, SuspiciousPath, SuspiciousParent, PropertyPair
| sort by Timestamp desc Data Sources
Required Tables
False Positives
- Legitimate software deployment via SCCM, Intune, or PDQ Deploy which frequently calls msiexec.exe with /quiet or /passive flags
- System updates and Windows Update installation processes that use msiexec.exe with silent flags
- IT administrators manually installing software packages with administrative flags
- Software auto-update mechanisms that download and install MSI packages remotely
References (6)
- https://attack.mitre.org/techniques/T1218/007/
- https://lolbas-project.github.io/lolbas/Binaries/Msiexec/
- https://blog.trendmicro.com/trendlabs-security-intelligence/attack-using-windows-installer-msiexec-exe-leads-lokibot/
- https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/msiexec
- https://docs.microsoft.com/en-us/windows/win32/msi/alwaysinstallelevated
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1218.007/T1218.007.md
Unlock Pro Content
Get the full detection package for T1218.007 including response playbook, investigation guide, and atomic red team tests.