Skip to contentSkip to conversation

nimda, "code red", IIS hacks VS iptables

DISCUSSION Robert Searle 2 participants 2 messages Sep 11, 2002 – Sep 12, 2002

lore
Share & tools
lore
#0 lore raw

Hello,

I was wondering how do I setup a iptables to protect a machine agains
nimda, code red, or any of the bottom junk? Basically how do I say block any ip that is sending me this crap! Is there a way to do it with
http://www.snort.org/

Also, if you could look at
http://www.platinumarchitecturegroup.com/articles/installNotes.html and give me any feedback. Please don't publish this link yet, I am still trying to finish it off!

Thanks
--Robert

[Sat Aug 31 18:42:48 2002] [error] [client 24.156.237.179] File does not
exist: /var/www/htdocs/platinumjava.com/MSADC/root.exe
[Sat Aug 31 18:42:55 2002] [error] [client 24.156.237.179] File does not
exist: /var/www/htdocs/platinumjava.com/c/winnt/system32/cmd.exe
[Sat Aug 31 18:43:02 2002] [error] [client 24.156.237.179] File does not
exist: /var/www/htdocs/platinumjava.com/d/winnt/system32/cmd.exe
[Sat Aug 31 18:43:05 2002] [error] [client 24.156.237.179] File does not
exist:
/var/www/htdocs/platinumjava.com/scripts/..%5c../winnt/system32/cmd.exe
[Sat Aug 31 18:43:08 2002] [error] [client 24.156.237.179] File does not
exist:
/var/www/htdocs/platinumjava.com/_vti_bin/..%5c../..%5c../..%5c../winnt/syst
em32/cmd.exe
[Sat Aug 31 18:43:12 2002] [error] [client 24.156.237.179] File does not
exist:
/var/www/htdocs/platinumjava.com/_mem_bin/..%5c../..%5c../..%5c../winnt/syst
em32/cmd.exe
[Sat Aug 31 18:43:18 2002] [error] [client 24.156.237.179] File does not
exist:
/var/www/htdocs/platinumjava.com/msadc/..%5c../..%5c../..%5c/..Á^\../..Á^\..
/..Á^\../winnt/system32/cmd.exe
[Sat Aug 31 18:43:24 2002] [error] [client 24.156.237.179] File does not
exist:
/var/www/htdocs/platinumjava.com/scripts/..Á^\../winnt/system32/cmd.exe
[Sat Aug 31 18:43:38 2002] [error] [client 24.156.237.179] File does not
exist:
/var/www/htdocs/platinumjava.com/scripts/..À¯../winnt/system32/cmd.exe
[Sat Aug 31 18:43:46 2002] [error] [client 24.156.237.179] File does not
exist:
/var/www/htdocs/platinumjava.com/scripts/..Á~\../winnt/system32/cmd.exe
[Sat Aug 31 18:44:07 2002] [error] [client 24.156.237.179] File does not
exist:
/var/www/htdocs/platinumjava.com/scripts/..%5c../winnt/system32/cmd.exe
[Sat Aug 31 18:44:14 2002] [error] [client 24.156.237.179] File does not
exist:
/var/www/htdocs/platinumjava.com/scripts/..%2f../winnt/system32/cmd.exe
[Sat Aug 31 19:02:26 2002] [error] [client 24.156.237.179] File does not
exist: /var/www/htdocs/platinumjava.com/scripts/root.exe
[Sat Aug 31 19:02:28 2002] [error] [client 24.156.237.179
#1 lore raw

Hello Robert,

Quoted 4 lines

I was wondering how do I setup a iptables to protect a machine agains
nimda, code red, or any of the bottom junk? Basically how do I say block any ip that is sending me this crap! Is there a way to do it with
http://www.snort.org/

IPTABLES is a stateful layer-3 packet filter. To match against Nimda, CodeRed, etc., IPTABLES would have to scan the Layer4-7 payload to check for any matches.

As I understand it, the stock IPTABLES code doesn't support anything like this but it seems that the "string" patch from the EXTRA patch-o-matic section might be what you are looking for:

http://www.netfilter.org/documentation/pomlist/pom-extra.html

I've never used this patch so the Netfilter folk will be able to better help you with this. One note to the wise though.. please be aware that enabling Layer4-7 filtering might cause significant performance impacts. I recommend to test things before and after you add in this patch.

Good luck!

Btw: some possible alternatives could be to use some creative
scripts to parse your HTTP logs add those infected IPs into a input DROP filter.

Other tools like Portsentry might be able to do this by now too.

--David

Quoted 40 lines

Also, if you could look at
http://www.platinumarchitecturegroup.com/articles/installNotes.html and give me any feedback. Please don't publish this link yet, I am still trying to finish it off!

Thanks
--Robert

[Sat Aug 31 18:42:48 2002] [error] [client 24.156.237.179] File does not
exist: /var/www/htdocs/platinumjava.com/MSADC/root.exe
[Sat Aug 31 18:42:55 2002] [error] [client 24.156.237.179] File does not
exist: /var/www/htdocs/platinumjava.com/c/winnt/system32/cmd.exe
[Sat Aug 31 18:43:02 2002] [error] [client 24.156.237.179] File does not
exist: /var/www/htdocs/platinumjava.com/d/winnt/system32/cmd.exe
[Sat Aug 31 18:43:05 2002] [error] [client 24.156.237.179] File does not
exist:
/var/www/htdocs/platinumjava.com/scripts/..%5c../winnt/system32/cmd.exe
[Sat Aug 31 18:43:08 2002] [error] [client 24.156.237.179] File does not
exist:
/var/www/htdocs/platinumjava.com/_vti_bin/..%5c../..%5c../..%5c../winnt/syst
em32/cmd.exe
[Sat Aug 31 18:43:12 2002] [error] [client 24.156.237.179] File does not
exist:
/var/www/htdocs/platinumjava.com/_mem_bin/..%5c../..%5c../..%5c../winnt/syst
em32/cmd.exe
[Sat Aug 31 18:43:18 2002] [error] [client 24.156.237.179] File does not
exist:
/var/www/htdocs/platinumjava.com/msadc/..%5c../..%5c../..%5c/..Á^\../..Á^\..
/..Á^\../winnt/system32/cmd.exe
[Sat Aug 31 18:43:24 2002] [error] [client 24.156.237.179] File does not
exist:
/var/www/htdocs/platinumjava.com/scripts/..Á^\../winnt/system32/cmd.exe
[Sat Aug 31 18:43:38 2002] [error] [client 24.156.237.179] File does not
exist:
/var/www/htdocs/platinumjava.com/scripts/..À¯../winnt/system32/cmd.exe
[Sat Aug 31 18:43:46 2002] [error] [client 24.156.237.179] File does not
exist:
/var/www/htdocs/platinumjava.com/scripts/..Á~\../winnt/system32/cmd.exe
[Sat Aug 31 18:44:07 2002] [error] [client 24.156.237.179] File does not
Quoted 8 lines

exist:
/var/www/htdocs/platinumjava.com/scripts/..%5c../winnt/system32/cmd.exe

[Sat Aug 31 18:44:14 2002] [error] [client 24.156.237.179] File does not
exist:
/var/www/htdocs/platinumjava.com/scripts/..%2f../winnt/system32/cmd.exe
[Sat Aug 31 19:02:26 2002] [error] [client 24.156.237.179] File does not
exist: /var/www/htdocs/platinumjava.com/scripts/root.exe
[Sat Aug 31 19:02:28 2002] [error] [client 24.156.237.179

.----------------------------------------------------------------------------.

|  David A. Ranch - Linux/Networking/PC hardware         [email protected]  |
!----                                                                    ----!

`----- For more detailed info, see http://www.ecst.csuchico.edu/~dranch -----'