Hi Monks
I am trying to use following code (from CPAN website) to do NTLM authentication with perl but its not working.
#!/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://192.168.1.27/index.html'; # Set up the ntlm client and then the base64 encoded ntlm handshake me +ssage my $ua = LWP::UserAgent->new(keep_alive=>1); my $host = '192.168.1.27:80'; my $uname = 'test.com\User1'; my $psswd = 'test1234'; $ua->credentials('192.168.1.27:80', '', "$uname", "$psswd"); my $request = GET $url; print "--Performing request now...-----------\n"; my $response = $ua->request($request); print "--Done with request-------------------\n"; if ($response->is_success) {print "It worked!->" . $response->code . " +\n"} else {print "It didn't work!->" . $response->code . "\n"
Looking at the packet capture, i see that ???? sent as domain rather test.com. Is there something i am doing wrong?
In reply to wrong domain name when using LWP::Authen::Ntlm by iThunder
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |