jpk236 has asked for the wisdom of the Perl Monks concerning the following question:
This is the output I get when running this script:#!/usr/bin/perl -w use strict; use LWP::UserAgent; my ($ua, $req, $res, $output); $ua = new LWP::UserAgent(keep_alive=>1); $ua->agent('Internet Explorer/6.0'); $ua->credentials('domain.com:80', '', "domain\\user", 'pass'); $req = HTTP::Request->new(POST => 'http://domain.com/cgi-bin/test.cgi' +, HTTP::Headers->new('WWW-Authenticate' => 'NTLM')); $req->content_type('application/x-www-form-urlencoded'); $req->content('testvar=testvalue'); $res = $ua->request($req); $output = $res->content; print "output:\n".$output;
I've tried a number of methods to handle the challenge/response, but to no avail. I've even tried using a stand-alone curl command, which has a --ntlm option.output: <HTML> <HEAD> <TITLE></TITLE> </HEAD> <BODY onLoad="document.AUTOSUBMIT.submit();"> This page is used to hold your data while you are being authorized for + your request.<BR><BR>You will be forwarded to continue the authoriza +tion process. If this does not happen automatically, please click the + Continue button below. <FORM NAME="AUTOSUBMIT" METHOD="POST" ACTION="http://logon.domain.com/ +ntlm/creds.ntc?CHALLENGE=&SMAGENTNAME=$SM$7itOP8YnQhR1qQcOO6pp75JDJJF +C96mLihRDilLmOSr8oAm7zddwfw%3d%3d&TARGET=$SM$http%3a%2f%2domain%2ecom +%2fcgi-bin%2ftest%2ecgi"> <INPUT TYPE="HIDDEN" NAME="SMPostPreserve" VALUE="L2JDNDdmSXpOWVVOT2wy +YUt4VjZpb1JkbkkxRVlZbUd4ZVdadkFoaGpQZWJVZHE4eW9IcGNJNEx3dUdmYi81Qw"> <INPUT TYPE="SUBMIT" VALUE="Continue"> </FORM> </BODY> </HTML>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: LWP::UserAgent vs. NTLM Challenge/Response
by jettero (Monsignor) on Oct 04, 2007 at 14:15 UTC | |
by bigmacbear (Monk) on Oct 04, 2007 at 18:01 UTC | |
|
Re: LWP::UserAgent vs. NTLM Challenge/Response
by atemon (Chaplain) on Oct 04, 2007 at 14:36 UTC | |
by jpk236 (Monk) on Oct 04, 2007 at 15:18 UTC | |
|
Re: LWP::UserAgent vs. NTLM Challenge/Response
by blahblahblah (Priest) on Oct 05, 2007 at 01:09 UTC | |
|
Re: LWP::UserAgent vs. NTLM Challenge/Response
by phio (Acolyte) on Jul 27, 2009 at 11:23 UTC | |
|
Re: LWP::UserAgent vs. NTLM Challenge/Response
by Giuoco (Initiate) on May 05, 2009 at 19:22 UTC |