NetTalk Central

Author Topic: POST problem trying to login (Weather example)  (Read 14442 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
POST problem trying to login (Weather example)
« on: April 28, 2010, 04:22:53 AM »
Hi, I´m trying to login to a site.
I´m using the Drive proc of the Weather example to try the login and fiddler.exe to see the original post.
The page is
http://www.ravaonline.com/v2/clientes/posicion.php
Its in spanish but the only fields that matters are:
Cliente: (User)  and  Clave:  (password) , and the Ingresar button (Login)
The password used in the following examples and code is incorrect, the page received after the post must contanin astinrg like: El nombre de usuario es inválido... "The username is invalid..."
but I´m receivung always the same original page, no response.

With fiddler the post sent is:

POST /v2/clientes/posicion.php? HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Referer: http://www.ravaonline.com/v2/clientes/posicion.php
Accept-Language: es-AR
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GTB6; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; OfficeLiveConnector.1.4; .NET CLR 3.0.30729; OfficeLivePatch.1.3; .NET CLR 1.1.4322)
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
Host: www.ravaonline.com
Content-Length: 75
Connection: Keep-Alive
Pragma: no-cache
Cookie: PHPSESSID=2c0ae0c5fabae5cfe505b1d3d1773ae6; __utma=179040551.1217564139.1272453030.1272453030.1272453030.1; __utmb=179040551.1.10.1272453030; __utmc=179040551; __utmz=179040551.1272453030.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)

accion=u_login&usuario_nivel_acceso=cliente&u_usuario=8786&u_clave=xxx


With the Drive proc
The only cookie that it recognize when you press the "Fetch page from URL above" button is the PHPSESSID
I´ve added the rest of the cookies manually, where do they come from?
Then the post sent is:

POST http://www.ravaonline.com/v2/clientes/posicion.php? HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Host: www.ravaonline.com
Content-Length: 72
Cookie: PHPSESSID=8ef184674853d291cb0ace5151ce6a08;__UTMA=179040551.1217564139.1272453030.1272453030.1272453030.1; __UTMB=179040551.6.10.1272453030; __UTMC=179040551; __UTMZ=179040551.1272453030.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none);
Proxy-Connection: Keep-Alive

accion=u_login&usuario_nivel_acceso=cliente&u_usuario=8786&u_clave=xxx

It does not work.
May be the cookies which are originaly lowercase are set to uppercase using the .SetCookie method
May be the space between the ; and the cookie

Any idea?
Thanks

-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: POST problem trying to login (Weather example)
« Reply #1 on: April 28, 2010, 07:47:17 AM »
I'll have a look tomorrow Alberto and see if i can see anything specific.

cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: POST problem trying to login (Weather example)
« Reply #2 on: May 01, 2010, 07:09:02 AM »
Please Bruce...
(I know you were busy with PR13 and thanks for that.)
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: POST problem trying to login (Weather example)
« Reply #3 on: May 03, 2010, 02:31:20 AM »
I think the other cookies are a distraction. I think they are left over from other interactions you've had with the site. In my test here I ignored them, and that seemed ok.

Using the NetDemo app I first did a GET on http://www.ravaonline.com/v2/clientes/posicion.php
That gives me the PHP Session Id.

Then I did a Post, setting
Post URL: http://www.ravaonline.com/v2/clientes/posicion.php?
Post String: accion=u_login&usuario_nivel_acceso=cliente&u_usuario=8786&u_clave=xxx
Cookies set to: PHPSESSID=9b4a710d9153a47a9fa443b93d611077;

I got a page back - I'm not sure if it's ok or not though. (obviously the password I used would have been wrong.)

Your next step is to use the NetSimple client, and send the whole packet as it was recorded in Fiddler. Then slowly change the packet so it matches the one fro the Webclient. That way you can see what it likes, or doesn't like.

cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: POST problem trying to login (Weather example)
« Reply #4 on: May 03, 2010, 03:04:23 AM »
Thanks Bruce, you are right, it is working with the demo app.
I´ve been trying with the Weather example to learn and locate the cookies and fields but when I post with it the return page does not change.
Using the demo app it works ok!
Thanks
-----------
Regards
Alberto

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: POST problem trying to login (Weather example)
« Reply #5 on: August 18, 2010, 04:02:10 AM »
Bruce,
I´m trying to logging in the following page:
http://www.bolsar.com/net/principal/contenido.aspx
Usuario: IRSA
Clave: 4752075

I´ve folowed your steps, using NetDemo, did a get, obtain the cookies, locate the input fields looking at the page source code and did a post using the cookies and:

_ctl10:txtUsuario=IRSA&_ctl10:txtPassword=4752075

but the loggin fails. (if you set the Return Text Only and go down 4 pages on the ReturnData text you can see Usuario: Clave:, you should see something like Logout)

I´ve tried to get the browser post throught Fiddler but nothng happens, I run Fiddler, open the page, complete the user and pass fields, press "Entrar" (loggin) but nothing happens on fiddler.

Any idea?
Thanks
Alberto
-----------
Regards
Alberto

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Re: POST problem trying to login (Weather example)
« Reply #6 on: August 22, 2010, 09:08:25 AM »
Alberto, It looks off to me. Should there be a ? between the .txt and the Usuario?, like ".txt?Usuario".
Mike Grigsby
Credify Systems
Central Oregon, USA

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: POST problem trying to login (Weather example)
« Reply #7 on: August 22, 2010, 06:55:43 PM »
I didn't think : were valid