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.
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.