WinRM Lateral Movement
WinRM on port 5985 (HTTP) and 5986 (HTTPS) is present on most modern Windows servers and all domain controllers. Any account in the local Remote Management Users group or with WinRM access configured can open an interactive PowerShell session. Combined with valid credentials or NT hashes, WinRM is one of the cleanest lateral movement paths — no service creation, no binary drop.
Reach Other Hosts with evil-winrm
From a Linux attacker box, evil-winrm is the primary tool. Test access with credentials first:
With a hash — no password cracking needed:
With a domain account:
With a Kerberos ticket — useful when NTLM is blocked or after overpass-the-hash:
Use the hostname, not the IP, when authenticating with Kerberos — SPN resolution requires a name.
Over HTTPS (port 5986):
Spray WinRM Access Across Hosts
Before connecting interactively, verify which hosts in the network accept the credentials over WinRM. nxc handles this efficiently:
WINRM 10.10.10.20 5985 WEB01 [+] corp.local\jsmith:Password123 (Pwn3d!) WINRM 10.10.10.30 5985 FILE01 [-] corp.local\jsmith:Password123 WINRM 10.10.10.10 5985 DC01 [+] corp.local\jsmith:Password123 (Pwn3d!)
(Pwn3d!) = account has WinRM access and can open an interactive session.
Run a command across all reachable WinRM hosts without opening an interactive shell:
PowerShell Remoting from a Windows Session
From a Windows foothold, use PowerShell Remoting directly. This is the native equivalent of evil-winrm and works inside a compromised Windows session without additional tools.
Interactive session:
Without a credential prompt — use a pre-built credential object:
Workaround 2 — register a PSSession configuration with explicit credentials:
Workaround 3 — CredSSP (requires CredSSP enabled on HostA, loud):
CredSSP delegates credentials through the chain but is detectable and requires configuration changes on the intermediate host — avoid unless necessary.
Workaround 4 — Overpass-the-Hash to get a Kerberos TGT and use it for the second hop. See Pass-the-Hash and Pass-the-Ticket.
File Transfer via WinRM Session
Within an evil-winrm session, file transfer is built in:
Within a PowerShell Remoting session, use Copy-Item over the PSSession:
Load Scripts In-Memory via WinRM
evil-winrm can load PowerShell scripts directly into the remote session without writing to disk — useful for post-exploitation modules:
Then within the session:
Load .NET assemblies in-memory:
References
-
WinRM shell with hash, Kerberos, SSL, and in-memory loading
-
WinRM credential spraying and remote command execution
Was this helpful?
Your feedback helps improve this page.