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
use LWP::UserAgent;
use HTTP::Request;
$user_agent = new LWP::UserAgent || die "couldn't create agent";
my $servername = shift;
my $url = "http://".$servername."/_vti_bin/_vti_aut/author.dll";
print "$url\n";
$fp_request = new HTTP::Request('POST', $url,
[method=>'list+documents%3a3%2e0%2e2%2e1706',
service-name=>'',
listHiddenDocs=>'true',
listExplorerDocs=>'true',
listRecurse=>'false',
listFiles=>'true',
listFolders=>'true',
listLinkInfo=>'true',
listIncludeParent=>'true',
listDerivedT=>'false',
listBorders=>'false']) || die "Coudn't make request";
$results = $user_agent->Request($fp_request) || die "I died here";
print "$results\n";
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.