#!/bin/bash cur=`date +%H%M%S` becur=`date -d “1 minute ago” +%H%M%S` badip=`tail -n 10000 /var/log/httpd/access_log | egrep -v “\.(gif|jpg|jpeg|png|css|js)” | awk -v a=”$becu r” -v b=”$cur” -F [‘ ‘:] ‘{t=$5$6$7;if (t>=a && t=20) print $2} ‘` if [ ! -z $badip ];then for ip in $badip; do if test -z “`/sbin/iptables -nL | grep $ip`”;then /sbin/iptables -I […]
Recent Comments