lordshoa Posted July 18, 2012 Share Posted July 18, 2012 I am trying to login to a site with curl but not having much luck. The page keep timing out so I do not get anything returned. I need help with the postdata fields I think I have __VIEWSTATE __EVENTVALIDATION added to the postdata urlencoded Could some one help me out with the postdata the form imputs are below and the post data sent. <form method="post" action="https://example.com/default.aspx?country=16&&CultureCode=&local_url=&MPSearchId=&Culture=en-GB&co=" id="LOGIN_FORM"> <input id="__VIEWSTATE" name="__VIEWSTATE"> <input id="__EVENTVALIDATION" name="__EVENTVALIDATION"> <input id="txID" name="txID" maxlength="10"> <input id="txUserName" name="txUserName" maxlength="120"> <input id="txDupPassword" name="txDupPassword" maxlength="20"> <input id="txPassword" name="txPassword" maxlength="30"> <input id="btImgSubmit" name="btImgSubmit"> <input id="btSubmit" name="btSubmit"> <input id="btReset" name="btReset"> <input name="Session_ID"> <input name="sessionid"> <input name="errorCode"> <input id="hdSavedSearch" name="hdSavedSearch"> <input id="hdProdIds" name="hdProdIds"> <input id="hdMPSearchId" name="hdMPSearchId"> <input id="hdDisplaytype" name="hdDisplaytype"> <input id="hdMode" name="hdMode"> <input id="hdProductid" name="hdProductid"> <input id="hdQuantity" name="hdQuantity"> <input id="hdBanner" name="hdBanner"> <input id="co" name="co"> Posted code from headers POST /default.aspx?country=16&CultureCode=&local_url=&MPSearchId=&Culture=en-GB&cos= __VIEWSTATE=%2FOcAW0Gb3VZeNCu0Pyb6A%3D%3D&__EVENTVALIDATION=%2FwEWEQKelJO2DQKs&txID=12345678&txUserName=testuser&txDupPassword=Pass&txPassword=1234567890&btSubmit=LOG+IN&Session_ID=&sessionid=&errorCode=&hdSavedSearch=&hdProdIds=&hdMPSearchId=&hdDisplaytype=&hdMode=&hdProductid=&hdQuantity=&hdBanner=&co= Quote Link to comment Share on other sites More sharing options...
lordshoa Posted July 18, 2012 Author Share Posted July 18, 2012 I have found the issue but need help on it please. * Connected to example.com (0.111.35.71) port 443 (#1) * Unknown SSL protocol error in connection to example.com:443 * Closing connection #1 * Closing connection #0 Quote Link to comment Share on other sites More sharing options...
lordshoa Posted July 18, 2012 Author Share Posted July 18, 2012 OK a little bit further on now but back to square one postdata is not working right as I cannot login, cookie file not getting data added. Should it be rawurlencode instead of urlencode tried both? Quote Link to comment Share on other sites More sharing options...
lordshoa Posted July 18, 2012 Author Share Posted July 18, 2012 Bit more info may help you to help me > POST /default.aspx HTTP/1.1 Host: example.com Accept: */* Accept-Encoding: deflate, gzip Content-Length: 1863 Content-Type: application/x-www-form-urlencoded Expect: 100-continue < HTTP/1.1 100 Continue < HTTP/1.1 302 Found <============= thsis line does not look good but why 302 ? < Date: Wed, 18 Jul 2012 15:28:33 GMT < Server: Microsoft-IIS/6.0 < P3P: CP="CAO PSA OUR" < SRV: 33 < X-Powered-By: ASP.NET < X-AspNet-Version: 4.0.30319 < Location: http://example.com/Error/ErrorPage.aspx?aspxerrorpath=/default.aspx < Cache-Control: private < Content-Type: text/html; charset=utf-8 < Content-Length: 193 * HTTP error before end of send, stop sending < Quote Link to comment Share on other sites More sharing options...
lordshoa Posted July 19, 2012 Author Share Posted July 19, 2012 Looks like I am all alone on this one Ok I got the page sort of working now but I am missing the values for the cookies they are not being set. Any Ideas why they are not getting set ? They are being posted ??? < HTTP/1.1 100 Continue < HTTP/1.1 200 OK < Date: Thu, 19 Jul 2012 16:07:21 GMT < Server: Microsoft-IIS/6.0 < P3P: CP="CAO OUR" < SRV: 30 < X-Powered-By: ASP.NET < X-AspNet-Version: 4.0 * Added cookie Culture_12="en-GB" for domain example.com, path /, expire 1343232441 < Set-Cookie: Culture_12=en-GB; expires=Wed, 25-Jul-2012 16:07:21 GMT; path=/ * Added cookie CustomID="" for domain example.com, path /, expire 1345392441 < Set-Cookie: CustomID=; expires=Sun, 19-Aug-2012 16:07:21 GMT; path=/ * Added cookie UserLogin="" for domain example.com, path /, expire 1345392441 < Set-Cookie: UserLogin=; expires=Sun, 19-Aug-2012 16:07:21 GMT; path=/ < Cache-Control: private < Content-Type: text/html; charset=utf-8 < Content-Length: 18492 Quote Link to comment Share on other sites More sharing options...
xyph Posted July 19, 2012 Share Posted July 19, 2012 It's really hard to say without knowing the site you're trying to connect to. They could have implemented measures to deter cURL access. Quote Link to comment Share on other sites More sharing options...
lordshoa Posted July 19, 2012 Author Share Posted July 19, 2012 The problem is I do not want to post the url because I do not want them to find out and i cannot modify the posts after becuase they are not allowed to be changed, So are left for everyone to view. Quote Link to comment Share on other sites More sharing options...
Jessica Posted July 19, 2012 Share Posted July 19, 2012 If you're accessing a website in this method and you don't want them to find out, you're probably breaking their rules. Not something we are going to help with. Quote Link to comment Share on other sites More sharing options...
lordshoa Posted July 19, 2012 Author Share Posted July 19, 2012 Then do not help that is your choice but do not post rubbish in my thread Quote Link to comment Share on other sites More sharing options...
xyph Posted July 19, 2012 Share Posted July 19, 2012 It's not rubbish, it's logic. We aren't here to help you bypass something other developers have implemented. In many countries, it's illegal. Quote Link to comment Share on other sites More sharing options...
lordshoa Posted July 25, 2012 Author Share Posted July 25, 2012 Its ok I have cracked it myself I added a post var that was not needed. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.