Created
March 18, 2018 08:04
-
-
Save EternallLight/e43053d7c5c667395f482189b062d15c to your computer and use it in GitHub Desktop.
Fail2Ban on Steroids – VoIP BlackList
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 | |
# Check if chain exists and create one if required | |
if [ `iptables -L | grep -c "Chain BLACKLIST-INPUT"` -lt 1 ]; then | |
/sbin/iptables -N BLACKLIST-INPUT | |
/sbin/iptables -I INPUT 1 -j BLACKLIST-INPUT | |
fi | |
# Empty the chain | |
/sbin/iptables -F BLACKLIST-INPUT | |
wget -qO - “http://www.voipbl.org/update/” |\ | |
awk '{print "if [ ! -z \""$1"\" -a \""$1"\" != \"#\" ]; then /sbin/iptables -A | |
BLACKLIST-INPUT -s \""$1"\" -j DROP;fi;"}' | sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment