Bot-Factory 602 Posted May 1, 2014 Report Share Posted May 1, 2014 Hello. I try to create a define to signup to www.xing.com Here is the http communication:POST https://www.xing.com/app/signup HTTP/1.1Accept: text/javascript, text/html, application/xml, text/xml, */*Origin: https://www.xing.comX-Requested-With: XMLHttpRequestUser-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36Content-Type: application/x-www-form-urlencoded; charset=UTF-8Referer: https://www.xing.com/Accept-Encoding: gzip,deflate,sdchAccept-Language: de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4Cookie: s_sq=xingcomprod%3D%2526pid%253Dlo%25252Fstart%25252Findexpage%2526pidt%253D1%2526oid%253DKostenlos%252520registrieren%2526oidt%253D3%2526ot%253DSUBMITHost: www.xing.comContent-Length: 195Connection: Keep-Alive op=minireg_validate&captcha_secret=&logged_out_sid=f4491e7545f2a2cc116f3e4f83c73a40&source_url=&first_name=Komalpreetasd&last_name=asdasdas&email=dasdasdasdasdhuiaiusdh%40gmail.com&tandc_check=on The response:HTTP/1.1 200 OKCache-Control: privatePragma: no-cacheExpires: NowVary: Accept-EncodingContent-Type: application/jsonX-UA-Compatible: IE=edgeX-XSS-Protection: 1; mode=block; report=https://www.xing.com/tools/xss_reporterDate: Thu, 01 May 2014 23:15:29 GMTContent-Length: 131Connection: keep-aliveSet-Cookie: c_=0x7C4A3DA0D18611E3A84D778999B42FC2; domain=.xing.com; path=/; expires=Thu Apr 27 01:15:29 2034; HttpOnlySet-Cookie: dtCookie=|XING-GROWTH|0; Path=/; Domain=.xing.com ({"captcha_required":1,"success":0,"email":"Mit dieser E-Mail-Adresse ist bereits ein Mitglied registriert.","inputFocus":"email"}) Here is my Ubot code: set(#get, $plugin function("HTTP post.dll", "$http get", "https://www.xing.com/", "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36", "", "", 20), "Global") set(#loggedoutsid, $plugin function("HTTP post.dll", "$xpath parser index", #get, "//input[@name=\'logged_out_sid\']", 0, "value"), "Global") set(#firstname, "Komalpreetasd", "Global") set(#lastname, "asdasdas", "Global") set(#email, "dasdasdasdasdhuiaiusdh%40gmail.com", "Global") set(#password, "MeinPasswort", "Global") set(#post, $plugin function("HTTP post.dll", "$http post", "https://www.xing.com/app/signup", "op=minireg_validate&captcha_secret=&logged_out_sid={#loggedoutsid}&source_url=&first_name={#firstname}&last_name={#lastname}&email={#email}&password={#password}&tandc_check=on", "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36", "https://www.xing.com/", "", 20), "Global") load html(#post) This is the HTTP Post the ubot code generates:POST https://www.xing.com/app/signup HTTP/1.1User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36Referer: https://www.xing.com/Accept-Encoding: gzip,deflateAccept-Charset: ISO-8859-1,utf-8;q=0.7,*; q=0.7Content-Type: application/x-www-form-urlencodedHost: www.xing.comCookie: dtCookie=|XING|0Content-Length: 217 op=minireg_validate&captcha_secret=&logged_out_sid=33c54625535873eb31e7db0232853cfb&source_url=&first_name=Komalpreetasd&last_name=asdasdas&email=dasdasdasdasdhuiaiusdh%40gmail.com&password=MeinPasswort&tandc_check=on But it's not working. I have it working in C#: private void MakeRequests(){HttpWebResponse response; if (Request_www_xing_com(out response)){response.Close();}} private bool Request_www_xing_com(out HttpWebResponse response){response = null; try{HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://www.xing.com/app/signup"); request.KeepAlive = true;request.Accept = "text/javascript, text/html, application/xml, text/xml, */*";request.Headers.Add("Origin", @"https://www.xing.com");request.Headers.Add("X-Requested-With", @"XMLHttpRequest");request.UserAgent = "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36";request.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";request.Referer = "https://www.xing.com/";request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip,deflate,sdch");request.Headers.Set(HttpRequestHeader.AcceptLanguage, "de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4"); request.Method = "POST";request.ServicePoint.Expect100Continue = false; string body = @"op=minireg_validate&captcha_secret=&logged_out_sid=f4491e7545f2a2cc116f3e4f83c73a40&source_url=&first_name=Komalpreetasd&last_name=asdasdas&email=dasdasdasdasdhuiaiusdh%40gmail.com&tandc_check=on";byte[] postBytes = System.Text.Encoding.UTF8.GetBytes(body);request.ContentLength = postBytes.Length;Stream stream = request.GetRequestStream();stream.Write(postBytes, 0, postBytes.Length);stream.Close(); response = (HttpWebResponse)request.GetResponse();}catch (WebException e){if (e.Status == WebExceptionStatus.ProtocolError) response = (HttpWebResponse)e.Response;else return false;}catch (Exception){if(response != null) response.Close();return false;} return true;} Would be great if someone has an idea what I'm missing in the ubot code? Thanks in advance for your helpDan Quote Link to post Share on other sites
orbital 15 Posted April 19, 2015 Report Share Posted April 19, 2015 One thing I see is that you are missing the accept-language header. I can't figure out a way to set that in ubot using aymens plugin. When I do : plugin command("HTTP post.dll", "http set headers", "Accept-Language", "en-US,en;q=0.8") It doesn't get set and if I do: plugin command("HTTP post.dll", "http set headers", "Accept Language", "en-US,en;q=0.8") Without the hyphen, it throws an error when ran. Quote Link to post Share on other sites
Bot-Factory 602 Posted April 19, 2015 Author Report Share Posted April 19, 2015 That thread is 1 year old... The issue was fixed a long time ago :-) Quote Link to post Share on other sites
ibins 0 Posted June 19, 2023 Report Share Posted June 19, 2023 On 4/19/2015 at 10:20 PM, Bot-Factory said: That thread is 1 year old... The issue was fixed a long time ago :-) Having the same issue at moment, i have set it, nevertheless it doesn't arrive. Going through a proxy, it does get sent on each of the previous and following requests, but not at this request: http upload. instead of the accept-language i'll get this: Accept-Charset: ISO-8859-1,utf-8;q=0.7,*; q=0.7 Already tried many things up down, left right, add some, remove some, my current request looks like plugin command("HTTP post.dll", "http clear headers") plugin command("HTTP post.dll", "http settings headers", "Content Type", $nothing) plugin command("HTTP post.dll", "http set headers", "Accept", "application/json;format=camelcase") plugin command("HTTP post.dll", "http set headers", "Accept-Language", "en-US,en;q=0.5") plugin command("HTTP post.dll", "http set headers", "Accept-Encoding", "gzip;q=0,deflate") plugin command("HTTP post.dll", "http set headers", "Origin", "https://www.somesite.com") plugin command("HTTP post.dll", "http settings headers", "Host", "www.somesite.com") plugin command("HTTP post.dll", "http set headers", "X-CSRF", #xcsrftoken) plugin command("HTTP post.dll", "http set headers", "Authorization", "Bearer {#apitoken}") plugin command("HTTP post.dll", "http settings headers", "Content-Type", "multipart/form-data;") plugin command("HTTP post.dll", "http settings headers", "Content-Disposition", #content) set(#json,$plugin function("HTTP post.dll", "$http upload", "https://www.somesite.com/...", #not, #uplolol, "file", #ft, #ua, "https://www.somesite.com/...", #prx, #utimeout),"Local") which gives POST https://www.somesite.com HTTP/1.1 Content-Type: multipart/form-data; boundary=---------------------------bla User-Agent: bla Referer: https://www.somesite.com Accept-Encoding: gzip,deflate Upgrade-Insecure-Requests: 1 Authorization: Bearer bla Accept: application/json;format=camelcase Origin: https://www.somesite.com X-CSRF: bla.bla Accept-Charset: ISO-8859-1,utf-8;q=0.7,*; q=0.7 Host: www.somesite.com Cookie: sid=bla Content-Length: 14241532 -----------------------------bla Content-Disposition: form-data; name="file"; filename="C:\also_here_it_noted\the_full_path\but_i_\sent_only_the_filename\image.jpg" Content-Type: image/jpeg Will anybody remember what the solution was, after all this years? Many thanks in advance! cheers Quote Link to post Share on other sites
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.