コード例 #1
0
        private void checkBalanceButton_Click(object sender, RoutedEventArgs e)
        {
            // Save
            IOManager.SaveSettings(Globals.rlSettingsFile, Globals.rlSettings);

            double balance = 0;

            try
            {
                switch (Globals.rlSettings.Captchas.CurrentService)
                {
                case BlockCaptcha.CaptchaService.AntiCaptcha:
                    balance = new AntiCaptcha(Globals.rlSettings.Captchas.AntiCapToken, 0).GetBalance();
                    break;

                case BlockCaptcha.CaptchaService.DBC:
                    balance = new DeathByCaptcha(Globals.rlSettings.Captchas.DBCUser, Globals.rlSettings.Captchas.DBCPass, 0).GetBalance();
                    break;

                case BlockCaptcha.CaptchaService.DeCaptcher:
                    balance = new DeCaptcher(Globals.rlSettings.Captchas.DCUser, Globals.rlSettings.Captchas.DCPass, 0).GetBalance();
                    break;

                case BlockCaptcha.CaptchaService.ImageTypers:
                    balance = new ImageTyperz(Globals.rlSettings.Captchas.ImageTypToken, 0).GetBalance();
                    break;

                case BlockCaptcha.CaptchaService.TwoCaptcha:
                    balance = new TwoCaptcha(Globals.rlSettings.Captchas.TwoCapToken, 0).GetBalance();
                    break;

                case BlockCaptcha.CaptchaService.RuCaptcha:
                    balance = new RuCaptcha(Globals.rlSettings.Captchas.RuCapToken, 0).GetBalance();
                    break;

                case BlockCaptcha.CaptchaService.AZCaptcha:
                    balance = new AZCaptcha(Globals.rlSettings.Captchas.AZCapToken, 0).GetBalance();
                    break;

                case BlockCaptcha.CaptchaService.SolveRecaptcha:
                    balance = new SolveReCaptcha(Globals.rlSettings.Captchas.SRUserId, Globals.rlSettings.Captchas.SRToken, 0).GetBalance();
                    break;

                case BlockCaptcha.CaptchaService.CaptchasIO:
                    balance = new CaptchasIO(Globals.rlSettings.Captchas.CIOToken, 0).GetBalance();
                    break;

                default:
                    balance = 999;
                    break;
                }
            }
            catch { balanceLabel.Content = "WRONG TOKEN / CREDENTIALS"; balanceLabel.Foreground = Globals.GetBrush("ForegroundBad"); return; }

            balanceLabel.Content    = balance;
            balanceLabel.Foreground = balance > 0 ? Globals.GetBrush("ForegroundGood") : Globals.GetBrush("ForegroundBad");
        }
コード例 #2
0
        private static ICaptchaModule GetService(string serviceName)
        {
            ICaptchaModule service;

            switch (serviceName)
            {
            case Services.RuCaptcha:
                service = new RuCaptcha(GetServiceKey(serviceName));
                break;

//                case AntiCaptcha:
//                    serviceObj = new AntiCaptcha(GetServiceKey(serviceName));;
//                    break;
            default:
                throw new Exception("Неизвестное имя сервиса разгадки капчи.");
            }

            return(service);
        }
コード例 #3
0
        /// <inheritdoc />
        public override void Process(BotData data)
        {
            if (!data.GlobalSettings.Captchas.BypassBalanceCheck)
            {
                base.Process(data);
            }

            data.Log(new LogEntry("Solving reCaptcha...", Colors.White));

            string recapResponse = "";

            CaptchaServices.CaptchaService service = null;

            var cs = data.GlobalSettings.Captchas;

            switch (cs.CurrentService)
            {
            case CaptchaService.ImageTypers:
                service = new ImageTyperz(cs.ImageTypToken, cs.Timeout);
                break;

            case CaptchaService.AntiCaptcha:
                service = new AntiCaptcha(cs.AntiCapToken, cs.Timeout);
                break;

            case CaptchaService.DBC:
                service = new DeathByCaptcha(cs.DBCUser, cs.DBCPass, cs.Timeout);
                break;

            case CaptchaService.TwoCaptcha:
                service = new TwoCaptcha(cs.TwoCapToken, cs.Timeout);
                break;

            case CaptchaService.RuCaptcha:
                service = new RuCaptcha(cs.RuCapToken, cs.Timeout);
                break;

            case CaptchaService.DeCaptcher:
                service = new DeCaptcher(cs.DCUser, cs.DCPass, cs.Timeout);
                break;

            case CaptchaService.AZCaptcha:
                service = new AZCaptcha(cs.AZCapToken, cs.Timeout);
                break;

            case CaptchaService.SolveRecaptcha:
                service = new SolveReCaptcha(cs.SRUserId, cs.SRToken, cs.Timeout);
                break;

            case CaptchaService.CaptchasIO:
                service = new CaptchasIO(cs.CIOToken, cs.Timeout);
                break;

            case CaptchaService.CustomTwoCaptcha:
                service = new CustomTwoCaptcha(cs.CustomTwoCapToken, cs.CustomTwoCapDomain, cs.CustomTwoCapPort, cs.Timeout);
                break;

            default:
                throw new Exception("This service cannot solve reCaptchas!");
            }
            recapResponse = service.SolveRecaptcha(siteKey, ReplaceValues(url, data));

            data.Log(recapResponse == "" ? new LogEntry("Couldn't get a reCaptcha response from the service", Colors.Tomato) : new LogEntry("Succesfully got the response: " + recapResponse, Colors.GreenYellow));
            if (VariableName != "")
            {
                data.Log(new LogEntry("Response stored in variable: " + variableName, Colors.White));
                data.Variables.Set(new CVar(variableName, recapResponse));
            }
        }
コード例 #4
0
        /// <inheritdoc />
        public override void Process(BotData data)
        {
            if (!data.GlobalSettings.Captchas.BypassBalanceCheck)
            {
                base.Process(data);
            }

            var localUrl = ReplaceValues(url, data);

            data.Log(new LogEntry("Downloading image...", Colors.White));

            // Download captcha
            var captchaFile = string.Format("Captchas/captcha{0}.jpg", data.BotNumber);

            if (base64)
            {
                var bytes = Convert.FromBase64String(localUrl);
                using (var imageFile = new FileStream(captchaFile, FileMode.Create))
                {
                    imageFile.Write(bytes, 0, bytes.Length);
                    imageFile.Flush();
                }
            }
            else if (sendScreenshot && data.Screenshots.Count > 0)
            {
                Bitmap image = new Bitmap(data.Screenshots.Last());
                image.Save(captchaFile);
            }
            else
            {
                try
                {
                    DownloadRemoteImageFile(captchaFile, data, localUrl);
                }
                catch (Exception ex) { data.Log(new LogEntry(ex.Message, Colors.Tomato)); throw; }
            }

            string response = "";

            CaptchaServices.CaptchaService service = null;
            var bitmap = new Bitmap(captchaFile);

            try
            {
                switch (data.GlobalSettings.Captchas.CurrentService)
                {
                case CaptchaService.ImageTypers:
                    service = new ImageTyperz(data.GlobalSettings.Captchas.ImageTypToken, data.GlobalSettings.Captchas.Timeout);
                    break;

                case CaptchaService.AntiCaptcha:
                    service = new AntiCaptcha(data.GlobalSettings.Captchas.AntiCapToken, data.GlobalSettings.Captchas.Timeout);
                    break;

                case CaptchaService.DBC:
                    service = new DeathByCaptcha(data.GlobalSettings.Captchas.DBCUser, data.GlobalSettings.Captchas.DBCPass, data.GlobalSettings.Captchas.Timeout);
                    break;

                case CaptchaService.TwoCaptcha:
                    service = new TwoCaptcha(data.GlobalSettings.Captchas.TwoCapToken, data.GlobalSettings.Captchas.Timeout);
                    break;

                case CaptchaService.RuCaptcha:
                    service = new RuCaptcha(data.GlobalSettings.Captchas.RuCapToken, data.GlobalSettings.Captchas.Timeout);
                    break;

                case CaptchaService.DeCaptcher:
                    service = new DeCaptcher(data.GlobalSettings.Captchas.DCUser, data.GlobalSettings.Captchas.DCPass, data.GlobalSettings.Captchas.Timeout);
                    break;

                case CaptchaService.AZCaptcha:
                    service = new AZCaptcha(data.GlobalSettings.Captchas.AZCapToken, data.GlobalSettings.Captchas.Timeout);
                    break;

                case CaptchaService.CaptchasIO:
                    service = new CaptchasIO(data.GlobalSettings.Captchas.CIOToken, data.GlobalSettings.Captchas.Timeout);
                    break;

                default:
                    throw new Exception("This service cannot solve normal captchas!");
                }
                response = service.SolveCaptcha(bitmap);
            }
            catch (Exception ex) { data.Log(new LogEntry(ex.Message, Colors.Tomato)); throw; }
            finally { bitmap.Dispose(); }

            data.CaptchaService = service;
            data.Log(response == "" ? new LogEntry("Couldn't get a response from the service", Colors.Tomato) : new LogEntry("Succesfully got the response: " + response, Colors.GreenYellow));

            if (VariableName != "")
            {
                data.Log(new LogEntry("Response stored in variable: " + variableName, Colors.White));
                data.Variables.Set(new CVar(variableName, response));
            }
        }
コード例 #5
0
        public bool OpenRegistration(AccIua acc)
        {
            acc.StatusText = "Открытие страницы";
Start:
            goToMainPage();
            goToRegisterPage();
            setLogin(acc.Login);
            //checkLoginErrors
            if (!checkLoginErrors())
            {
                acc.ChangeLogin();
                goto Start;
            }
            //domen
            setDomen(acc.Domen);
            //password
            setPasswords(acc.Password);
            //recaptcha
            try
            {
                RuCaptcha.SolveRecaptcha(settingsDB.RuCaptchaApiKey, acc, driver);
            }
            catch (Exception ex)
            {
                goto Start;
            }
            //submit
            clickSubmitButton();
            Thread.Sleep(1000);
            //тут проверить перешло ли на следующую страницу
            if (!Check2pageIua())
            {
                string errorStr = GetErrorStr1();
                //Регистрация временно не доступна. Попробуйте позже.
                goto Start;
            }
            //firstName
            setFirstName(acc.FirstName);
            //LastName
            setLastName(acc.LastName);
            //sex
            setSex(acc.Sex);
            //day
            setDay(acc.DateBirth.Day);
            //month
            setMonth(acc.DateBirth.Month);
            //year
            setYear(acc.DateBirth.Year);
            //country
            setCountry(acc.Country);
            //city
            setCity(acc.City);
            //agree
            setAgree();
            //quest
            setSecretQuestion(acc.SecretQuestion);
            //answer
            setAnswer(acc.Answer);
            //submit
            clickSubmitButton2();
            if (!Check3PageIua())
            {
            }
            using (RegBase regBase = new RegBase())
            {
                var citysId           = regBase.citys.Where(x => x.value.Equals(acc.City)).First().id;
                var countryId         = regBase.countrys.Where(x => x.value.Equals(acc.Country)).First().id;
                var domenId           = regBase.i_ua_domen_names.Where(x => x.value.Equals(acc.Domen)).First().id;
                var secretQuestion_id = regBase.secret_questions.Where(x => x.value.Equals(acc.SecretQuestion)).First().id;
                var sexId             = (int)acc.Sex;
                var accDb             = new i_ua_accs()
                {
                    answer             = acc.Answer,
                    citys_id           = citysId,
                    country_id         = countryId,
                    date_birth         = acc.DateBirth,
                    date_registered    = DateTime.Now,
                    domen_id           = domenId,
                    first_name         = acc.FirstName,
                    last_name          = acc.LastName,
                    login              = acc.Login,
                    password           = acc.Password,
                    secret_question_id = secretQuestion_id,
                    sex_id             = sexId,
                };
                regBase.i_ua_accs.Add(accDb);
                regBase.SaveChanges();
                driver.Close();
                acc.StatusText = "Зарегистрировано";
            }
            return(true);
        }