grep 'default.ida' /path/to/access_log | awk {'print $1'} | sort -n | +uniq | this_perl_script.pl
...say...every two minutes or so.
It would be cool if someone would expand this to do a whois query, prase the results for emails, and send $message to the admins and owners of the domains involved.
#!/usr/bin/perl -w use strict; use LWP::Simple; my $ipaddress; # Message to the sysadmin who is infected. I've kept out unusual # punctuation on purpose my $message = <<END; You are infected with the Code Red II worm and it is bloody annoying. +For details head to http://www.cert.org/advisories/CA-2001-19.html END $message =~ s/ /_/g; foreach $ipaddress (@ARGV) { my $full_url = "http:\/\/$ipaddress\/$message"; my $junk = get($full_url); }
Kickstart
|
|---|