for i in `netstat -an | grep -i ‘:80 ‘|grep ‘EST’ | awk ‘{print $5}’ | cut -d : -f 1 | sort | uniq -c | awk ‘{if($1 > 50) {print $2}}’`
echo $i echo $i >> /tmp/banip /sbin/iptables -A INPUT -p tcp -j DROP -s $i done本文共 257 字,大约阅读时间需要 1 分钟。
for i in `netstat -an | grep -i ‘:80 ‘|grep ‘EST’ | awk ‘{print $5}’ | cut -d : -f 1 | sort | uniq -c | awk ‘{if($1 > 50) {print $2}}’`
echo $i echo $i >> /tmp/banip /sbin/iptables -A INPUT -p tcp -j DROP -s $i done转载于:https://blog.51cto.com/3403658/812789