#!/bin/bash
netstat -antup|grep SYN_RECV|awk '{print $5}'|awk -F: '{print $1}'|sort|uniq -c>/opt/tmp
exec</opt/tmp
while read line
do
  count=`echo $line|awk '{print $1}'`
  ip=`echo $line |awk '{print $2}'`
  if [ $count -gt 128 ]
  then iptables -I INPUT -s $ip -j DROP
  fi
done

  

posted on 2019-09-29 15:55  一纸情书べ  阅读(59)  评论(0编辑  收藏  举报