Xyberviri

FuckYouSpamers.sh

Oct 25th, 2013
413
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.52 KB | None | 0 0
  1. #!/bin/bash
  2. ###PUT HERE COMA SEPARATED LIST OF COUNTRY CODE###
  3. COUNTRIES="TW,CN,RU"
  4. WORKDIR="/root"
  5. #######################################
  6. cd $WORKDIR
  7. wget -c --output-document=iptables-blocklist.txt http://blogama.org/country_query.php?country=$COUNTRIES
  8. if [ -f iptables-blocklist.txt ]; then
  9.   iptables -F
  10.   BLOCKDB="iptables-blocklist.txt"
  11.   IPS=$(grep -Ev "^#" $BLOCKDB)
  12.   for i in $IPS
  13.   do
  14.     iptables -A INPUT -s $i -j DROP
  15.     iptables -A OUTPUT -d $i -j DROP
  16.   done
  17. fi
  18. rm $WORKDIR/iptables-blocklist.txt
Advertisement
Add Comment
Please, Sign In to add comment