Someone asked me to post the "tweaks" I had to do to make the script I
posted about last week work on OS X. (see below for that URL)
Basically, the main thing that was wrong was that the Cache::FileCache
module, which uses Cache::CacheUtil to make a unique path under
/tmp/FileCache, was bombing. The problem turned out to be in
/System/Library/Perl/File/Path.pm That script calls the system "mkdir()"
routing, passing the new path (i.e. /tmp/FileCache/Nimda/a/b/c) to be
created. OS X/Darwin was spitting out "No such file or directory" in
response. If you issued a "mkdir" for that at the shell prompt, you'd get
the same error unless you either used the "-p" argument or if
/tmp/FileCache/Nimda/a/b already existed.
After much running around (I'm very new to perl), I finally just modified
CacheUtil.pm to make a "system()" call instead of using Path.pm's mkpath()
function.
Here's the new code (with the old code, at line 315, commented out):
# mkpath( $directory, 0, $DIRECTORY_MODE );
my $myCmd = "mkdir -p $directory";
system($myCmd) ;
The only other changed made were to personalize the email address and such
of the MSIISProbes.pm script and got the sendmail daemon up and running to
handle return email.
-----Original Message-----
From: <removed for privacy>
Sent: Friday, September 21, 2001 11:31 PM
To: Eric Smalling
Subject: Re: Virus alert message
On Friday, September 21, 2001, at 02:37 PM, Eric Smalling wrote:
> I've been using a script that I head about on slashdot.org, it tries to
> email the web site's admins and also sends one email per unique ip
> address
> to SecurityFocus.com for logging. It handles both CodeRed and Nimda
> attacks
> (and can be used for just about anything like them via the Apache
> configuration).
>
> Info on it is at: http://www.tonkinresolutions.com/MSIISProbes.pm.html
Hi Eric -
Can you pass along those tweaks for MacOS X? I tried it late last night
and had no luck. I've been using Reuven Lerner's CodeRed module for the
last month or so, but struck out trying to get the above working.
> It took some tweaking to get it and the rest of the mod_perl stuff to
> work
> correctly on OS X, but it works great now. (Hopefully it will do some
> good!)