Arrg, to bandwith mou !!

DJ Art djart at linux.gr
Thu Sep 20 13:07:01 EEST 2001


On Wednesday 19 September 2001 10:35, I.Ioannou wrote:

> Exei kaneis kana kalo script na kanei ban-out (firewall rules)
> aytes ths IPs (kai pws ginetai me ta low permissions
> pou exei o apache ?)

Το παρακάτω σου κάνει ?? Πρέπει να το έχω βρεί κάπου από το Linux 
Journal:

είναι cronjob:


#!/bin/sh
#
# Block sites which originate Nimba queries from Apache server
# Apache must be configured with HostnameLookups Off

LOGS=/var/log/httpd

cd $LOGS

grep '^[0-9]*\.[0-9]*\.[0-9]*\.[0-9]* ' * 2>/dev/null |
awk '/system32\/cmd\.exe/ {sub(/[^:]*:/,"");print $1}' |
sort -u |
while read host
do
if ! fgrep $host /var/tmp/blocked >/dev/null
then
echo $host >>/var/tmp/blocked
/sbin/ipchains -I input -s $host -j DENY -l
fi
done

###

-- 
Kyritsis Athanasios <djart at hellug.gr>

- What's your ONE purpose in life ?
- To explode, of course! ;-)



More information about the Linux-greek-users mailing list