davidbrit2
Licensed Computer Geek
The Code Red worm has really gone crazy lately. Of course, since we're using Macs, we're pretty much immune to the worm's antics, but its still annoying as hell, what with cluttering up Apache logs world-wide. That being said, here's a couple of really tiny shell scripts that you can use to ignore its log entries, and also generate a count on its intrusion attempts this month. Of course, these will only work if Apache is running, and logging access.
You can do with these as you please.
httpdlog.sh
wormy.sh
These miniscule scrips should be able to spot the major variations I've seen on my system. If you find others, by all means, update the scripts. It's not like I'm going to claim copyright on three lines of code.
You can do with these as you please.
httpdlog.sh
Code:
#!/bin/sh
cat /var/log/httpd/access_log | awk '! /default/ && ! /XXXXX/ && ! /NNNNN/' | more
wormy.sh
Code:
#!/bin/sh
echo August Code Red intrusion attemps thus far:
cat /var/log/httpd/access_log | awk '(/default/ || /XXXXX/ || /NNNNN/) && /Aug/' | wc -l
These miniscule scrips should be able to spot the major variations I've seen on my system. If you find others, by all means, update the scripts. It's not like I'm going to claim copyright on three lines of code.