This commit is contained in:
Mafoo 2017-05-11 07:05:04 +00:00 committed by GitHub
commit 9c9ce9ffdb
1 changed files with 29 additions and 4 deletions

View File

@ -10,6 +10,27 @@ cd "$(dirname "$0")"
verbose "Configuring IPTables"
#run iptables commands
#filter unencrypted traffic to drop known common bots
iptables -N sip_bot_check
iptables -A sip_bot_check -j DROP -m string --string "sipcli/" --algo bm
iptables -A sip_bot_check -j DROP -m string --string "sipvicious" --algo bm
iptables -A sip_bot_check -j DROP -m string --string "sip-scan" --algo bm
iptables -A sip_bot_check -j DROP -m string --string "sipsak" --algo bm
iptables -A sip_bot_check -j DROP -m string --string "sundayddr" --algo bm
iptables -A sip_bot_check -j DROP -m string --string "friendly-scanner" --algo bm
iptables -A sip_bot_check -j DROP -m string --string "iWar" --algo bm
iptables -A sip_bot_check -j DROP -m string --string "SIVuS" --algo bm
iptables -A sip_bot_check -j DROP -m string --string "Gulp" --algo bm
iptables -A sip_bot_check -j DROP -m string --string "sipv" --algo bm
iptables -A sip_bot_check -j DROP -m string --string "smap" --algo bm
iptables -A sip_bot_check -j DROP -m string --string "friendly-request" --algo bm
iptables -A sip_bot_check -j DROP -m string --string "VaxIPUserAgent" --algo bm
iptables -A sip_bot_check -j DROP -m string --string "VaxSIPUserAgent" --algo bm
iptables -A sip_bot_check -j DROP -m string --string "siparmyknife" --algo bm
iptables -A sip_bot_check -j DROP -m string --string "Test Agent" --algo bm
iptables -A sip_bot_check -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -j DROP -p udp --dport 5060:5061 -m string --string "friendly-scanner" --algo bm
@ -27,10 +48,14 @@ iptables -A INPUT -j DROP -p tcp --dport 5080:5081 -m string --string "VaxSIPUse
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
iptables -A INPUT -p tcp --dport 5060:5061 -j ACCEPT
iptables -A INPUT -p udp --dport 5060:5061 -j ACCEPT
iptables -A INPUT -p tcp --dport 5080:5081 -j ACCEPT
iptables -A INPUT -p udp --dport 5080:5081 -j ACCEPT
iptables -A INPUT -p tcp --dport 5060 -j sip_bot_check
iptables -A INPUT -p udp --dport 5060 -j sip_bot_check
iptables -A INPUT -p tcp --dport 5080 -j sip_bot_check
iptables -A INPUT -p udp --dport 5080 -j sip_bot_check
iptables -A INPUT -p tcp --dport 5061 -j ACCEPT
iptables -A INPUT -p udp --dport 5061 -j ACCEPT
iptables -A INPUT -p tcp --dport 5081 -j ACCEPT
iptables -A INPUT -p udp --dport 5081 -j ACCEPT
iptables -A INPUT -p udp --dport 16384:32768 -j ACCEPT
iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
iptables -A INPUT -p udp --dport 1194 -j ACCEPT