Created
October 20, 2017 22:14
-
-
Save Domin8-IPTV/137b83890a5abcad1cb0777a08876f25 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # # # # # # # # # # # # # | |
| #Authors: Blake Self & # | |
| # Shawn Burrel # | |
| # # | |
| # Modified by LukeBob # | |
| # # # # # # # # # # # # # | |
| #!/bin/bash | |
| #Block tor exit nodes | |
| IPTABLES_TARGET="DROP" | |
| IPTABLES_CHAINNAME="TOR" | |
| if ! iptables -L TOR -n >/dev/null 2>&1 ; then | |
| iptables -N TOR >/dev/null 2>&1 | |
| iptables -A INPUT -p tcp -j TOR 2>&1 | |
| fi | |
| cd /tmp/ | |
| echo -e "\n\tGetting Tor node list from dan.me.uk\n" | |
| wget -q -O - https://www.dan.me.uk/torlist/ -U SXTorBlocker/1.0 > /tmp/full.tor | |
| iptables -F TOR | |
| CMD=$(cat /tmp/full.tor | uniq | sort) | |
| for IP in $CMD; do | |
| let COUNT=COUNT+1 | |
| iptables -A TOR -s $IP -j DROP | |
| done | |
| iptables -A TOR -j RETURN | |
| echo -e "\n\tIptables now blocking TOR connections !\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment