Skip to content

Instantly share code, notes, and snippets.

@slbug
Forked from maxp/block-tor.sh
Created May 6, 2019 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slbug/699661ce0ec0ff87476b3a22cb8d1326 to your computer and use it in GitHub Desktop.
Save slbug/699661ce0ec0ff87476b3a22cb8d1326 to your computer and use it in GitHub Desktop.
iptables Tor filter
ipset -N tor iphash
wget -q https://check.torproject.org/cgi-bin/TorBulkExitList.py?ip=$MY_IP -O - | sed '/^#/d' |while read IP
do
ipset -q -A tor $IP
done
iptables -A INPUT -m set --match-set tor src -j DROP
# see also:
# tor.dnsbl.sectoor.de, dnsbl.proxybl.org, rbl.efnet.org
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment