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