Exploitationproxysockshttpnetworkredirectiontcp

proxychains-ng

Proxychains-ng is a tool that forces TCP connections from applications to go through SOCKS4a/5 or HTTP proxies. It hooks libc functions via LD_PRELOAD to redirect network traffic transparently.

Description

Proxychains-ng is a continuation of the original proxychains project and enables users to proxy TCP connections through SOCKS or HTTP proxies. It works by preloading a shared library that intercepts network-related libc functions in dynamically linked programs, redirecting their connections accordingly. This is particularly useful for maintaining anonymity or bypassing network restrictions in penetration testing scenarios.

The tool consists of packages like proxychains4, which provides the main executable for proxying applications, and libproxychains4, the runtime shared library. Users can run any command-line program through proxychains-ng to route its traffic via configured proxies. It supports TCP only and does not handle UDP or ICMP.

Additional features include a daemon mode for remote DNS resolution, allowing flexible proxy chaining configurations defined in a config file.

How It Works

Proxychains-ng hooks network-related libc functions in dynamically linked programs using a preloaded DLL via dlsym() and LD_PRELOAD. It intercepts calls and redirects TCP connections through SOCKS4a/5 or HTTP proxies. The configuration is specified in a config file, and the tool operates transparently without modifying the target application.

Installation

bash
sudo apt install proxychains4

Flags

-qmakes proxychains quiet - this overrides the config setting
-fallows one to manually specify a configfile to use
-ilistenip for proxychains4-daemon (default 127.0.0.1)
-pport for proxychains4-daemon (default 1053)
-rremotesubnet for proxychains4-daemon (default 224)

Examples

General usage: runs specified program with quiet mode and custom config file
proxychains4 -q -f config_file program_name [arguments]
Proxies telnet connection to somehost.com through configured proxies
proxychains4 telnet somehost.com
Displays help and usage information for proxychains4
proxychains4 --help
Shows help for the proxychains4-daemon remote DNS daemon
proxychains4-daemon -h
Starts daemon with custom listen IP, port, and remote subnet
proxychains4-daemon -i listenip -p port -r remotesubnet
Starts daemon with defaults: listenip 127.0.0.1, port 1053, remotesubnet 224
proxychains4-daemon
Proxies nmap TCP scan through configured proxy chain
proxychains4 nmap -sT target
Updated 2026-04-16kali.org ↗