Overview
Tunneling and port forwarding allow attackers to pivot through compromised hosts, bypass firewall restrictions, and establish covert communications channels. This page is a comprehensive reference for tools and techniques.SSH Tunneling
Local Port Forwarding
Forward a local port through an SSH server to a destination:Remote Port Forwarding
Forward a remote port back to the attacker:SOCKS Proxy (Dynamic Forwarding)
VPN Tunnel over SSH
CVE-2023-48795 (Terrapin Attack): The 2023 Terrapin downgrade attack can let a MitM tamper with the early SSH handshake and inject data into forwarded channels. Ensure OpenSSH ≥ 9.6 or disable
chacha20-poly1305@openssh.com and *-etm@openssh.com algorithms.SSHuttle
Transparent proxy-based VPN over SSH:Chisel
Chisel — HTTP-based tunnel with SOCKS5 support. Use the same version on client and server.Ligolo-ng
Ligolo-ng — Go-based tunneling with automatic routing. Use the same version for agent and proxy.Socat
Meterpreter
Cobalt Strike
reGeorg
Web-based tunnel using uploaded web shells (ashx/aspx/js/jsp/php):ngrok
Cloudflared (Cloudflare Tunnel)
Create outbound tunnels without inbound firewall rules:FRP (Fast Reverse Proxy)
FRP supports TCP, UDP, HTTP/S, SOCKS, and P2P NAT hole-punching:DNS Tunneling
DNSCat2
Establishes a C2 channel through DNS — no root required:Iodine
Tunnel IP over DNS (root required on both sides):ICMP Tunneling
ptunnel-ng
Covert VM-Based Tunnels (QEMU)
Run a VM to hide C2 activity from host-based EDR:- Port 2222 on the Windows host forwards to port 22 inside the Tiny Core Linux VM.
- All malicious activity stays inside the VM — host security tools see only benign loopback traffic.
Windows netsh Port Forwarding
Other Tools
- Rpivot — Reverse SOCKS4 tunnel from victim
- Plink.exe — Console PuTTY SSH client for Windows port forwarding
- SocksOverRDP — SOCKS over RDP Dynamic Virtual Channels
- ssf — Secure Socket Funneling
- 3proxy — Tiny free proxy server