T1218.007 Msiexec
Sub-technique of: T1218
High-Level Description
Adversaries may abuse msiexec.exe to proxy execution of malicious payloads. Msiexec.exe is the command-line utility for the Windows Installer and is thus commonly associated with executing installation packages (.msi). The Msiexec.exe binary may also be digitally signed by Microsoft.
Adversaries may abuse msiexec.exe to launch local or network accessible MSI files. Msiexec.exe can also execute DLLs. Since it may be signed and native on Windows systems, msiexec.exe can be used to bypass application control solutions that do not account for its potential abuse. Msiexec.exe execution may also be elevated to SYSTEM privileges if the AlwaysInstallElevated policy is enabled.
Kill Chain Phase
Platforms: Windows
What to Check
How to Test
Atomic Red Team Tests
The following tests are from Atomic Red Team and provide actionable ways to test this technique:
Atomic Test 1: Msiexec.exe - Execute Local MSI file with embedded JScript
Executes an MSI containing embedded JScript code using msiexec.exe
Supported Platforms: windows
#{msi_exe} /q /#{action} "#{msi_payload}"
Dependencies:
- The MSI file must exist on disk at specified location (#{msi_payload})
Atomic Test 2: Msiexec.exe - Execute Local MSI file with embedded VBScript
Executes an MSI containing embedded VBScript code using msiexec.exe
Supported Platforms: windows
#{msi_exe} /q /#{action} "#{msi_payload}"
Dependencies:
- The MSI file must exist on disk at specified location (#{msi_payload})
Atomic Test 3: Msiexec.exe - Execute Local MSI file with an embedded DLL
Executes an MSI containing an embedded DLL using msiexec.exe
Supported Platforms: windows
#{msi_exe} /q /#{action} "#{msi_payload}"
Dependencies:
- The MSI file must exist on disk at specified location (#{msi_payload})
Atomic Test 4: Msiexec.exe - Execute Local MSI file with an embedded EXE
Executes an MSI containing an embedded EXE using msiexec.exe
Supported Platforms: windows
#{msi_exe} /q /#{action} "#{msi_payload}"
Dependencies:
- The MSI file must exist on disk at specified location (#{msi_payload})
Atomic Test 5: WMI Win32_Product Class - Execute Local MSI file with embedded JScript
Executes an MSI containing embedded JScript code using the WMI Win32_Product class
Supported Platforms: windows
Invoke-CimMethod -ClassName Win32_Product -MethodName #{action} -Arguments @{ PackageLocation = '#{msi_payload}' }
Dependencies:
- The MSI file must exist on disk at specified location (#{msi_payload})
Manual Testing
If Atomic Red Team tests are not applicable, manually verify the technique by:
-
Identify Attack Surface: Determine if the target environment is susceptible to Msiexec by examining the target platforms (Windows).
-
Assess Existing Defenses: Review whether mitigations for T1218.007 are in place. If defenses are absent or misconfigured, this technique may be exploitable.
-
Execute Test: Use tools and methods described in the MITRE ATT&CK page and external references below.
Remediation Guide
M1042 Disable or Remove Feature or Program
Consider disabling the AlwaysInstallElevated policy to prevent elevated execution of Windows Installer packages.
M1026 Privileged Account Management
Restrict execution of Msiexec.exe to privileged accounts or groups that need to use it to lessen the opportunities for malicious usage.
Detection
Detection of Msiexec Abuse for Local, Network, and DLL Execution
Risk Assessment
| Finding | Severity | Impact |
|---|
| Msiexec technique applicable | High | Defense Evasion |
CWE Categories
| CWE ID | Title |
|---|
| CWE-693 | Protection Mechanism Failure |
References