Proxychains-ng

This page describes how to install, configure and use proxychains-ng. Proxychains hooks network-related libc functions in dynamically linked programs via a preloaded DLL (dlsym(), LD_PRELOAD) and redirects the connections through SOCKS or HTTP proxies.

It supports TCP only (no UDP/ICMP etc). This should be used only in dynamically linked programs that are well known, use C or C++ language. Consider using anonsurf it uses iptables to redirect all traffic.

Proxychains-ng uses a list of proxies to make harder to trace and can be used with tor.


Install

To install proxychains-ng;

prt-get depinst proxychains-ng


Configure

Configuration file is at /etc/proxychains.conf, Set strict_chain or dynamic_chain, strict will loop all the proxies and all must be online, dynamic skip the ones offline. To test set dynamic;

dynamic_chain
#strict_chain

Round robin will use a proxy after another and return to first one once the last is reached. Random each connection will be done with a random proxy. Adjust chain_len if random or robin is used.

Set proxy_dns to proxy dns requests and avoid dns leaking. Skip to [ProxyList], default is to use tor, to use proxies check this lists; http / https and socks. Select some and then edit /etc/proxychains.conf;

[ProxyList]
# add proxy here ...
# meanwile
# defaults set to "tor"
#socks4         127.0.0.1 9050

# Argentina
http 200.5.254.130 53281

# Brazil
http 200.178.251.146 8080

# Chile
http 200.111.182.6 443

# Chile
socks5 200.77.186.180 4145

How to use

Test configuration;

$ proxychains4 curl ifconfig.me/ip
[proxychains] config file found: /etc/proxychains.conf
[proxychains] preloading /usr/lib/libproxychains4.so
[proxychains] DLL init: proxychains-ng 4.14
[proxychains] Dynamic chain  ...  200.5.254.130:53281  ...  timeout
[proxychains] Dynamic chain  ...  200.178.251.146:8080  ...  200.111.182.6:443  ...  ifconfig.me:80  ...  OK
200.111.182.6$

As you can see above it returned ip of the proxy. To use other configuration;

$ proxychains4 -f ~/proxychains.conf curl ifconfig.me/ip

To scan a host using proxychains;

$ proxychains4 nmap -sS 10.0.0.1