public async Task<CaptchaLoginResult> LoginAsync(string dbcUser, string dbcPass) { var task = Task<CaptchaLoginResult>.Factory.StartNew(() => { _dbcClient = new SocketClient(dbcUser, dbcPass) {Verbose = true}; try { var user = _dbcClient.User; var balance = GetBalance(); _eventAggregator.SendMessage(new BalanceRetrievedMessage(balance)); if (user.LoggedIn && !user.Banned) { return new CaptchaLoginResult(true); } _dbcClient = null; return new CaptchaLoginResult(false); } catch (System.Exception) { _dbcClient = null; return new CaptchaLoginResult(false); } }); return await task; }
private static async Task <SolvedCaptcha> CrackCaptcha(DeathByCaptcha.Client dbc_client, HttpClient client, string content) { var recaptcha_id = content.Split(new string[] { "Recaptcha.create(\"" }, StringSplitOptions.None)[1] .Split('\"')[0] .Trim(); var challenge_response = await client.GetStringAsync("https://www.google.com/recaptcha/api/challenge?k=" + recaptcha_id); Regex regexChallenge = new Regex("challenge : '(.*)'"); var match = regexChallenge.Match(challenge_response); if (!match.Success) { return(null); } var recaptcha_challenge = match.Groups[1].Value; var image_response = await client.GetByteArrayAsync("https://www.google.com/recaptcha/api/image?c=" + recaptcha_challenge); if (image_response == null) { return(null); } Captcha captcha = dbc_client.Decode(image_response); if (captcha.Solved && captcha.Correct) { SolvedCaptcha solved = new SolvedCaptcha(); solved.captcha = captcha; solved.challenge = recaptcha_challenge; return(solved); } else { return(null); } }
private static async Task <int> CreateAccounts(int refferalCount) { string[] emailDomains = { "@hotmail.com", "@ok.de", "@yahoo.com", "@yahoo.de", "@ymail.com", "@rocketmail.com", "@mail.ru", "@googlemail.com", "@gmail.de", "@outlook.com", "@hotmail.de", "@live.de", "@hotmail.com", "@t-online.de" }; OutputDebugString("Creating accounts[" + refferalCount.ToString() + "]"); DeathByCaptcha.Client dbc_client = (DeathByCaptcha.Client) new SocketClient("Username", "Password");; OutputDebugString("DBC Success!"); try { for (int i = 0; i < refferalCount; ++i) { retry: try { using (HttpClient client = new HttpClient()) using (HttpContent content = client.GetAsync(refLink).Result.Content) { bool created = false; while (!created) { string strContent = content.ReadAsStringAsync().Result; string username = Generate() + randomGenerator.Next(99).ToString(); string password = Generate() + randomGenerator.Next(10).ToString(); var captcha = CrackCaptcha(dbc_client, client, strContent).Result; string tokenKey = GetTokenKey(strContent); string tokenFields = GetTokenFields(strContent); var pairs = new List <KeyValuePair <string, string> > { new KeyValuePair <string, string>("_method", "POST"), new KeyValuePair <string, string>("data[_Token][key]", tokenKey), new KeyValuePair <string, string>("data[PvpnetAccount][name]", username), new KeyValuePair <string, string>("data[PvpnetAccount][password]", password), new KeyValuePair <string, string>("data[PvpnetAccount][confirm_password]", password), new KeyValuePair <string, string>("data[PvpnetAccount][email_address]", Generate() + emailDomains[randomGenerator.Next(0, emailDomains.Length)]), new KeyValuePair <string, string>("data[PvpnetAccount][date_of_birth_day]", randomGenerator.Next(1, 29).ToString()), new KeyValuePair <string, string>("data[PvpnetAccount][date_of_birth_month]", randomGenerator.Next(1, 13).ToString()), new KeyValuePair <string, string>("data[PvpnetAccount][date_of_birth_year]", randomGenerator.Next(1990, 1999).ToString()), new KeyValuePair <string, string>("data[PvpnetAccount][realm]", platform), new KeyValuePair <string, string>("data[PvpnetAccount][tou_agree]", "0"), new KeyValuePair <string, string>("data[PvpnetAccount][tou_agree]", "1"), new KeyValuePair <string, string>("data[PvpnetAccount][newsletter]", randomGenerator.Next(2).ToString()), new KeyValuePair <string, string>("recaptcha_response_field", captcha.captcha.Text), new KeyValuePair <string, string>("recaptcha_challenge_field", captcha.challenge), new KeyValuePair <string, string>("data[_Token][fields]", tokenFields), }; if (captcha != null) { OutputDebugString("CAPTCHA:" + captcha.captcha.Text); var postData = new FormUrlEncodedContent(pairs); repost: try { var response2 = client.PostAsync(new Uri("https://signup.leagueoflegends.com/de/signup/index"), postData).Result; var responseContent = response2.Content.ReadAsStringAsync().Result; //System.IO.File.WriteAllText("Reponse2.html", responseContent); if (!responseContent.Contains("Dein Konto wurde erstellt!")) { OutputDebugString("ACC: FAILED! -> " + username + ":" + password + ":" + captcha.captcha.Text); if (responseContent.Contains("The reCaptcha code was incorrect")) { dbc_client.Report(captcha.captcha); } } else { OutputDebugString(username + ":" + password); Console.WriteLine(username + ":" + password); created = true; } } catch (Exception e) { OutputDebugString("EXCEPTION____ : " + e.Message); } } } } } catch (Exception e) { OutputDebugString("EXCEPTION : " + e.Message); } } } catch (Exception e) { OutputDebugString("CreateAccounts() => " + e.Message); } return(1); }