#!/bin/bash
#Created by http://www.jb200.com
num=100 #上限
list=`netstat -an |grep ^tcp.*:80|egrep -v 'LISTEN|127.0.0.1'|
linuxjishu/13830.html target=_blank class=infotextkey>awk -F"[ ]+|[:]" '{print $6}'|sort|uniq -c|sort -rn|awk '{if ($1>$num){print $2}}'`
for i in $list
do
iptables -I INPUT -s $i --dport 80 -j DROP
done