in reply to More NTLM
</code>#!perl; use strict; use warnings; use LWP::UserAgent; use HTTP::Request::Common; my $url = "<some url to an asp page on a protected site here>"; # Set up the ntlm client and then the base64 encoded ntlm handshake me +ssage my $ua = new LWP::UserAgent(keep_alive=>1); $ua->credentials('<host:port here>', '', "<domain\\uid here>", '<pdw h +ere>'); 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" }
#!perl; use strict; use warnings; use LWP::UserAgent; use HTTP::Request::Common; use Authen::NTLM qw(nt_hash lm_hash); my $my_pass = "<pwd here>"; my $client = new_client Authen::NTLM(lm_hash($my_pass), nt_hash($my_pa +ss)); # How does the ntlm functions tie in with Lwp methods? my $ua = LWP::UserAgent->new(keep_alive=>1); $ua->proxy('http','<proxy name here>'); my $resp = $ua->request(GET "http://www.perl.com"); my $htmcode = $resp->{_content}; print "here comes the output...\n$htmcode\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: More NTLM
by crashtest (Curate) on Mar 29, 2005 at 04:45 UTC | |
by Anonymous Monk on Jun 12, 2008 at 03:31 UTC | |
by Anonymous Monk on Apr 13, 2009 at 18:08 UTC | |
by Corion (Patriarch) on Apr 13, 2009 at 18:29 UTC | |
by crashtest (Curate) on Apr 21, 2009 at 21:04 UTC |