I am trying to create a simple check to make sure none of the servers I manage have FrontPage permission set open on them. I will be incorporating this check into a security auditing script I've been working on for some time. Essentially, I want to duplicate the check that whisker.pl performs for front page (making a specific POST request to author.dll on a server, and inspecting the results to determine if I have the necessary access). I thought (perhaps optimistically) that I'd be able to simply create my own check, rather than trying to link into whisker.
Here is the code I have so far:
#! perl -w
$user_agent = new LWP::UserAgent || die "couldn't create agent";
my $servername = shift;
my $url = "http://".$servername."/_vti_bin/_vti_aut/author.dll";
$fp_request = new HTTP::Request('POST', $url,
listBorders=>'false']) || die "Coudn't make request";
$results = $user_agent->Request($fp_request) || die "I died here";
Which, when run, returns the following:
Can't call method "clone" on unblessed reference at C:/Perl/site/lib/HTTP/Message.pm line 53.
I realize the above code is ugly and lacking 'use strict', but it's really just prototype/proof of concept code right now.
I also looked through CPAN at HTTP::Request, and LWP::UserAgent, but didn't find anything there that would indicate what I'm doing wrong. Can someone point me in the right direction?
Note: I've read this
node and unfortunately was not able to figure out what I've done wrong.