ProxyChains (and ProxyChains-NG): a tool for anonymizing traffic and network testing
Published on 2025-10-24
In a world where data privacy and access to resources are often restricted by geoblocks or corporate policies, tools like ProxyChains become indispensable assistants. ProxyChains — or more precisely its modern fork ProxyChains-NG — is an open utility for Unix-like systems (Linux, macOS, etc.) that allows routing the network traffic of any application through a chain of proxy servers. It is especially popular among developers, pentesters, and security enthusiasts. In this article we’ll cover what ProxyChains can do, why it’s useful for developers, provide usage examples, and discuss its limitations.
Briefly: what is ProxyChains-NG and how it works
ProxyChains is a program that “wraps” an application’s TCP connections and forces them to go through a sequence of proxy servers (SOCKS4, SOCKS5, HTTP/HTTPS).
How it works on Linux: ProxyChains-NG uses LD_PRELOAD. It injects its library into the application, intercepts network system calls (for example, connect()), and redirects them through the proxies specified in the configuration file.
Supported chain modes:
strict_chain— traffic goes strictly through the list; if one proxy fails — the chain doesn’t work.dynamic_chain— recommended mode: if a proxy is unavailable, it is skipped.random_chain— selects a random proxy from the list for each connection.
Important: the original proxychains (v3.x) is obsolete. Today it’s recommended to use proxychains-ng (in packages the binary is often called proxychains4).
Installation and basic configuration
On Debian/Ubuntu/Kali:
sudo apt update
sudo apt install proxychains-ng
# the launch command may be called proxychains4
The configuration file is usually located at /etc/proxychains4.conf. Example ProxyList section:
[ProxyList]
# Tor
socks5 127.0.0.1 9050
# HTTP proxy
http 192.168.1.100 8080
To proxy DNS requests (to avoid DNS leaks), find and uncomment in the config:
proxy_dns
Why ProxyChains is convenient for a developer
ProxyChains is not just about anonymity. For a developer it is useful in several practical scenarios:
- Testing service behavior from different geolocations. Quickly check how an API/site behaves when requests come from IPs in the US, EU, Asia, etc., without setting up a VPN or changing application configuration.
- Debugging and pentesting. You can verify that an application does not “leak” the real IP and test behavior under different network conditions.
- Convenience for CLI utilities. Instead of configuring proxies in each tool, add the
proxychains4prefix. - Integration with Tor. An easy way to route traffic through Tor (with additional measures to prevent leaks).
Limitations to keep in mind:
- Doesn’t work with statically linked binaries (for example, many Go binaries).
- Does not intercept raw sockets and UDP (by default) — so some traffic types (ICMP/ping, UDP-based DNS, VoIP) are not proxied.
- May increase latency and reduce throughput.
Practical usage examples
Run any tool with the proxychains4 prefix:
- Check external IP:
proxychains4 curl ifconfig.me
This will return the IP of the last hop in the chain.
- Scanning with nmap (TCP Connect scan only):
proxychains4 nmap -sT -p 80,443 example.com
Important:
nmap -sS(SYN scan) uses raw sockets and will not work. ProxyChains supports-sT(TCP Connect) because it uses the normalconnect().
- SSH through a chain:
proxychains4 ssh user@remote-server.com
- Downloading via Tor:
Run
torlocally.In
/etc/proxychains4.confadd:socks5 127.0.0.1 9050 proxy_dnsRun:
proxychains4 wget https://example.com/file.zip
DNS and HTTP traffic will go through Tor (assuming proxy_dns is enabled).
Downsides and critical limitations
1. DNS leaks — the main risk
By default ProxyChains does not proxy DNS requests, so the system may perform standard DNS queries to the provider bypassing the proxy — this completely de-anonymizes you. Solution: enable proxy_dns in /etc/proxychains4.conf — then DNS will be sent over TCP to the proxy (SOCKS5).
2. Works only with TCP
ProxyChains is designed for TCP. UDP, ICMP and raw sockets are not proxied. To proxy UDP you need other tools (for example tun-/tap-solutions or VPN services, or specific UDP tunnels).
3. Compatibility
Doesn’t work with statically compiled binaries (they don’t pick up LD_PRELOAD) and with programs that create raw sockets. Many modern Go utilities are often compiled statically — keep this in mind when planning tests.
4. Performance degradation
Each additional proxy adds latency. For latency-sensitive tasks (streaming, gaming, real-time) ProxyChains is not suitable.
5. Security of the proxy chain
Proxies in the chain can log or modify traffic. Use trusted nodes and remember that the last node (exit node) sees unencrypted traffic if you are not using TLS/HTTPS on top of the proxy.
Useful tips and best practices
- Always enable
proxy_dnsif you want real anonymity. - Test the configuration: first
proxychains4 curl ifconfig.me, thenproxychains4 dig +short example.com @8.8.8.8and compare results. - For applications that don’t work with
LD_PRELOAD, use a system proxy (built-in options) or bring up a local tun/tap (VPN). - Do not combine untrusted proxies with sensitive data — sending logins/passwords over HTTP through an untrusted proxy is a bad idea.
- For large-scale testing of geo-dependent behavior it’s better to have a pool of trusted proxies from different regions (or use commercial services).
Short comparison: ProxyChains vs VPN vs SOCKS-proxy (table)
| Task | ProxyChains | VPN | SOCKS (local/service) |
|---|---|---|---|
| Overwrite any TCP traffic with a prefix | ✅ (for dynamically linked binaries) | ✅ (all traffic) | Partially (requires app configuration) |
| Proxy DNS by default | ❌ (need to enable proxy_dns) | ✅ | Depends on settings |
| Flexibility: proxy chains | ✅ | ❌ (usually one tunnel) | ❌ (single hop) |
| Support for UDP/ICMP | ❌ | ✅ | Depends on implementation |
| Latency | Can be high with chained proxies | Usually stable | Low/medium |
Conclusion
ProxyChains-NG is a powerful and lightweight tool for developers and pentesters: it simplifies testing from different geolocations, helps check for IP leaks, and provides flexibility when working with CLI tools. But it is not universal: remember DNS leaks, lack of UDP/raw-socket support, incompatibility with statically compiled binaries, and risks associated with untrusted proxies.
If you plan to use ProxyChains in serious work, enable proxy_dns, test the behavior of your tools, and use trusted proxies or Tor combined with TLS encryption. For full traffic proxying (including UDP) consider VPN solutions or setting up a local tunnel.