Skip to content

Instantly share code, notes, and snippets.

@EternallLight
Created March 18, 2018 08:04
Show Gist options
  • Save EternallLight/e43053d7c5c667395f482189b062d15c to your computer and use it in GitHub Desktop.
Save EternallLight/e43053d7c5c667395f482189b062d15c to your computer and use it in GitHub Desktop.
Fail2Ban on Steroids – VoIP BlackList
#!/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