关于冰盾 | 使用条款 | 网站地图
 
LINUX/CentOS防CC攻击脚本
LINUX/CentOS防CC攻击脚本
作者:冰盾防火墙 网站:www.bingdun.com 日期:2014-11-23
 

  #!/bin/sh

  cd /var/log/httpd/

  cat access_log|awk '{print $1}'|sort|uniq -c|sort -n -r|head -n 20 > a

  cp /dev/null access_log

  cp /dev/null error_log

  cp /dev/null limit.sh

  cp /dev/null c

  #awk '{print $2}' a|awk -F. '{print $1"."$2"."$3}'|sort|uniq > b

  cat a|while read num ip

  do

  if [ "$num" -gt "20" ]

  then

  echo $ip >> c

  fi

  done

  cat c|awk -F. '{print $1"."$2"."$3}'|sort|uniq > b

  #cat c|sort|uniq > b

  for i in `cat b`

  #cat b|sed 's/\./ /g'|while read i1 i2 i3 i4

  do

  if `cat ourip |grep $i > /dev/null 2>&1`

  then

  echo "`date` $i" >> test

  else

  echo "iptables -I INPUT -p tcp -dport 80 -s $i.0/24 -j DROP" >> limit.sh

  fi

  done

  sh limit.sh

linux CentOS CC攻击 攻击脚本

 

 
最新内容:
php 攻击方法之谈php+mysql注射语句构造[2014-11-23]
企业对付DDoS攻击 资深网管教你几大妙招[2014-11-22]
浅析七种DDoS攻击技术[2014-11-22]
如何处理DDoS攻击[2014-11-22]
Cisco路由器如何防止DDoS攻击[2014-11-22]
浅谈sql注入式(SQL injection)攻击与防范[2014-11-22]
相关内容:

合作伙伴: 黑基网 补天科技 威盾科技 站长下载 新飞金信 北京电信 ZOL应用下载
中华人民共和国增值电信业务经营许可证京ICP备14024464 公安备案号 京1081234 
版权所有©2003-2014 冰盾防火墙  www.BingDun.com 法律声明
总机:(010)51661195