首页 > 代码库 > BADIP filter
BADIP filter
#!/bin/bashtouch /tmp/badipnew.log;touch /tmp/newip.log;if [ ! -f "/tmp/badip.log" ];thencat /var/log/secure|grep "authentication failure\|Did not receive identification"|grep -o ‘[0-9]\+\.[0-9\.]\+‘|grep ‘\.‘ |sort|uniq > /tmp/badip.log;for i in `cat /tmp/badip.log`;doecho $i;iptables -t filter -A INPUT -s $i -m state --state NEW -j DROP ;done;ficat /var/log/secure|grep "authentication failure\|Did not receive identification"|grep -o ‘[0-9]\+\.[0-9\.]\+‘|grep ‘\.‘ |sort|uniq > /tmp/badipnew.log;diff /tmp/badip.log /tmp/badipnew.log |sed ‘1d‘|grep ">"|awk ‘{print $2}‘ > /tmp/newip.logcat /tmp/newip.log >> badip.log;for i in `cat /tmp/newip.log`;doecho $i;iptables -t filter -A INPUT -s $i -m state --state NEW -j DROP ;done;:>/tmp/badipnew.log;:>/tmp/newip.log
BADIP filter
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。