WinRM Interactive Shell Access
Once creds validate, the fastest way to turn that into operator access is an interactive PSRP session. You’re aiming for a stable PowerShell prompt and quick confirmation of who you are, where you landed, and what’s blocked.
evil-winrm with password
HTTP 5985 default:
Explain command
| -i | Specifies the target IP address to connect to |
| $TARGET_IP | Placeholder for the target IP address |
| -u | Specifies the username for authentication |
| $USER | Placeholder for the username |
| -p | Specifies the password for authentication |
| $PASSWORD | Placeholder for the password |
Domain format when needed:
Explain command
| -i | Specifies the target IP address to connect to |
| $TARGET_IP | Variable placeholder for the target IP address |
| -u | Specifies the username for authentication |
| $DOMAIN\$USER | Variable placeholder for domain-qualified username |
| -p | Specifies the password for authentication |
| $PASSWORD | Variable placeholder for the user password |
Local account format:
*Evil-WinRM* PS C:\Users\...\Documents>
Explain command
| -i $TARGET_IP | Specifies the target IP address to connect to. |
| -u ".\$USER" | Specifies the username with domain prefix for authentication. |
| -p $PASSWORD | Specifies the password for authentication. |
HTTPS and non-standard ports
If WinRM is exposed on 5986:
Explain command
| -i $TARGET_IP | Target IP address to connect to |
| -u $USER | Username for authentication |
| -p $PASSWORD | Password for authentication |
| -S | Use SSL/TLS for secure connection |
Custom port:
Explain command
| -i | Specify target IP address |
| $TARGET_IP | Target IP address variable |
| -u | Specify username for authentication |
| $USER | Username variable |
| -p | Specify password for authentication |
| $PASSWORD | Password variable |
| -P | Specify WinRM port number |
| $PORT | Port number variable |
If the endpoint is not /wsman:
Explain command
| -i $TARGET_IP | Specifies the target IP address to connect to |
| -u $USER | Specifies the username for authentication |
| -p $PASSWORD | Specifies the password for authentication |
| -U /wsman | Specifies the URI path for WinRM connection |
Pass-the-hash shell
Explain command
| -i $TARGET_IP | Specifies the target IP address to connect to |
| -u $USER | Specifies the username for authentication |
| -H <NTHASH> | Specifies the NTLM hash for pass-the-hash authentication |
Over HTTPS:
Explain command
| -i $TARGET_IP | Specifies the target IP address to connect to |
| -u $USER | Specifies the username for authentication |
| -H <NTHASH> | Specifies the NTLM hash for pass-the-hash authentication |
| -S | Enables SSL/TLS encryption for the connection |
Kerberos ticket shell
Kerberos works best when -i is a hostname or FQDN. If you only have an IP, swap $TARGET_IP for the known FQDN.
Using a ticket file:
Explain command
| -i | Specifies the target IP address to connect to |
| $TARGET_IP | Variable placeholder for the target IP address |
| -r | Specifies the domain name for authentication |
| $DOMAIN | Variable placeholder for the domain name |
| -K | Specifies the Kerberos ticket file (ccache) for authentication |
| /path/to/ticket.ccache | Path to the Kerberos credential cache file |
First commands to confirm session quality
Run these immediately to confirm identity, privilege level, and whether the session is constrained:
Explain command
| /groups | Display all group memberships for the current user |
| /priv | Display all privileges assigned to the current user |
What changes your next move:
LanguageModeisConstrainedLanguage: expect missing .NET-heavy tooling and script friction. Lean on built-in binaries and simple PowerShell.Groups show local admin but
whoami /privis thin: likely UAC filtering. Plan for local escalation instead of assuming full token rights.
File transfer in-session
Evil-WinRM has built-in upload and download commands (run them at the Evil-WinRM prompt, not inside PowerShell):
If upload works but execution is blocked, you’re dealing with policy or EDR behavior. Switch to living-off-the-land execution patterns instead of fighting the client.
Common failure modes you’ll actually see
Auth succeeds elsewhere but Evil-WinRM won’t open a shell
If you’re certain creds are valid, but the session fails immediately, the account may not be allowed to open a WinRM session (policy or endpoint restrictions). Validate with a straight WinRM auth check first, then pivot to another remote exec path if WinRM is “auth-only” for that user.
SSL handshakes and cert noise on 5986
Use -S. Don’t waste time fixing cert trust during a pentest unless Kerberos name matching is the real blocker.
Endpoint mismatch
If your earlier probing showed a non-default path, set -U to match the working endpoint.
Variant: native PowerShell Enter-PSSession from Windows
Useful when you’re already operating from a Windows host and want native remoting instead of Evil-WinRM.
References
-
Flags for password/hash/Kerberos, SSL, endpoint selection, and built-in upload/download usage
Was this helpful?
Your feedback helps improve this page.