Hello
thank you for the help!
I send several quires to the target site.
first I send the URL of the home page.
The ASP.NET sites usually have the VIEWSTATE parameter value in the HTML source of the home page or the main search page:
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJLTk4NTIyOT...==" />
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEW.." />
I get the value of the VIEWSTATE and EVENTVALIDATION from the HTML source of the home page.
I use uri_escape() to substituted the signs / " with the right values (%2F,%3D etc.), and use these parameters to recreate the URL that the target site sends for a search.
The URL created looks something like this:
THE_HOST_NAME_URL?__EVENTTARGET=&__EVENTARGUMENT=
__VIEWSTATE=#THE_VIEW_STATE_PARAMETER#&THE_SEARCH_PARAMETERS&__EVENTVALIDATION=#THE_EVENT_VALIDATION_PARAMETER#
I send this URL in a POST method,and instead of getting the results page, I get an error page:
HttpException (0x80004005): Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +160
When I take the same URL and paste it in the Mozilla FireFox window, (its being sent in a GET method) I get to the results page.
Any ideas on how to avoid the error page received when using the POST method?
Thank you,
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.