3 Star 16 Fork 13

aqztcom / cc_iptables

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
cc_iptables1.sh 294 Bytes
一键复制 编辑 原始数据 按行查看 历史
ppabc 提交于 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
Shell
1
https://gitee.com/null_564_0890/cc_iptables.git
git@gitee.com:null_564_0890/cc_iptables.git
null_564_0890
cc_iptables
cc_iptables
master

搜索帮助