mirror of
https://github.com/fphammerle/docker-tor-proxy.git
synced 2025-10-27 02:43:35 +01:00
87faf8af7d77b76979e20ed2c6ed1f39791960cb
https://web.archive.org/web/20221125143725/https://marc.info/?l=netfilter&m=165399194307396 https://web.archive.org/web/20221125143601/https://marc.info/?l=netfilter&m=165461289522999&w=2 https://web.archive.org/web/20221125142800/https://marc.info/?l=netfilter&m=166007475409847&w=2 https://git.alpinelinux.org/aports/commit/main/nftables?h=3.17-stable&id=a658b8464855951417ca39c0359b2d0aa84f2ba9 https://git.alpinelinux.org/aports/commit/main/nftables?h=3.17-stable&id=530231b586639f3a41abf4586e581c9b8bbc8867 https://git.alpinelinux.org/aports/commit/main/nftables?h=3.17-stable&id=95812eaef9013fc880a4f0dc22772118955090a4 https://git.alpinelinux.org/aports/commit/main/nftables?h=3.17-stable&id=0cb1cfc473f2c2d8f77286d6db79ac57269b8349 https://git.alpinelinux.org/aports/commit/main/nftables?h=3.17-stable&id=331ad1e9a1fc384f024530b0c1c500a1e1bce6cb https://git.alpinelinux.org/aports/commit/main/nftables?h=3.17-stable&id=ed5320f339a159ec1cab86fe75a70198258ac119 https://git.alpinelinux.org/aports/commit/main/nftables?h=3.17-stable&id=cc23e27e96c08dd5cc6cfc4511300487a3b1cbe4 https://git.alpinelinux.org/aports/commit/main/nftables?h=3.17-stable&id=8d5de3212e2525b1e8b01522c6b9fd6d23250cc9 https://git.alpinelinux.org/aports/commit/main/nftables?h=3.17-stable&id=840a900faf5cf9941fd5dde19dffadc7b9c51570 https://git.alpinelinux.org/aports/commit/main/nftables?h=3.17-stable&id=d4c8c0e1ea373d3758a3b31d21648ab2208ccf6c ?
docker: tor socks & dns proxy 🌐 🐳
Docker Hub: https://hub.docker.com/r/fphammerle/tor-proxy
Signed image tags: https://github.com/fphammerle/docker-tor-proxy/tags
$ sudo docker run --rm --name tor_proxy \
-p 127.0.0.1:9050:9050/tcp \
-p 127.0.0.1:53:9053/udp \
fphammerle/tor-proxy
or after cloning the repository 🐙
$ sudo docker-compose up
Test Proxies
$ curl --proxy socks5h://localhost:9050 ipinfo.io
$ torsocks wget -O - ipinfo.io
$ torsocks lynx -dump https://check.torproject.org/
$ dig @localhost fabian.hammerle.me
$ ssh -o 'ProxyCommand nc -x localhost:9050 -v %h %p' abcdefghi.onion
# no anonymity!
$ chromium-browser --proxy-server=socks5://localhost:9050 ipinfo.io
Read-only Root Filesystem
Optionally add
$ sudo docker run --read-only -v tor_proxy_data:/var/lib/tor --tmpfs /tmp:rw,size=4k` …
to make the container's root filesystem read-only.
Isolate Host
sudo iptables -A OUTPUT ! -o lo -j REJECT --reject-with icmp-admin-prohibited
Change SocksTimeout Option
$ sudo docker run -e SOCKS_TIMEOUT_SECONDS=60 …
Select Exit Nodes
$ sudo docker run -e EXIT_NODES=1.2.3.4,1.2.3.5,{at} …
Exclude Exit Nodes
$ sudo docker run -e EXCLUDE_EXIT_NODES=1.2.3.4,1.2.3.5 …
Show Circuits
$ printf 'AUTHENTICATE\nGETINFO circuit-status\nQUIT\n' \
| sudo docker exec -i tor_proxy nc localhost 9051
relay search: https://metrics.torproject.org/rs.html
or using onioncircuits (debian repo):
$ sudo apt-get install --no-install-recommends onioncircuits
$ sudo nsenter --target "$(sudo docker inspect --format='{{.State.Pid}}' tor_proxy)" --net \
sudo -u $USER onioncircuits
Troubleshooting
Disable SafeLogging (temporarily) to log IP addresses instead of [scrubbed]:
$ printf 'AUTHENTICATE\nSETCONF SafeLogging=0\nGETCONF SafeLogging\nQUIT\n' \
| sudo docker exec -i tor_proxy nc localhost 9051
Description
Languages
Dockerfile
57.2%
Shell
42.8%