Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Adversaries may abuse Windows Management Instrumentation (WMI) to execute malicious commands and payloads.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 21% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 75% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 80% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 12% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 52% | 0% |
Adversaries may abuse Windows Management Instrumentation (WMI) to execute malicious commands and payloads. WMI is designed for programmers and is the infrastructure for management data and operations on Windows systems. WMI is an administration feature that provides a uniform environment to access Windows system components.
The WMI service enables both local and remote access, though the latter is facilitated by Remote Services such as Distributed Component Object Model and Windows Remote Management. Remote WMI over DCOM operates using port 135, whereas WMI over WinRM operates over port 5985 when using HTTP and 5986 for HTTPS.
An adversary can use WMI to interact with local and remote systems and use it as a means to execute various behaviors, such as gathering information for Discovery as well as Execution of commands and payloads. For example, wmic.exe can be abused by an adversary to delete shadow copies with the command wmic.exe Shadowcopy Delete (i.e., Inhibit System Recovery).
Note: wmic.exe is deprecated as of January of 2024, with the WMIC feature being “disabled by default” on Windows 11+. WMIC will be removed from subsequent Windows releases and replaced by PowerShell as the primary WMI interface. In addition to PowerShell and tools like wbemtool.exe, COM APIs can also be used to programmatically interact with WMI via C++, .NET, VBScript, etc.
Platforms: Windows
The following tests are from Atomic Red Team and provide actionable ways to test this technique:
An adversary might use WMI to list all local User Accounts. When the test completes , there should be local user accounts information displayed on the command line.
Supported Platforms: windows
cmdwmic useraccount get /ALL /format:csv
An adversary might use WMI to list Processes running on the compromised host. When the test completes , there should be running processes listed on the command line.
Supported Platforms: windows
cmdwmic process get caption,executablepath,commandline /format:csv
An adversary might use WMI to list installed Software hotfix and patches. When the test completes, there should be a list of installed patches and when they were installed.
Supported Platforms: windows
cmdwmic qfe get description,installedOn /format:csv
An adversary might use WMI to check if a certain Remote Service is running on a remote device. When the test completes, a service information will be displayed on the screen if it exists. A common feedback message is that "No instance(s) Available" if the service queried is not running. A common error message is "Node - (provided IP or default) ERROR Description =The RPC server is unavailable" if the provided remote host is unreachable
Supported Platforms: windows
cmdwmic /node:"#{node}" service where (caption like "%#{service_search_string}%")
This test uses wmic.exe to execute a process on the local host. When the test completes , a new process will be started locally .A notepad application will be started when input is left on default.
Supported Platforms: windows
cmdwmic process call create #{process_to_execute}
If Atomic Red Team tests are not applicable, manually verify the technique by:
Prevent credential overlap across systems of administrator and privileged accounts.
On Windows 10, enable Attack Surface Reduction (ASR) rules to block processes created by WMI commands from running. Note: many legitimate tools and applications utilize WMI for command execution.
By default, only administrators are allowed to connect remotely using WMI. Restrict other users who are allowed to connect, or disallow all users to connect remotely to WMI.
Use application control configured to block execution of <code>wmic.exe</code> if it is not required for a given system or network to prevent potential misuse by adversaries. For example, in Windows 10 and Windows Server 2016 and above, Windows Defender Application Control (WDAC) policy rules may be applied to block the <code>wmic.exe</code> application and to prevent abuse.
| Finding | Severity | Impact | | ------------------------------------------------------- | -------- | --------- | | Windows Management Instrumentation technique applicable | Medium | Execution |
| CWE ID | Title | | ------ | -------------------------------------- | | CWE-94 | Improper Control of Generation of Code |
Other measured skills in the registry, with their headline benchmark lift.