in reply to Re^9: Automate WebLogin
in thread Automate WebLogin

Hi Corion - I was able to install the Live HTTP Headers firefox plugin and capture the data being exchanged b/w the webserver and browser.

Here is the last request and response header before finally logging into the application:

https://intra.xyz.com/cmpm/login.cfm?dparm=main GET /cmpm/login.cfm?dparm=main HTTP/1.1 Host: intra.xyz.com User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:7.0.1) Gecko/20100101 Fire +fox/7.0.1 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0. +8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip, deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Connection: keep-alive Referer: https://www.e-access.xyz.com/pagLogin/?retURL=hxtps%3A%2F%2Fi +ntra%2Exyz%2Ecom%2Fcmpm%2Flogin%2Ecfm%3Fdparm%3Dmain&sysName=EBIZ Cookie: CFID=73908; CFTOKEN=fe84f551934ee35f-7BA356FE-1517-3A9B-94017F +2054750B94; xyzESSec=0080Vfb7DN-d75F8qhbStTSlNXPp8VDwgQ8swtr41Im90s3l +HiRb6FC4BzZFGGqHhuL5gJ5XgAk8fYffffiHzHsgQx-7KFGEdfSV2LopC20rbI_l795Xs +8Wk36Ce8ldkmSMkjyyHgDnh9cqEP6RXa6AuoEUEaZT6pzpiadmu6b5_pApNkoHavdnSPg +S8gLMT2gF_8AChkQj1GT7Kxj78sEI-G5ZXiX819ryZ0wd-W0Cp6pdpHbfYqPUPhkE9fQ1 +L9RjF; xyzESHr=USER%7cNAME%7cUSERID%40ap%2exyz%2ecom%7c%2b1+816+82365 +59%7c%7cjs7856%7c%7cUSERID%2cRTRRDYJ%2cT24B945%2c8620265%7cYNNNNNNNNN +NNNNYNYYNNNNNN%7cUSER%7cEY1269A00%7c; xyzESg2=006cVfb7DN-d75F8qhbStTS +lNXPp8VDwgQ8swtr41Im90s0E6WCok9TyV4ePylbGdQXhm5O-RU7O7uZEAC5GGTPAxNSU +Ha5wvFW_irLNTc4v4PM.zmfWPhfqyBLeXQMbssRNdlgYXv17VWw0cOpxRCuaSHQYU04zT +nkN20aFNHSdm4hPi4F6l2k1WENRmDaDszWa6tBx_07mAC3kzuvIKl1hD8_rxJofmk6_SU +gEox5_he5j HTTP/1.1 200 OK Server: Sun-Java-System-Web-Server/7.0 Date: Thu, 06 Oct 2011 12:18:10 GMT Content-Type: text/html; charset=UTF-8 Transfer-Encoding: chunked

Replies are listed 'Best First'.
Re^11: Automate WebLogin
by Corion (Patriarch) on Oct 07, 2011 at 07:37 UTC

    That's great for you.

    Now you just have to find out what your Perl script sends, and eliminate the differences, and you're all set.

    If you have further questions, please refer to the answers you already got from me in my above replies.

      While trying to send the request using sockets I was able to get the response back from the webserver the first time.Second time it just dies; i m not able to get any error while debugging:

      my $client = IO::Socket::SSL->new("xyz.com:https") || warn "I encountered a problem: ".IO::Socket::SSL::errst +r(); print $client "GET /main.cfm HTTP/1.1\n"; print $client "Host: xyz.com\n"; print $client "User-Agent: low_level/1.0\n"; print $client "Accept: text/html,application/xhtml+xml,application/xml +;q=0.9,*/*;q=0.8 \n"; print $client "Accept-Language: en-us,en;q=0.5 \n"; print $client "Accept-Encoding: gzip, deflate \n"; print $client "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 \n"; print $client "Connection: keep-alive \n\n"; { local $/ = undef; my $res = <$client>; print $res; ($cfid, $cftoken) = ($res =~ /(CFID=.+?\;).*(CFTOKEN=.+?)\;/s ); } print "Subsequent Req. \n"; print $client "GET /login.cfm?dparm=main HTTP/1.1\n"; print $client "Host: xyz.com\n"; print $client "User-Agent: low_level/1.0\n"; print $client "Accept: text/html,application/xhtml+xml,application/xml +;q=0.9,*/*;q=0.8 \n"; print $client "Accept-Language: en-us,en;q=0.5 \n"; print $client "Accept-Encoding: gzip, deflate \n"; print $client "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 \n"; print $client "Connection: keep-alive \n"; print $client "Cookie: $cfid $cftoken \n\n"; print <$client>;

      The script ends abruptly after the excuting the following code without any stack trace:

      Net::SSLeay::ssl_write_all(blib/lib/Net/SSLeay.pm (autosplit into blib +/lib/auto/Net/SSLeay/ssl_write_all.al):1654): 1654: $wrote = write_partial($ssl, $written, $to_write, $$da +ta_ref); DB<2> [app_user@sandhost perl]$

      Version Info: Net::SSLeay - 1.30 IO::Socket::SSL - 1.44 perl verions - 5.8.8