Proxychains Tunnel
Run scoped commands through proxychains4 when a task requires a SOCKS5 tunnel (for example, internal recon through a pivot host).
Input Contract
Accept input as: SOCKS_HOST:SOCKS_PORT COMMAND [MODE] [NOISE]
Mode:
plan: return command plan onlyexecute(default): run checks and command sequence
Noise:
low(default): single-host validation and bounded probingmedium: broader enumerationhigh: aggressive/noisy actions (approval required)
Examples:
$proxychains-tunnel 127.0.0.1:8080 "nmap -Pn -p 445 192.0.2.21" execute low$proxychains-tunnel 127.0.0.1:8080 "smbclient -L //192.0.2.21 -N" execute low$proxychains-tunnel 127.0.0.1:1080 "crackmapexec smb 192.0.2.0/24 -u '' -p ''" plan medium
Natural-language mapping example:
- Request:
Use the Socks5 tunnel on 127.0.0.1:8080 to check port 445 - Command intent:
nmap -Pn -p 445 <target> - Execution pattern:
proxychains4 <command>
Preconditions
- Confirm target is in scope for the active engagement before executing commands.
- Confirm
proxychains4is installed. - Build an isolated proxychains config for each run instead of mutating global config.
- Validate local proxy listener before running target command.
Execution Workflow
- Parse and validate:
- split
SOCKS_HOST:SOCKS_PORT, - parse target command and identify likely noise profile.
- Create temporary config:
bashcat > /tmp/proxychains-codex.conf <<'EOF' strict_chain proxy_dns tcp_read_time_out 15000 tcp_connect_time_out 8000 [ProxyList] socks5 127.0.0.1 8080 EOF
Replace the socks5 endpoint with provided SOCKS_HOST:SOCKS_PORT.
- Readiness checks:
nc -zv <SOCKS_HOST> <SOCKS_PORT>- optional egress check:
- direct:
curl -4 -s https://icanhazip.com - proxied:
proxychains4 -q -f /tmp/proxychains-codex.conf curl -4 -s https://icanhazip.com
- direct:
- fail fast if tunnel is down.
- Execute proxied command:
bashproxychains4 -q -f /tmp/proxychains-codex.conf <COMMAND>
For the port-445 example:
bashproxychains4 -q -f /tmp/proxychains-codex.conf nmap -Pn -p 445 192.0.2.21
- Cleanup:
- remove temp config:
rm -f /tmp/proxychains-codex.conf
OPSEC Gate
Require explicit operator confirmation before OPSEC-dangerous actions, including:
- subnet-wide scans through the tunnel,
- aggressive timing or full-port scans,
- brute force or spraying via proxied services,
- exploit execution through the tunnel.
Before requesting confirmation, provide:
- exact command,
- objective,
- expected impact,
- assumptions/prerequisites,
- telemetry and detection surfaces (host/network/identity/EDR-SIEM).
Reporting Requirements
For each tunneled validation, include:
- SOCKS endpoint and config mode used (
strict_chain,proxy_dns), - exact command executed (with
proxychains4wrapper), - readiness-check output and command output,
- timestamp (UTC ISO 8601),
- confirmed result vs inference,
- remediation or next validation step.


