Windows pivots that don’t have SSH need their own toolkit. Three techniques cover almost every situation:

  • netsh portproxy — native Windows, no binaries to drop, survives reboot if persisted
  • plink — PuTTY’s SSH client, turns a Windows host into an SSH pivot
  • SocksOverRDP — SOCKS traffic tunneled through an existing RDP connection

netsh portproxy — Native Port Forward

Windows ships with a built-in port forwarder in netsh. No downloads, no scheduled tasks — just a route table entry for TCP.

Syntax

netsh.exe interface portproxy add v4tov4 ^
  listenport=<port> listenaddress=<pivot-ip> ^
  connectport=<port> connectaddress=<target-ip>

Example — Expose Internal RDP

rem Expose internal RDP (172.16.5.25:3389) on pivot's external IP (10.129.15.150:8080)
netsh.exe interface portproxy add v4tov4 ^
  listenport=8080 listenaddress=10.129.15.150 ^
  connectport=3389 connectaddress=172.16.5.25

From attacker:

xfreerdp /v:10.129.15.150:8080 /u:admin

Verify

netsh.exe interface portproxy show v4tov4
 
Listen on ipv4:             Connect to ipv4:
 
Address         Port        Address         Port
--------------- ----------  --------------- ----------
10.129.15.150   8080        172.16.5.25     3389

Firewall — Don’t Forget

Adding a portproxy entry doesn’t open the port in Windows Firewall. You need to allow it:

netsh advfirewall firewall add rule name="fwd" dir=in action=allow protocol=TCP localport=8080

Cleanup

netsh.exe interface portproxy delete v4tov4 listenport=8080 listenaddress=10.129.15.150
netsh.exe interface portproxy reset
netsh advfirewall firewall delete rule name="fwd"

Use Cases

  • Expose an internal service behind a NAT’d pivot
  • Pivot through a Windows host that can’t run arbitrary binaries (AppLocker)
  • Bridge an IPv6-only internal network (v4tov6, v6tov4, v6tov6 all work)

Limits

  • TCP only — no UDP
  • Per-connection, no SOCKS semantics
  • Admin required to add entries
  • Shows up clearly in netsh interface portproxy show on any IR investigation

plink is the command-line SSH client bundled with PuTTY. When Windows PowerShell lacks ssh (pre-2018 systems) or you want to blend with normal admin tooling, plink gives you the full SSH feature set — including -L, -R, -D.

Dynamic SOCKS Forward from Windows

plink -ssh -D 9050 ubuntu@10.129.15.50

Now localhost:9050 on the Windows host is a SOCKS5 proxy routing through the Linux SSH server. Point Proxifier or a Windows SOCKS-aware tool at it.

Non-Interactive (Script-Friendly)

plink -ssh -N -batch -pw <password> -D 9050 user@10.129.15.50
  • -N — no shell, just tunnels
  • -batch — disable prompts
  • -pw — password on command line (LoL — but it works when you can’t drop a key)
  • Windows Server 2016 and older don’t have native ssh.exe
  • PuTTY/plink is often whitelisted by sysadmins
  • Accepts -pw for scripted auth (OpenSSH won’t)

Why Not

  • Logs in verbose mode are noisy
  • -pw leaves password in command-line history and ETW events
  • Modern Windows has ssh.exe — prefer that when available

SocksOverRDP — Tunnel SOCKS Inside an RDP Session

SocksOverRDP rides on top of RDP’s Dynamic Virtual Channels (DVC) — the same mechanism that carries clipboard, audio, and drive redirection. You install a plugin DLL on the client side and run a server executable on the Windows host. Every TCP connection sent to the local SOCKS listener is encapsulated in the RDP DVC and emerges on the remote end.

Perfect scenario: you already have RDP access to an internal Windows host. You don’t want to open new ports or run a separate C2 channel — just tunnel more traffic through the existing legitimate RDP connection.

Components

  1. SocksOverRDP x64 binaries — github.com/nccgroup/SocksOverRDP/releases
  2. Proxifier portable — proxifier.com/download (ProxifierPE.zip)

Setup — Attacker Side (RDP Client)

rem Register the plugin DLL so mstsc loads it on next connection
regsvr32.exe SocksOverRDP-Plugin.dll

Connect via RDP

Open mstsc.exe, connect to the target Windows host. On successful connect, a dialog pops up: “SocksOverRDP plugin is listening on 127.0.0.1:1080”.

Verify:

netstat -antb | findstr 1080

Setup — Server Side (Inside the RDP Session)

Transfer SocksOverRDP-Server.exe to the Windows target. Run as Administrator:

SocksOverRDP-Server.exe

Route Traffic Through the Tunnel

Install Proxifier on the attacker. Add proxy entry:

  • Address: 127.0.0.1
  • Port: 1080
  • Type: SOCKS5

Launch applications through Proxifier — they’ll route via 127.0.0.1:1080 → RDP DVC → target host → internal network.

Attacker (Proxifier) ─SOCKS─> 127.0.0.1:1080
                               │
                               ▼
                      RDP DVC (inside active RDP session)
                               │
                               ▼
                    SocksOverRDP-Server.exe on target
                               │
                               ▼
                      Internal network destinations

Performance Tip

RDP DVC adds latency and bandwidth caps that make SOCKS traffic sluggish, especially with multiple sessions.

Fix: In mstsc.exe → Experience tab → set performance to Modem. Visual quality drops, tunneled traffic speeds up noticeably.

When This Beats Everything Else

  • Only ingress is RDP (common in strict corporate environments)
  • You don’t want to open secondary ports or start a new outbound connection
  • Already inside an authorized RDP workflow — maximum blend

Limits

  • Requires an active RDP session (if it drops, so does the tunnel)
  • DVC traffic is still visible to network inspection (you need deep packet inspection to decode, but connection timing/size might flag it)
  • Admin on target for SocksOverRDP-Server.exe