SocksOverRDP
Last updated
Last updated
This tool adds SOCKS proxy functionality to Terminal Services (or Remote Desktop Services) and Citrix (XenApp/XenDesktop).
It uses a dynamic virtual channel that allows us to communicate via an open RDP/Citrix connection without the need to open a new socket, connection or port on a firewall.
2 Windows machines (Server or Workstation running)
Linux Host
Windows 2008 (Server):
2 network cards: 192.168.56.127 (private host) and 10.0.2.4 (NAT network)
RDP and IIS roles enabled
IIS server on NAT network 10.0.2.4 (inaccessible by Client machine and Linux Host)
Windows 10 (Client):
1 network card (private host): 192.168.56.126
RDP enabled
Linux host
192.168.56.1
On the 2 Windows workstations :
Install Releases : .DLL on the Client and .EXE on the Server
On Client, administrator command prompt:
On Client: connect to the server via RDP: mstsc.exe
.
Run a powershell command (admin) on the server via RDP :
Back to Client, administrator command prompt:
Add SOCKS proxy configuration
Control Panel > Network & Internet > Internet Options > Connections > LAN Settings > Use Proxy Server (Advanced) > Socks : 127.0.0.1:1080 Proxy Settings > Use a proxy server (ON) > Address: http://socks=127.0.0.1 ; Port: 1080
(Or use proxifier: https://www.proxifier.com/)
Access: http://10.0.2.4 via Client machine
We want to :
From Linux machine (192.168.56.0/24) -> access server network
Chain : Server -> Client -> Linux
Client
(After step 2)
By default, the binding is set to 127.0.0.1 on the Client machine (inaccessible by the Linux machine), so change this value in regedit.exe to its private IP address (192.168.56.126): HKEY_CURRENT_USER\SOFTWARE\Microsoft\Terminal Server Client\Default\AddIns\SocksOverRDP-Plugin
.
Repeat steps 3 to 4 to apply this change
Linux
Install proxychains4 on the Linux machine:
Modify the proxychains4 configuration file and configure it to forward traffic to the SOCKS proxy created by SocksOverRDP on the Windows client:
Test the connection to the IIS server from the Linux machine: