How to Set Up ProxyChains on Kali Linux with Tor

Deepak Prasad
Tested on Kali GNU/Linux Rolling 2026.2 (kali-rolling)
Package proxychains4 4.17-3.1
tor 0.4.9.11-1
Lab environment Pentest lab
Privilege Normal user for proxychains4; sudo to install packages and manage the tor service
Scope Install proxychains4 and tor, edit proxychains4.conf for Tor SOCKS, start the daemon, verify egress with check.torproject.org, and run authorized tools through ProxyChains. Covers chain modes, proxy_dns, and common misconfigurations. Does not cover Tor Browser install, relay hosting, or free public proxy scraping workflows.
Related guides curl command in Linux
Kali Linux repositories
Short on time?Beta Get the gist of this 10-minute read in seconds, then ask follow-up questions

ProxyChains wraps compatible programs and redirects their TCP connections through the proxies listed in proxychains4.conf. On Kali, the usual pairing is ProxyChains plus the tor system service so tools such as curl can exit through a Tor circuit instead of your real IP.

This guide walks through installing and configuring ProxyChains, starting Tor, verifying the connection, and using ProxyChains on Kali Rolling. Each step states what you run and what a good result looks like.

IMPORTANT
Use ProxyChains only for lawful, authorized work. Routing through Tor or third-party proxies does not guarantee anonymity, and many free proxies are untrusted. Do not scan or attack systems without explicit permission.

How ProxyChains works on Kali Linux

ProxyChains (the proxychains4 package on Kali) is a TCP proxifier. You prefix a command with proxychains4, and the tool tries to redirect that program’s outbound TCP connections through the proxy chain defined in proxychains4.conf.

ProxyChains works with TCP connections made through normal application networking calls. It does not proxy UDP, ICMP, or raw-packet scans.

In penetration testing labs, that pattern helps you:

  • Test how a tool behaves when egress leaves through Tor or a corporate proxy
  • Practice reading chain logs (Strict chain ... OK) during authorized assessments
  • Separate browser Tor (Tor Browser) from CLI tooling that needs the same network path

ProxyChains is not a VPN and not a magic cloak. Forensics can still correlate timing, application behavior, and mistakes such as DNS leaks or forgotten shell proxy variables. Treat it as a routing wrapper, not a promise of “100% anonymity.”

ProxyChains vs Tor Browser vs the Tor service

Three components show up together in Kali guides but do different jobs:

Component What it does
Tor Browser Hardened browser bundle for web browsing through Tor
tor service Background daemon; SOCKS on 127.0.0.1:9050 for other apps
proxychains4 Wraps CLI programs and sends their TCP through [ProxyList]

Installing Tor Browser does not configure ProxyChains. Installing tor with apt does not give you Tor Browser. For browser work, see Install Tor Browser on Kali Linux. This article focuses on proxychains4 plus the system tor daemon.


Install ProxyChains and Tor on Kali Linux

Both packages live in default Kali repositories. Install them together so [ProxyList] can point at a local Tor SOCKS port:

bash
sudo apt update
sudo apt install -y proxychains4 tor

Confirm the versions apt recorded on this image:

bash
dpkg -l proxychains4 tor | grep -E '^ii'
output
ii  proxychains4   4.17-3.1     amd64        redirect connections through socks/http proxies (proxychains-ng)
ii  tor            0.4.9.11-1   amd64        anonymizing overlay network for TCP

The main config file is /etc/proxychains4.conf. The wrapper command is proxychains4 (not the legacy proxychains name some older blogs use). Use proxychains4 --help or man proxychains4 for command-line options.


Configure proxychains4.conf for Tor

Open the system config with root privileges. You will adjust chain mode, DNS handling, and [ProxyList]:

bash
sudo nano /etc/proxychains4.conf

Choose strict_chain, dynamic_chain, or random_chain

proxychains4.conf supports one active chain mode at a time. Uncomment exactly one of the chain lines near the top of the file:

Mode Behavior Typical use
strict_chain Every proxy in [ProxyList] must work, in order Single Tor SOCKS hop (default on Kali)
dynamic_chain Skips dead proxies, uses the rest Multi-proxy chains where some proxies may be unavailable
random_chain Random order (optional chain_len) Test different proxy paths in a multi-proxy lab

Kali’s default file enables strict_chain and proxy_dns. With one Tor entry in [ProxyList], strict and dynamic behave the same until you add more proxies.

Configure Tor SOCKS on 127.0.0.1:9050

On Kali Rolling 2026.2, these lines are already active near the top and middle of the file:

bash
grep -n '^strict_chain\|^proxy_dns\|^tcp_read_time_out\|^\[ProxyList\]\|^socks' /etc/proxychains4.conf | head -10
output
18:strict_chain
60:proxy_dns
92:tcp_read_time_out 15000
158:[ProxyList]
161:socks4 	127.0.0.1 9050

Keep strict_chain and proxy_dns enabled. proxy_dns sends DNS lookups through the proxy chain instead of resolving names locally first, which reduces a common DNS leak path when the chain is working.

In [ProxyList], the default Kali file uses socks4 127.0.0.1 9050. For this guide, change it to SOCKS5:

text
socks5 127.0.0.1 9050

Tor supports both SOCKS4 and SOCKS5 on 127.0.0.1:9050. SOCKS5 is used here because it handles hostname-based requests cleanly and matches Tor's current client examples.

Use a custom proxychains4.conf file

For a personal test file without editing /etc, copy the config and pass -f:

bash
LAB=/tmp/proxychains-lab
mkdir -p "$LAB"
cp /etc/proxychains4.conf "$LAB/proxychains4.conf"

Edit "$LAB/proxychains4.conf" so [ProxyList] contains only socks5 127.0.0.1 9050. You can use this file later with proxychains4 -f "$LAB/proxychains4.conf" <command> after Tor is running.


Start Tor and verify SOCKS port 9050

ProxyChains only works when the first hop in [ProxyList] is reachable. Start the Tor daemon and confirm it is active:

bash
sudo systemctl start tor
systemctl is-active tor
output
active

Check that Tor is listening on the SOCKS port ProxyChains will use:

bash
sudo ss -tlnp | grep 9050
output
LISTEN 0      4096       127.0.0.1:9050       0.0.0.0:*    users:(("tor",pid=281138,fd=6))

Verify ProxyChains is using Tor

After starting tor, verify that ProxyChains exits through Tor using the Tor Project API at check.torproject.org. Unset shell proxy variables first so they do not change the route you intend to test:

bash
unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY ALL_PROXY all_proxy no_proxy NO_PROXY
proxychains4 curl -s --max-time 25 https://check.torproject.org/api/ip
output
[proxychains] config file found: /etc/proxychains4.conf
[proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4
[proxychains] DLL init: proxychains-ng 4.17
[proxychains] Strict chain  ...  127.0.0.1:9050  ...  check.torproject.org:443  ...  OK
{"IsTor":true,"IP":"45.95.169.104"}

IsTor:true means the request left through the Tor network. The exit IP can change as Tor builds new circuits, so your JSON line may show a different address on the next run.


How to use ProxyChains on Kali Linux

Prefix the tool you already use with proxychains4. The wrapper prints a chain line for each connection attempt.

Lab environment used in the examples

The curl test below uses a VirtualBox pentest lab target on the host-only network 192.168.56.0/24. You do not need that lab to verify Tor egress with check.torproject.org above.

Item Attacker (Kali) Target (Metasploitable 2)
Lab IP 192.168.56.120 192.168.56.127 (TARGET)

Export the target and clear shell proxy variables before the lab test:

bash
TARGET=192.168.56.127
unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY ALL_PROXY all_proxy no_proxy NO_PROXY

On this lab, leftover HTTPS_PROXY values caused curl to chain to a corporate proxy after Tor when those variables were not cleared.

Test curl through ProxyChains

HTTP to Metasploitable through the Tor chain failed in this lab:

bash
proxychains4 curl -s --max-time 15 "http://${TARGET}/" -o /dev/null -w '%{http_code}\n'
output
[proxychains] config file found: /etc/proxychains4.conf
[proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4
[proxychains] DLL init: proxychains-ng 4.17
[proxychains] Strict chain  ...  127.0.0.1:9050  ...  192.168.56.127:80 <--denied
000

The denied line and HTTP code 000 mean the chain never delivered a normal response.

Why Tor cannot reach private lab addresses

Tor exits cannot reach private lab addresses such as 192.168.56.x (RFC1918 private addresses). Use the direct host-only path for Metasploitable and other lab targets on that subnet.

Why some Nmap scans bypass ProxyChains

ProxyChains hooks normal dynamically linked TCP connect() calls. It supports TCP only. When Nmap runs with privileges, many default scan modes use raw packets rather than proxied TCP connections. SYN scans (-sS), UDP scans (-sU), ICMP discovery, ARP discovery, and other raw-packet operations do not travel through ProxyChains.

That is why a command such as proxychains4 nmap -Pn -p 22 "$TARGET" against a local Metasploitable host can still show sub-millisecond latency and the target's VirtualBox MAC address even though Tor cannot reach private lab addresses. The scan bypassed ProxyChains; it did not hairpin through a Tor exit.

For authorized port scans on Metasploitable, use direct Nmap on the lab network without Tor.

If an authorized assessment requires Nmap through ProxyChains, use TCP connect scanning (-sT). Raw-packet scan types such as SYN or UDP scans are not proxied.

Record the ProxyChains log lines in your notes when a test must show which hop carried traffic. For reports, pair chain logs with the Tor API JSON when you need proof of exit through Tor.


Add HTTP or SOCKS proxies to ProxyChains

You can list http, socks4, socks5, and authenticated entries in [ProxyList] for multi-hop chains. Example syntax (commented in the default file):

text
# http 192.168.1.10 8080
# socks5 127.0.0.1 9050

Public “free proxy” lists are a poor default for security work:

  • You do not control who logs traffic on the far end
  • Dead entries break strict_chain until you remove them
  • Malicious proxies can strip TLS or inject content

If you chain Tor after an HTTP proxy for an authorized test, enable dynamic_chain and verify DNS with proxy_dns still enabled. Prefer infrastructure you own or contractual access to over scraped lists.


ProxyChains troubleshooting

Symptom Likely cause Fix
socket error or timeout on 127.0.0.1:9050 tor service stopped sudo systemctl start tor; confirm `sudo ss -tlnp
Chain shows corporate IP after Tor HTTP_PROXY / HTTPS_PROXY set in shell unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY ALL_PROXY all_proxy no_proxy NO_PROXY
PROXYCHAINS_CONF ignored Wrong variable on 4.17 Use proxychains4 -f /path/to/conf or set PROXYCHAINS_CONF_FILE
Unexpected chain behavior after editing config More than one chain mode uncommented Leave only strict_chain, dynamic_chain, or random_chain active
<--denied to 192.168.x.x Tor blocks private lab targets Scan lab hosts directly without Tor
strict_chain aborts on first proxy Dead entry in [ProxyList] Remove bad lines or switch to dynamic_chain

Summary

You installed proxychains4 and tor on Kali, confirmed strict_chain and proxy_dns in proxychains4.conf, and pointed [ProxyList] at Tor SOCKS on 127.0.0.1:9050. Starting the tor service and running proxychains4 curl against check.torproject.org produced IsTor:true, which is the signal you want when testing egress through Tor.

The main pitfalls from this lab are easy to miss in prose: shell proxy environment variables can hijack curl after Tor, many Nmap scan modes bypass ProxyChains because they use raw packets, and Tor will not behave like a LAN path to Metasploitable on 192.168.56.x. Use direct Nmap and curl on host-only targets; use ProxyChains when the exercise is outbound routing or multi-hop proxy behavior.

For browser-only anonymity work, stay with Tor Browser. For CLI tooling, keep the tor daemon running when you need SOCKS, unset proxy environment variables in the same shell, and read the Strict chain log lines before you trust a result. When you finish testing, optionally stop Tor with sudo systemctl stop tor so idle circuits are not left running. Next steps in the course include deeper Nmap enumeration and the broader ethical hacking lab path.


Frequently Asked Questions

What is the difference between ProxyChains and Tor Browser on Kali?

Tor Browser is a hardened Firefox bundle that routes browser traffic through Tor. ProxyChains is a wrapper that redirects compatible CLI programs through the proxies listed in proxychains4.conf, often the tor daemon SOCKS port on 127.0.0.1:9050.

Why does proxychains4 curl to my lab VM fail through Tor?

Tor is built for internet egress, not your host-only lab subnet. Private addresses such as 192.168.56.x are typically rejected or denied by the Tor SOCKS proxy, so scan internal targets directly on the lab network without ProxyChains.

Should I use socks4 or socks5 for Tor in proxychains4.conf?

Kali ships socks4 127.0.0.1 9050 in the default file. Tor supports both SOCKS4 and SOCKS5; this guide uses socks5 127.0.0.1 9050 because it handles hostname-based requests cleanly and matches Tor's current client examples.

Why does ProxyChains still hit my HTTP_PROXY instead of Tor?

Applications such as curl can also use proxy environment variables. If variables such as HTTP_PROXY, HTTPS_PROXY, or ALL_PROXY are set, they can change the route you intended to test through ProxyChains. Unset http_proxy, https_proxy, HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, all_proxy, no_proxy, and NO_PROXY in the same shell before you run proxychains4.

How do I use a custom proxychains4.conf file?

On proxychains-ng 4.17, PROXYCHAINS_CONF is ignored. Pass proxychains4 -f /path/to/proxychains4.conf or set PROXYCHAINS_CONF_FILE to your alternate config path.


References

Finished reading?Beta Get the key takeaways in seconds, then ask follow-up questions
Kennedy Muthii

Information Security Analyst

Accomplished professional proficient in Python, ethical hacking, Linux, cybersecurity, and OSINT. With a track record including winning a national cybersecurity contest, launching a startup in Kenya, and holding a degree in information science, he is currently engaged in cutting-edge research in ethical hacking.

  • Python (programming language)
  • Certified Ethical Hacker
  • White Hat (Computer Security)
  • Linux
  • Penetration Testing