Re: NIMDA
>> A ce sujet, il n'y aurait pas moyen de limiter les dégats que fait ce virus
>> sur nos serveurs en "occuppant" le virus lorsqu'il fait une requete. Exemple,
>> créér un /scripts/root.exe en php ou cgi ou autre qui ferait betement un
>> sleep et ferait perdre du temps au virus?
>>
>> Je ne suis absolument pas webmaster donc veuillez m'excuser/m'expliquer si
>> cette idéé est stupide.
>
> Voici une piste : http://slashdot.org/articles/01/09/20/1241249.shtml
J'ai trouvé ceci qui peut peut être aider. Cela utilise ipchains pour
bloquer les requêtes. Je ne l'ai pas encore essayé.
============
#!/bin/sh
# Location of Apache log
cd /var/log/httpd
# Raise -n, if needed
tail -n10000 --follow=name access_log | \
awk '
# Catch Nimda
/scripts\/root.exe/ {
old=0
while(getline line < "nimda.txt"){if($1 ~ line) old=1}
if(old==0){
# Remember worm box
print $1 >> "nimda.txt"
# Goodbye
system("/sbin/ipchains -A input -j DENY -i eth0 -p tcp -s " $1 "
--destination-port 80")
} close("nimda.txt")
}
# Catch Code Red
/default.ida/ {
old=0
while(getline line < "codered.txt"){if($1 ~ line) old=1}
if(old==0){
# Remember worm box
print $1 >> "codered.txt"
# Goodbye
system("/sbin/ipchains -A input -j DENY -i eth0 -p tcp -s " $1 "
--destination-port 80")
} close("codered.txt")
}' - &
================
Un autre en iptable :
I do something a bit more elaborate than this, but the basic idea is as
follows. First script builds list of lusers.
#!/bin/bash
ERRORLOG='/var/log/httpd/error_log'
PATTERN='winnt'
cat "$ERRORLOG" \
| grep "$PATTERN" \
| awk '{ print $8 }' \
| sed -e s/]// \
| sort \
| uniq \
> lusers
Second script blocks packets from lusers.
#!/bin/bash
ipchains -F
for LUSER in `cat lusers`
do
ipchains -A input -s $LUSER -j DENY
Done
..........................................................
. Linux - Debian - php4 - Apache - MySQL - Infogerance .
. email: info@actionweb.fr - http://www.actionweb.fr .
. Tel: (0)141 906 100 - Fax: (0)141 906 101 .
..........................................................
Reply to:
- Follow-Ups:
- Re: NIMDA
- From: Stephane Leclerc <sleclerc@actionweb.fr>
- References:
- Re: NIMDA
- From: Charles Goyard <charles@terrien.org>