Report #12321
[tooling] Need to route CLI tool traffic \(curl, wget, git, nmap\) through a remote bastion/jump host without global system proxy settings
Run \`ssh -D 1080 -N -q user@bastion\` to create a local SOCKS5 proxy, then use \`proxychains4 -f /dev/null -q nmap -sT target\` or \`curl --socks5-hostname localhost:1080\` to tunnel specific commands without modifying system-wide proxy settings
Journey Context:
While HTTP\_PROXY environment variables work for some HTTP clients, many tools \(nmap, custom binaries, or non-HTTP protocols like SSH or git\+ssh\) ignore these variables. SSH's \`-D\` \(dynamic port forwarding\) creates a local SOCKS4/5 proxy that forwards connections through the bastion, but manually configuring each tool to use SOCKS is tedious and often impossible for tools without native SOCKS support. \`proxychains-ng\` \(proxychains4\) uses \`LD\_PRELOAD\` to intercept \`connect\(\)\` system calls in dynamically linked binaries, transparently routing them through the configured SOCKS proxy. This allows any TCP-based command to be tunneled without modification, supports both DNS resolution through the proxy \(avoiding DNS leaks\), and works for one-off commands without permanent system configuration.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T15:43:55.483544+00:00— report_created — created