Results 1 to 4 of 4

Thread: ASP .NET - POST request method

  1. #1
    Join Date
    Mar 2009
    Posts
    29
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default ASP .NET - POST request method

    Hi everybody,
    I need help with creating correct POST request to website working with ASP .NET.
    May begin that my request was contructed by using sniffer results.
    Here it is:
    Qt Code:
    1. request.setRawHeader("Origin:","http://www.md5decrypter.co.uk");
    2. request.setRawHeader("X-Requested-With:","XMLHttpRequest");
    3. request.setRawHeader("Cache-Control:","no-cache");
    4. request.setRawHeader("X-MicrosoftAjax:","Delta=true");
    5. request.setRawHeader("Accept:","*/*");
    6. request.setRawHeader("Referer:","http://www.md5decrypter.co.uk/sha1-decrypt.aspx");
    7. request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded; charset=UTF-8");
    8. request.setRawHeader("Accept-Language:","pl-PL,pl;q=0.8,en-US;q=0.6,en;q=0.4");
    9. request.setRawHeader("Accept-Charset:","ISO-8859-2,utf-8;q=0.7,*;q=0.3");
    10.  
    11. postData.addQueryItem("ctl00$ScriptManager1", "ctl00$MainContent$btnDecrypt");
    12. postData.addQueryItem("ctl00$MainContent$txtHashes", "f41b59b297ded4f90ba61ee3c5ff18220ae55c66");
    13. postData.addQueryItem("ctl00$MainContent$txtCaptcha", sCaptcha);
    14. //postData.addQueryItem("__EVENTTARGET", "ctl00$MainContent$btnDecrypt");
    15. //postData.addQueryItem("__VIEWSTATE", sViewState);
    16. postData.addQueryItem("__EVENTVALIDATION", sEventValidation);
    17. postData.addQueryItem("__ASYNCPOST", "true");
    To copy to clipboard, switch view to plain text mode 

    Unfortunately, I don't receive satisfying outcome. Also, can't understand why in case of sending __EVENTTARGET or __VIEWSTATE, getting this kind of error:
    Qt Code:
    1. 1|#||4|52|pageRedirect||%2ferror.aspx%3faspxerrorpath%3d%2fsha1-decrypt.aspx|
    To copy to clipboard, switch view to plain text mode 
    I can add that my app in the first place, download __VIEWSTATE and __EVENTVALIDATION after connection to website.
    Where can be a problem, and why it happen so as above.

    Thanks in advance,
    Trok
    Last edited by Trok; 5th October 2011 at 15:34.

  2. #2
    Join Date
    Feb 2011
    Location
    Bangalore
    Posts
    207
    Thanks
    20
    Thanked 28 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: ASP .NET - POST request method

    ViewState is microsoft proprietary infrastructure to manage state in http. It is Base64 encoded, and uses hashes to identify events on client side. Whatever, be the case, it is not documented because it wasn't meant to be by Microsoft. I don't think you can use this forum for help in reverse engineering it.
    Also, they can and will change it as and when they want. Your code, even after doing RE can die tomorrow. If you happen to have the code for server side, modify the code to use only the http controls if you must. Hacking viewstate is not a good idea in my opinion.
    HTH

  3. The following user says thank you to pkj for this useful post:

    Trok (5th October 2011)

  4. #3
    Join Date
    Mar 2009
    Posts
    29
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: ASP .NET - POST request method

    So, is there any possibility to send good working request to this page without ViewState? Every time i get all page source without result of current action (decrypt hash). I still don't understand why this code doesn't work correct.
    Thanks in advance.

  5. #4
    Join Date
    Feb 2011
    Location
    Bangalore
    Posts
    207
    Thanks
    20
    Thanked 28 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: ASP .NET - POST request method

    Are you the one requesting the page and sending the postback? Or are you trying to sniff poor Bob's page and send postback, or tricking poor Bob to make a request passing in your viewstate. In both cases it won't work. There is a ViewStateUserKey exactly to discourage this and used to salt the hash.
    If you do have asp.net you can explicitly set viewstate off for each control. There is no way that as a client you can request a viewstate less page.
    Moreover Trok, This is not the right forum for a asp.net question.

Similar Threads

  1. HTTP request POST in QT application
    By abdul_moiz in forum Newbie
    Replies: 5
    Last Post: 24th June 2011, 03:48
  2. Request ID of QNetworkaccessmanager get and post request
    By dineshkumar in forum Qt Programming
    Replies: 2
    Last Post: 4th February 2011, 21:56
  3. POST request to a web service
    By QPlace in forum Qt Programming
    Replies: 3
    Last Post: 6th November 2008, 08:05
  4. Https POST Request
    By munna in forum Qt Programming
    Replies: 10
    Last Post: 11th November 2006, 14:24
  5. Qhttp::request(...) method and GET request
    By mikhailt in forum Qt Programming
    Replies: 4
    Last Post: 15th September 2006, 12:26

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.