| name | performing-lateral-movement-with-wmiexec |
| description | Perform lateral movement across Windows networks using WMI-based remote execution techniques including Impacket wmiexec.py, CrackMapExec, and native WMI commands for stealthy post-exploitation during red team engagements. |
| domain | cybersecurity |
| subdomain | red-teaming |
| tags | ["red-team","lateral-movement","wmiexec","wmi","post-exploitation","impacket","windows"] |
| version | 1.0 |
| author | mahipal |
| license | Apache-2.0 |
| d3fend_techniques | ["Executable Denylisting","Execution Isolation","Application Protocol Command Analysis","Network Isolation","Network Traffic Analysis"] |
| nist_csf | ["ID.RA-01","GV.OV-02","DE.AE-07"] |
Performing Lateral Movement with WMIExec
Legal Notice: This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.
Overview
WMI (Windows Management Instrumentation) is a legitimate Windows administration framework that red teams abuse for lateral movement because it provides remote command execution without deploying additional services or leaving obvious artifacts like PsExec. Impacket's wmiexec.py creates a semi-interactive shell over WMI by executing commands through Win32_Process.Create and reading output via temporary files on ADMIN$ share. Unlike PsExec, WMIExec does not install a service on the target, making it stealthier and less likely to trigger security alerts. WMI-based lateral movement maps to MITRE ATT&CK T1047 (Windows Management Instrumentation) and is used by threat actors including APT29, APT32, and Lazarus Group.
When to Use
- When conducting security assessments that involve performing lateral movement with wmiexec
- When following incident response procedures for related security events
- When performing scheduled security testing or auditing activities
- When validating security controls through hands-on testing
Most Often Missed & How to Confirm
- Try every exec method before giving up: if
wmiexec.py hangs or returns no output, switch to smbexec.py, atexec.py, or dcomexec.py — a blocked Win32_Process.Create does not mean the host is unreachable.
- Output retrieval is the usual failure point: wmiexec writes output to a temp file on
ADMIN$; if that share is unwritable use -nooutput/semi-interactive blind exec. No output != no execution.
- Auth nuances: pass-the-hash with
-hashes LM:NT, Kerberos with -k -no-pass (needs a TGT/ccache); confirm 135 + 445 are open and the account is a local admin (CrackMapExec --shares).
- EDR artifacts to expect:
wmiprvse.exe spawning cmd.exe/powershell.exe is the classic tell; avoid noisy one-liners and consider --codec.
- Confirm a hit: your command's stdout returns in the shell AND the target logs
4624 Type 3 logon + 5145 ADMIN$ access from your source IP. Don't conclude "blocked" until you've tried smbexec/atexec/dcomexec, verified creds, and checked port reachability.