iptables -N invalid_http; iptables -I INPUT -p tcp --dport 80 -mstate --state NEW -j invalid_http; while true; do for i in `tail -n 50 /usr/local/apache/logs/error_log|grep Invalid.method |cut -d\ -f 1 |sort |uniq `; do iptables -nL invalid_http |grep -q $i || (iptables -I invalid_http -s $i -p tcp --dport 80 -j REJECT --reject-with tcp-reset; echo $i added); done; sleep 1; done the field position might be off. Handy for blocking the new type of http flood that sends invalid requests. (added state check cause the server bogs after about 12,000 rules)