πŸ”ŒSocksOverRDP

πŸ“‹ Module Overview

Purpose: SOCKS tunneling through RDP Dynamic Virtual Channels (DVC) Tool: SocksOverRDP + Proxifier - Windows-specific pivoting solution Protocol: RDP with custom DLL injection Advantage: Works in Windows-only environments, bypasses SSH restrictions Use Case: Windows network pivoting, RDP session chaining, internal access


1. Introduction to SocksOverRDP

What is SocksOverRDP?

  • Purpose: Tunnels arbitrary packets over RDP connections

  • Mechanism: Uses Dynamic Virtual Channels (DVC) from Remote Desktop Service

  • Components: DLL plugin + Server executable + Proxy client

  • Platform: Windows-specific solution for network pivoting

  • Stealth: Leverages legitimate RDP features for covert tunneling

Dynamic Virtual Channels (DVC)

  • Feature: Built-in RDP capability for packet tunneling

  • Legitimate Uses: Clipboard data transfer, audio sharing, file transfer

  • Abuse: Tunnel custom packets over established RDP connections

  • Advantage: Uses existing RDP infrastructure, difficult to detect

How SocksOverRDP Works

SocksOverRDP vs Other Windows Pivoting

Aspect

SocksOverRDP

SSH Tunnel

Netsh

PowerShell

Platform

Windows Only

Cross-platform

Windows

Windows

Requirements

RDP Access

SSH Client

Admin Rights

PowerShell

Stealth

High

Low

Medium

Medium

Setup Complexity

Medium

Low

Low

High

Performance

Medium

High

High

Low

Detection

Hard

Easy

Medium

Medium


2. Tool Requirements and Setup

Required Components

SocksOverRDP Components

  1. SocksOverRDP-Plugin.dll - Client-side DLL for RDP session

  2. SocksOverRDP-Server.exe - Server-side executable for target

  3. Proxifier - Proxy client for traffic routing

Download URLs

File Preparation

Download and Extract

File Transfer Methods


3. Architecture Overview

Network Topology

Traffic Flow

Component Interaction

  • Proxifier: Routes application traffic to SOCKS proxy

  • Plugin.dll: Intercepts SOCKS traffic, tunnels via DVC

  • RDP Session: Carries DVC tunnel data

  • Server.exe: Receives DVC data, forwards to target services


4. Implementation Steps

Step 1: Prepare Attack Host

Step 2: Connect to Windows Pivot Host

Step 3: Disable Windows Defender

Step 4: Transfer Files to Pivot Host

Step 5: Register SocksOverRDP Plugin


5. Establishing RDP Tunnel Chain

Step 6: RDP to Domain Controller

Step 7: Transfer Server to DC

Step 8: Start SocksOverRDP Server

Step 9: Verify SOCKS Listener


6. Proxifier Configuration

Step 10: Launch Proxifier

Step 11: Configure SOCKS Proxy

Step 12: Configure Proxification Rules


7. HTB Academy Lab Exercise

Lab Challenge

"Use the concepts taught in this section to pivot to the Windows server at 172.16.6.155 (jason:WellConnected123!). Submit the contents of Flag.txt on Jason's Desktop."

Lab Environment

  • Initial Target: 10.129.42.198 (htb-student:HTB_@cademy_stdnt!)

  • Domain Controller: 172.16.5.19 (victor:pass@123)

  • Final Target: 172.16.6.155 (jason:WellConnected123!)

  • Flag Location: Flag.txt on Jason's Desktop

  • Expected Flag: H0pping@roundwithRDP!

Complete Lab Solution

Phase 1: Setup and Initial Connection

Phase 2: Pivot Host Configuration

Phase 3: Domain Controller Connection

Phase 4: Proxifier Setup

Phase 5: Final Target Access

Lab Solution Summary


8. Troubleshooting Common Issues

DLL Registration Failures

RDP Connection Issues

SOCKS Proxy Issues

Proxifier Configuration Issues

Windows Defender Interference


9. Performance Optimization

RDP Performance Settings

Proxifier Performance

Network Optimization


10. Security Considerations

OPSEC Implications

  1. Registry Modifications - DLL registration leaves traces

  2. Process Artifacts - Proxifier and SocksOverRDP processes visible

  3. Network Signatures - DVC tunnel traffic patterns

  4. File Artifacts - Tool binaries on disk

  5. Event Logs - RDP connection logs, authentication events

Detection Evasion

Cleanup Procedures


11. Alternative Windows Pivoting Methods

Comparison with Other Techniques

Tool

Requirements

Stealth

Performance

Complexity

SocksOverRDP

RDP Access

High

Medium

Medium

SSH Tunnel

SSH Client

Low

High

Low

Netsh Portproxy

Admin Rights

Medium

High

Low

PowerShell Remoting

WinRM Enabled

Medium

Medium

High

Chisel

Binary Transfer

High

High

Medium

When to Use SocksOverRDP

βœ… Windows-only environments βœ… RDP access available βœ… SSH/other tools blocked βœ… Need stealth tunneling βœ… Multiple RDP hops required

Limitations

❌ Requires RDP access ❌ Windows Defender interference ❌ DLL registration traces ❌ Performance overhead ❌ Complex multi-step setup


12. Integration with Other Tools

Metasploit Integration

Nmap Through RDP Tunnel

Web Browser Pivoting


References

Last updated