Ok, perhaps I'm just bitter. But I'm very tempted at this point to let the M$ IIS admins hear back from the "Code Red II" worms they've got infecting their system, by doing this:
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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.