For clarifying if it is related to the patch of /usr/local/share/perl/5.10.1/LWP/Authen/Ntlm.pm, I covered it back and update the new output:
--Peforming request now...---------
--Done with request ...---------
Error: 401 Unauthorized
Date: Tue, 11 Oct 2011 04:32:33 GMT
Server: Microsoft-IIS/6.0
WWW-Authenticate: Negotiate
WWW-Authenticate: NTLM
Content-Length: 1251
Content-Type: text/html
Client-Date: Tue, 11 Oct 2011 04:36:23 GMT
Client-Peer: 10.1.1.1:80
Client-Response-Num: 7
Client-Warning: Credentials for 'domain\user' failed before
Title: ��δ����Ȩ
+5533;鿴��ҳ
X-Powered-By: ASP.NET
The perl script is following:
#!/usr/bin/perl
use LWP::UserAgent;
use HTTP::Request::Common;
use LWP::Debug qw(+);
use Authen::NTLM;
use strict;
use warnings;
ntlmv2(1);
my $url = "http://10.1.1.1";
my $ua = new LWP::UserAgent(keep_alive => 1);
$ua->credentials('10.1.1.1:80', '', 'domain\user', 'password');
my $req = HTTP::Request->new(GET => $url);
print "--Peforming request now...---------\n";
my $res = $ua->request($req);
print "--Done with request ...---------\n";
# check the outcome
if ($res->is_success) {
print $res->content;
} else {
print "Error: " . $res->status_line . "\n";
print $res->headers()->as_string(), "\n";
}
exit 0;
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|