Pivoting
Tools and Techniques
SSH
# Dynamic ssh-tunnel
ssh -D localhost:9050 -f -N <USER>@<DOMAIN>
# Run commands with proxychains <Command>
# Not all tools are proxy awareMetasploit
Socks Proxy
Meterpreter> run autoroute -s 172.16.2.0/24
background
use auxiliary/server/socks_proxy
set SRVPORT 9050
runPortforward
# Forward remote port 22 to localhost port 1337
Meterpreter> portfwd add -r 172.16.2.5 -p 22 -L 127.0.0.1 -l 1337Ligolo-ng
Setup
Server
Client
sshuttle
Acting as a VPN, we can access hosts without using proxychains.
Cons: No internet access on HTB
Chisel
Installation
Server
Client
Graftcp
graftcp can redirect the TCP connection made by the program [application, script, shell, etc.] to SOCKS5 or HTTP proxy.
Compared with tsocks, proxychains, or proxychains-ng, graftcp is not using the LD_PRELOAD trick which only works for dynamically linked programs, e.g., applications built by Go can not be hooked by proxychains-ng. graftcp can trace or modify any given programs connected by ptrace(2)
Installation
Usage
Check the repository for more instructions.
Tun2socks
Proxy Everything: Handle all network traffic of any internet programs sent by the device through a proxy.
Proxy Protocols: HTTP/Socks4/Socks5/Shadowsocks with authentication support for remote connections.
Run Everywhere: Linux/macOS/Windows/FreeBSD/OpenBSD multi-platform support with specific optimization.
Gateway Mode: Act as a layer three gateway to handle network traffic from other devices in the same network.
Full IPv6 Support: All functions work in IPv6, tunnel IPv4 connections through IPv6 proxy and vice versa.
Network Stack: Powered by user-space TCP/IP stack from Google container application kernel gVisor.
Installation
Usage
Last updated