Last active
December 19, 2015 06:49
-
-
Save sethkinast/5914577 to your computer and use it in GitHub Desktop.
Tiny script to grab Tor exitnodes and ban them via CloudFlare's API
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
#!/bin/bash | |
SERVERS=(108.162.196.125 108.162.197.125) | |
for server in ${SERVERS[*]} | |
do | |
echo "Now processing $server" | |
wget --timeout=10 -t1 -O tor.txt https://check.torproject.org/cgi-bin/TorBulkExitList.py?ip=$server | |
for ip in `tail -n +4 tor.txt` | |
do | |
curl https://www.cloudflare.com/api_json.html \ | |
-d 'a=ban' \ | |
-d 'tkn=xxxxxx' \ | |
-d '[email protected]' \ | |
-d "key=${ip}" | |
done | |
done | |
rm tor.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment