SocksOverRDP

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.

Resources

Partial Demo

Servers / Requirements

  • 2 Windows machines (Server or Workstation running)

  • Linux Host

PoC

Machines

  • 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

Steps

  1. Install Releases : .DLL on the Client and .EXE on the Server

  2. On Client, administrator command prompt:

  1. On Client: connect to the server via RDP: mstsc.exe.

    1. Run a powershell command (admin) on the server via RDP :

  1. 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/)

  1. Access: http://10.0.2.4 via Client machine

SOCKS Chain

Client

(After step 2)

  1. 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.

  2. Repeat steps 3 to 4 to apply this change

Linux

  1. Install proxychains4 on the Linux machine:

  1. Modify the proxychains4 configuration file and configure it to forward traffic to the SOCKS proxy created by SocksOverRDP on the Windows client:

  1. Test the connection to the IIS server from the Linux machine:

Last updated

Was this helpful?