#!/usr/local/bin/perl # # Notify CodeRed infection to SecurityFocus # Usage: codered_notify.pl [-f youraddress] < /path/to/access_log # # SEE ALSO: http://www.securityfocus.com/archive/1/201907 # use strict; use Config; use Getopt::Std; use Mail::Sendmail; getopts('f:', \my %opt); my $from = $opt{f} || $Config{cf_email}; my $to = 'aris-report@securityfocus.com'; my %ip2date; while (<>) { next unless m@GET /default\.ida\?[XN]+@; my($ip, $datetime) = /^(.*?) .*? .*? \[(.*?)\]/; next if $ip2date{$ip}; $ip2date{$ip} = $datetime; } my $message = join '', map { "$_ $ip2date{$_}\n" } keys %ip2date; sendmail( To => $to, From => $from, Message => $message, Subject => "CodeRed Infection Notification", );
--
Tatsuhiko Miyagawa
miyagawa@cpan.org
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CodeRed notifier
by jepri (Parson) on Aug 06, 2001 at 02:13 UTC | |
by Malkavian (Friar) on Aug 06, 2001 at 17:29 UTC | |
by miyagawa (Chaplain) on Aug 06, 2001 at 18:59 UTC | |
|
Re: CodeRed notifier
by scottstef (Curate) on Aug 06, 2001 at 18:41 UTC | |
by miyagawa (Chaplain) on Aug 06, 2001 at 19:01 UTC | |
|
Re: CodeRed notifier
by Brovnik (Hermit) on Aug 08, 2001 at 18:23 UTC | |
|
Re: CodeRed notifier
by cajun (Chaplain) on Aug 07, 2001 at 11:24 UTC |