13. RDP Socks tunneling with SocksOverRDP

Situation:

SocksOverRDP is an example of one such tool. https://github.com/nccgroup/SocksOverRDP

Uses DVC Dynamic Virtual Channels from RDP service feature in windows.

We use the tool proxifier as our proxy server. https://www.proxifier.com/

Binaries: https://github.com/nccgroup/SocksOverRDP/releases https://www.proxifier.com/download/#win-tab

We can then connect to the target using xfreerdp and copy the SocksOverRDPx64.zip file to the target. From the Windows target, we will then need to load the SocksOverRDP.dll using regsvr32.exe.

C:\Users\htb-student\Desktop\SocksOverRDP-x64> regsvr32.exe SocksOverRDP-Plugin.dll

just search for RDP in search to open rdp client.

Now we can connect to 172.16.5.19 over RDP using mstsc.exe, and we should receive a prompt that the SocksOverRDP plugin is enabled, and it will listen on 127.0.0.1:1080. We can use the credentials victor:pass@123 to connect to 172.16.5.19. ![](/img/Pasted image 20240827194902.png)

We need to transfer SocksOverRDPx64.zip or just SocksOverRDP-Server.exe to 172.16.5.19 then we can start SocksOverRDP-Server.exe with admin privileges .\SocksOverRDP-Server.exe

When we go back to foothold target and check with netstat we will see SOCKS listener started on 127.0.0.1:1080

netstat -antb | findstr 1080

After listener is started, transfer Proxifier to Win10 target (on 10.129.x.x network) and configure it to forward all packets to 127.0.0.1:1080

![](/img/Pasted image 20240827195820.png)

![](/img/Pasted image 20240826173431.png)

When interacting with our RDP sessions on an engagement, we may find ourselves contending with slow performance in a given session, especially if we are managing multiple RDP sessions simultaneously. If this is the case, we can access the Experience tab in mstsc.exe and set Performance to Modem.