- ALL FIXED
Yes I'm using a CookieContainer.Quote:
"doesn't seem to work" isn't a good error description.
Are you using a CookieContainer in your requests?
Also, please provide some more background information and code.
//Get reloadToken & RTVT
HttpWebRequest tokReq = (HttpWebRequest)HttpWebRequest.Create(marketUrl);
tokReq.CookieContainer = cookieContainer;
tokReq.Method = "GET";
tokReq.CachePolicy = noCachePolicy;
//Grabbing source
using (StreamReader sfreader = new StreamReader(tokReq.GetResponse().GetResponseStream()))
{
marketsource = sfreader.ReadToEnd();
}
//Regex pattern's for extracting the token and RTVT from marketsource
string tokenpattern = @"(?:reloadToken.+value="")(?<Token>[^\""]+)";
string rtvtpattern = @"(?:RTVT.+value=')(?<RTVT>[^']+)";
//Extracting reloadToken and RTVT from source
string reloadToken = Regex.Match(marketsource, tokenpattern).Groups["Token"].Value;
string RTVT = Regex.Match(marketsource, rtvtpattern).Groups["RTVT"].Value;
bidPostData = String.Format("reloadToken=" + reloadToken + "&setBid=true&ItemID=" + ItemID + "&ItemType=" + ItemType + "¤tSelecter=all&bidAmount=" + bidAmount + "&RTVT=" + RTVT + "&ajaxAction=biddOnItem");
HttpWebRequest bidrequest = (HttpWebRequest)HttpWebRequest.Create(bidUrl);
bidrequest.CookieContainer = cookieContainer;
bidrequest.Method = "POST";
bidrequest.CachePolicy = noCachePolicy;
bidrequest.KeepAlive = true;
bidrequest.ContentLength = bidPostData.Length;
bidrequest.ContentType = "application/x-www-form-urlencoded";
bidrequest.AllowAutoRedirect = true;
bidrequest.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36";
ASCIIEncoding encoding = new ASCIIEncoding();
byte[] loginDataBytes = encoding.GetBytes(bidPostData);
bidrequest.ContentLength = loginDataBytes.Length;
Stream stream = bidrequest.GetRequestStream();
stream.Write(loginDataBytes, 0, loginDataBytes.Length);
//response
HttpWebResponse bidResp = (HttpWebResponse)bidrequest.GetResponse();
Stream datastream = bidResp.GetResponseStream();
StreamReader reader = new StreamReader(datastream);
webBrowser1.DocumentText = reader.ReadToEnd();
reader.Close();
datastream.Close();
bidResp.Close();
POST http://gb1.seafight.bigpoint.com/ajax.es HTTP/1.1 Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36 Referer: http://gb1.seafight.bigpoint.com/index.es?action=internalMarketplace&subact=Elite Host: gb1.seafight.bigpoint.com Cookie: sfrfsid=7a567b395a76273607e13add6887de22; aid=901; bptid=cceb5f194b860dc4f792ec102427d07b; acr=14; aid_fallback=901; aid_fallback_info=935; bpLandingPage_fallback=http%253A%252F%252Fgb1.seafight.bigpoint.com%252FProjectApi%252FAuthentication%253FauthUser%253D14%2526token%253DY_oYkIFEOh5EB7r1yh7ojxu7ka4Ei1_ck27lbRxW93kgWO7B-ih5x7JsEnOb7zCGpGxEHoOvOaVsZ3AKrsa3sd5Zo--LXXbdmd1usLAnv56A_DjrvD6BTdxLfi1NWOQ5QlC4n9mrbRu8xa6hEzpVi21NPJQbSdm0T0Wm3E-djf-gia3U-Ytg3h-MxUSMlU1xWXa9PQ-EhDR39dB1AeOLCkh8T-fPLt47JOI-Oxb_3f4grz0mVnVbhHue0auuRO9BIoDABAWpo5q70IooOoVguDiyrrHyuGHsEbTVmz1fkWZ-Z4QztPVHyBxtl2LxJg1wCsmdlR9AeTGB1wJSn1FWxjE8i5pelPwtAMT9Ww83hffiToIqOKv0P9sDkgjat5Pj9FOHD3EVuqtGqJ9ricaDZOFfgbLY_Wq4nv_frlFbdy7iLksYAG8Imo8K7DxSMdQpR8Ii-d3JjBAEIvI4gRJ0nyRkQyX4aypnlBj4I6Kx-G3iG1pEUo013EryL7kqZiYF5J3ds_5zRWDGP__AGJrc-yrODjdGshoKARfnsybknpGR7omc3UAPYvkfsOvja5ih6YzYZzdPwdV0wBbhqXivTo0yF-I6smPmFBha7q4R0uY0DK_LDIF5Mz8FD0C6V5U8hcP31A_Q7UFO9pyVjOSawimY3ZX8_A2yTKNUp0pBIZQMlR5gZ7Mx Cache-Control: no-store,no-cache Pragma: no-cache Content-Length: 175 Expect: 100-continue reloadToken=20a1fb27da41888e1930bb6d7ddb5f29&setBid=true&ItemID=4&ItemType=Currency¤tSelecter=all&bidAmount=2&RTVT=main7ddf0bf139b71fed8529d09d7a77&ajaxAction=biddOnItem
POST http://gb1.seafight.bigpoint.com/ajax.es HTTP/1.1 Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36 Referer: http://gb1.seafight.bigpoint.com/index.es?action=internalMarketplace&subact=Elite Host: gb1.seafight.bigpoint.com Cookie: RTVTmain=mainf48cee3b6b15789f58299871ee15; sfrfsid=7a567b395a76273607e13add6887de22; aid=901; bptid=cceb5f194b860dc4f792ec102427d07b; acr=14; aid_fallback=901; aid_fallback_info=935; bpLandingPage_fallback=http%253A%252F%252Fgb1.seafight.bigpoint.com%252FProjectApi%252FAuthentication%253FauthUser%253D14%2526token%253DY_oYkIFEOh5EB7r1yh7ojxu7ka4Ei1_ck27lbRxW93kgWO7B-ih5x7JsEnOb7zCGpGxEHoOvOaVsZ3AKrsa3sd5Zo--LXXbdmd1usLAnv56A_DjrvD6BTdxLfi1NWOQ5QlC4n9mrbRu8xa6hEzpVi21NPJQbSdm0T0Wm3E-djf-gia3U-Ytg3h-MxUSMlU1xWXa9PQ-EhDR39dB1AeOLCkh8T-fPLt47JOI-Oxb_3f4grz0mVnVbhHue0auuRO9BIoDABAWpo5q70IooOoVguDiyrrHyuGHsEbTVmz1fkWZ-Z4QztPVHyBxtl2LxJg1wCsmdlR9AeTGB1wJSn1FWxjE8i5pelPwtAMT9Ww83hffiToIqOKv0P9sDkgjat5Pj9FOHD3EVuqtGqJ9ricaDZOFfgbLY_Wq4nv_frlFbdy7iLksYAG8Imo8K7DxSMdQpR8Ii-d3JjBAEIvI4gRJ0nyRkQyX4aypnlBj4I6Kx-G3iG1pEUo013EryL7kqZiYF5J3ds_5zRWDGP__AGJrc-yrODjdGshoKARfnsybknpGR7omc3UAPYvkfsOvja5ih6YzYZzdPwdV0wBbhqXivTo0yF-I6smPmFBha7q4R0uY0DK_LDIF5Mz8FD0C6V5U8hcP31A_Q7UFO9pyVjOSawimY3ZX8_A2yTKNUp0pBIZQMlR5gZ7Mx Cache-Control: no-store,no-cache Pragma: no-cache Content-Length: 179 Expect: 100-continue reloadToken=55459aec3b1fed39e3ca7e4ced2d3299&setBid=true&ItemID=186&ItemType=Ammunition¤tSelecter=all&bidAmount=2&RTVT=maind3b56784546e9dab704a7cf797cc&ajaxAction=biddOnItem
HTTP/1.1 200 OK
Date: Thu, 27 Nov 2014 20:44:00 GMT
Server: Apache
Set-Cookie: sfrfsid=7a567b395a76273607e13add6887de22; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
P3P: CP="CAO PSA OUR"
Set-Cookie: aid=901; expires=Sat, 27-Dec-2014 20:44:00 GMT; path=/
Set-Cookie: aip=deleted; expires=Wed, 27-Nov-2013 20:43:59 GMT; path=/
Set-Cookie: aig=deleted; expires=Wed, 27-Nov-2013 20:43:59 GMT; path=/
Set-Cookie: acr=14; expires=Sat, 27-Dec-2014 20:44:00 GMT; path=/
Set-Cookie: aid=901; expires=Sat, 27-Dec-2014 20:44:00 GMT; path=/
Set-Cookie: aip=deleted; expires=Wed, 27-Nov-2013 20:43:59 GMT; path=/
Set-Cookie: aig=deleted; expires=Wed, 27-Nov-2013 20:43:59 GMT; path=/
Set-Cookie: acr=14; expires=Sat, 27-Dec-2014 20:44:00 GMT; path=/
Set-Cookie: RTVTmain=mainf48cee3b6b15789f58299871ee15
Vary: Accept-Encoding,User-Agent
Content-Length: 1327
Content-Type: text/html; charset=UTF-8
Content-Language: es
X-XTM-Node: pool-seafight-01-www-034229
Connection: Close
{"crystals":"1","pearls":"3.000","gold":"20.617","reloadtoken":"4407ca4e3b28c03b28b87dd1539db48a","state":"OK","message":null,"output":"","divupdates":{"maxBidder_CURRENCY_4":"\u2020\u0e56\u06e3\u06dc\u2666\u02d9\u0387\u0660\u2022zz777\u2022\u0660\u0387\u02d9\u2666\u2020","maxBidder_SHIPEXTENSIONS_7":"BlackBaron","maxBidder_ACTIONITEMS_30":"DutchyHunter","maxBidder_ACTIONITEMS_38":"Mina-S.F.U..","maxBidder_ACTIONITEMS_43":"zoki_uk","maxBidder_SAILS_50":"Leopar.!","maxBidder_AMMUNITION_51":"Bawdyn","maxBidder_NONPERISHABLEGOODS_51":"DutchyHunter","maxBidder_SHIPEXTENSIONS_51":"=Marijuana61=","maxBidder_WEAPONS_51":"-CaptainTR-","maxBidder_NONPERISHABLEGOODS_52":"\u2020\u0e56\u06e3\u06dc\u2666\u02d9\u0387\u0660\u2022zz777\u2022\u0660\u0387\u02d9\u2666\u2020","maxBidder_NONPERISHABLEGOODS_65":"\u2020\u0e56\u06e3\u06dc\u2666\u02d9\u0387\u0660\u2022zz777\u2022\u0660\u0387\u02d9\u2666\u2020","maxBidder_HARPOONS_75":"zoki_uk","maxBidder_NONPERISHABLEGOODS_77":"swissblade","maxBidder_AMMUNITION_120":"\u2020\u0e56\u06e3\u06dc\u2666\u02d9\u0387\u0660\u2022zz777\u2022\u0660\u0387\u02d9\u2666\u2020","maxBidder_WEAPONS_121":"\u4e42_\u3024.\u0e56\u06e3\u06dc\u0158\u01b1\u0141\u0128\u0419\u0193.\u3024_\u4e42","maxBidder_AMMUNITION_186":"\u4e42_\u3024.\u0e56\u06e3\u06dc\u0158\u01b1\u0141\u0128\u0419\u0193.\u3024_\u4e42"}}
HTTP/1.1 200 OK
Date: Thu, 27 Nov 2014 20:44:06 GMT
Server: Apache
Set-Cookie: sfrfsid=7a567b395a76273607e13add6887de22; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
P3P: CP="CAO PSA OUR"
Set-Cookie: aid=901; expires=Sat, 27-Dec-2014 20:44:06 GMT; path=/
Set-Cookie: aip=deleted; expires=Wed, 27-Nov-2013 20:44:05 GMT; path=/
Set-Cookie: aig=deleted; expires=Wed, 27-Nov-2013 20:44:05 GMT; path=/
Set-Cookie: acr=14; expires=Sat, 27-Dec-2014 20:44:06 GMT; path=/
Set-Cookie: aid=901; expires=Sat, 27-Dec-2014 20:44:06 GMT; path=/
Set-Cookie: aip=deleted; expires=Wed, 27-Nov-2013 20:44:05 GMT; path=/
Set-Cookie: aig=deleted; expires=Wed, 27-Nov-2013 20:44:05 GMT; path=/
Set-Cookie: acr=14; expires=Sat, 27-Dec-2014 20:44:06 GMT; path=/
Set-Cookie: RTVTmain=main0607cd8ed5f93edb682b35d90762
Vary: Accept-Encoding,User-Agent
Content-Length: 1327
Content-Type: text/html; charset=UTF-8
Content-Language: es
X-XTM-Node: pool-seafight-01-www-042103
Connection: Close
{"crystals":"1","pearls":"3.000","gold":"20.617","reloadtoken":"672a14a2bbd096c8819a249699af6a3c","state":"OK","message":null,"output":"","divupdates":{"maxBidder_CURRENCY_4":"\u2020\u0e56\u06e3\u06dc\u2666\u02d9\u0387\u0660\u2022zz777\u2022\u0660\u0387\u02d9\u2666\u2020","maxBidder_SHIPEXTENSIONS_7":"BlackBaron","maxBidder_ACTIONITEMS_30":"DutchyHunter","maxBidder_ACTIONITEMS_38":"Mina-S.F.U..","maxBidder_ACTIONITEMS_43":"zoki_uk","maxBidder_SAILS_50":"Leopar.!","maxBidder_AMMUNITION_51":"Bawdyn","maxBidder_NONPERISHABLEGOODS_51":"DutchyHunter","maxBidder_SHIPEXTENSIONS_51":"=Marijuana61=","maxBidder_WEAPONS_51":"-CaptainTR-","maxBidder_NONPERISHABLEGOODS_52":"\u2020\u0e56\u06e3\u06dc\u2666\u02d9\u0387\u0660\u2022zz777\u2022\u0660\u0387\u02d9\u2666\u2020","maxBidder_NONPERISHABLEGOODS_65":"\u2020\u0e56\u06e3\u06dc\u2666\u02d9\u0387\u0660\u2022zz777\u2022\u0660\u0387\u02d9\u2666\u2020","maxBidder_HARPOONS_75":"zoki_uk","maxBidder_NONPERISHABLEGOODS_77":"swissblade","maxBidder_AMMUNITION_120":"\u2020\u0e56\u06e3\u06dc\u2666\u02d9\u0387\u0660\u2022zz777\u2022\u0660\u0387\u02d9\u2666\u2020","maxBidder_WEAPONS_121":"\u4e42_\u3024.\u0e56\u06e3\u06dc\u0158\u01b1\u0141\u0128\u0419\u0193.\u3024_\u4e42","maxBidder_AMMUNITION_186":"\u4e42_\u3024.\u0e56\u06e3\u06dc\u0158\u01b1\u0141\u0128\u0419\u0193.\u3024_\u4e42"}}
Hmm yes, you could be right in that, in the original page the request is made by javascript. So yes, the server sends new reloadTokens to the page ofcourse because it's javascript.Quote:
The reload tokens do not match. You are sending the request providing the token from an unknown source. Then, the server replies to this request and also provides a reload token in the response. You may need to send the token supplied by the server in the next request - otherwise the server may detect that you are not accessing the resource through a common webbrowser (since there is probably some javascript send on the first request that does the token handling)
This may also apply to other tokens or challenges.
<input name="reloadToken" value="f5b2374edb3c05b125b68907b1d604a4" type="hidden"> <input name="RTVT" value="main7bd97eca81fbfaaf44cc5b53f58a" type="hidden"></form>
<input name="reloadToken" value="4e4e777ad53c52366bd9261d5e3720d7" type="hidden"> <input name="RTVT" value="main7bd97eca81fbfaaf44cc5b53f58a" type="hidden">
<input name="reloadToken" value="194b401eee9d96bac4b956c5f0efba9c" type="hidden"> <input name="RTVT" value="mainaf2cd2ed44a3bfecf41ca6cc283d" type="hidden">