2 Star 0 Fork 51

ppabc / cc_iptables

forked from ppabc / cc_iptables 
Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
cc_iptables1.sh 294 Bytes
Copy Edit Raw Blame History
ppabc authored 2014-10-16 13:38 . update
#!/bin/bash
##http://www.vsyour.com/post/140.html
num=100 #上限
cd /home/wwwlogs
#读取最新1000条记录,如果单IP超过100条就封掉。
for i in tail access.log -n 1000|awk '{print $1}'|sort|uniq -c|sort -rn|awk '{if ($1>$num){print $2}}'
do
iptables -I INPUT -p tcp -s $i --dport 80 -j DROP
done
1
https://gitee.com/popop0909090/cc_iptables.git
git@gitee.com:popop0909090/cc_iptables.git
popop0909090
cc_iptables
cc_iptables
master

Search