Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. public void GetReCaptcha(string url, string siteKey, string addName, string recaptchaframe_url)
  2. {
  3. // get pageHtml
  4. WebBrowser wb = new WebBrowser();
  5. wb.ScrollBarsEnabled = false;
  6. wb.ScriptErrorsSuppressed = true;
  7.  
  8. wb.Navigate("http://oneadfaucet.com/googlebibi.php?st=1");
  9. while (wb.ReadyState != WebBrowserReadyState.Complete)
  10. {
  11. Application.DoEvents();
  12. }
  13. Uri googleurl = new Uri("http://oneadfaucet.com/googlebibi.php?st=1");
  14. cookieJar.SetCookies(googleurl, wb.Document.Cookie);
  15. string pageHtml = get(recaptchaframe_url);
  16.  
  17. try
  18. {
  19.  
  20.  
  21.  
  22. string challengeimageurl = GetBetween(pageHtml, "<img class="fbc-imageselect-payload" src="", """);
  23. HttpWebRequest request = (HttpWebRequest)WebRequest.Create(challengeimageurl);
  24.  
  25. request.Referer = recaptchaframe_url;
  26. request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
  27. request.Headers.Add(HttpRequestHeader.AcceptEncoding, "gzip,deflate");
  28. request.Headers.Add(HttpRequestHeader.AcceptLanguage, "en-us;en;q=0.5");
  29. request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)";
  30. request.CookieContainer = this.cookieJar;
  31.  
  32. WebResponse response = request.GetResponse();
  33. Stream recaptcha_stream = response.GetResponseStream();
  34. response_headers = response.Headers;
  35.  
  36.  
  37. }
  38. catch (WebException exception)
  39. {
  40. MessageBox.Show("The program was unable to download the CAPTCHA: " + exception.Message);
  41. }
  42. //update captcha image
  43.  
  44. Form1.DefaultInstance.picCaptcha.Image = Image.FromStream(recaptcha_stream);
  45. Form1.DefaultInstance.picCaptcha.Refresh();
  46.  
  47.  
  48.  
  49. // wait for captcha image click
  50. while (Form1.DefaultInstance.waitForClickCap)
  51. {
  52. Application.DoEvents();
  53. }
  54. // loop through responses and add to request data
  55. string recaptcharesponse = null;
  56. foreach (string capresponse in Microsoft.VisualBasic.Strings.Split(Form1.DefaultInstance.txtCaptcha.Text, ", ", -1, Microsoft.VisualBasic.CompareMethod.Binary))
  57. {
  58. // add each selected images to the checked boxes.
  59. recaptcharesponse = recaptcharesponse + "fbc-imageselect-checkbox-" + capresponse;
  60.  
  61. }
  62.  
  63. pageHtml = post(url, url, "address=" + Form1.DefaultInstance.txtAdd.Text + "&honeypot=checked&" + addName + "=" + addName + "&" + recaptcharesponse);
  64. }
  65.  
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement