Esempio n. 1
0
        static async Task Main(string[] args)
        {
            var captcha = new _2Captcha(" ## YOUR API KEY ## ");
            // .. additionally you can pass your own httpClient class
            var captchaWithHttpClient = new _2Captcha(" ## YOUR API KEY ## ", new HttpClient());

            // Get current balance
            var balance = await captcha.GetBalance();

            // Solve image captcha
            var image1 = await captcha.SolveImage(new FileStream("captcha.png", FileMode.Open));
            var image2 = await captcha.SolveImage("data:image/png;base64,iVBORw0KGgo...");

            // Solve text captcha
            var question = await captcha.SolveQuestion("1 + 3 = ?");

            // Solve hCaptcha
            var hcaptcha = await captcha.SolveHCaptcha("HCAPTCHA_SITE_KEY", "https://example.com");

            // Solve ReCaptchaV2
            var recaptcha = await captcha.SolveReCaptchaV2("GOOGLE_SITE_KEY", "https://example.com");
            var recaptchaInvisible = await captcha.SolveReCaptchaV2("GOOGLE_SITE_KEY", "https://example.com", true);

            // Solve ReCaptchaV3
            var recaptcha3 = await captcha.SolveReCaptchaV3("GOOGLE_SITE_KEY", "https://example.com", "ACTION", 0.4);

            // Solve ClickCaptcha
            var click1 = await captcha.SolveClickCaptcha(new FileStream("captcha.png", FileMode.Open), "Click on ghosts");
            var click2 = await captcha.SolveClickCaptcha("data:image/png;base64,iVBORw0KGgo...", "Click on ghosts");

            // Solve RotateCaptcha
            var rotate = await captcha.SolveRotateCaptcha(new Stream[] {new FileStream("captcha.png", FileMode.Open)}, "40");

            // Solve FunCaptcha
            var fun = await captcha.SolveFunCaptcha("FUN_CAPTCHA_PUBLIC_KEY", "https://example.com");
            var funNoJavaScript = await captcha.SolveFunCaptcha("FUN_CAPTCHA_PUBLIC_KEY", "https://example.com", true);

            // Solve KeyCaptcha
            var key = await captcha.SolveKeyCaptcha("USER_ID", "SESSION_ID", "WEB_SIGN_1", "WEB_SIGN_2", "https://example.com");

            Debugger.Break();
        }
Esempio n. 2
0
        public static async Task <string> SolveRegisterCaptcha()
        {
            var captcha = new _2Captcha("5093eb3ba7608e487fd05f6abbeb2f21");
            var balance = await captcha.GetBalance();

            Console.WriteLine($"2Captcha Balance: {balance.Response}$");

            while (true)
            {
                var resCaptcha = await captcha.SolveReCaptchaV2("6Lef5iQTAAAAAKeIvIY-DeexoO3gj7ryl9rLMEnn", "https://discordapp.com/api/v6/auth/register", Program.Proxy, _2CaptchaAPI.Enums.ProxyType.Https);

                if (resCaptcha.Success)
                {
                    return(resCaptcha.Response);
                }
                else
                {
                    Console.WriteLine("Captcha f****d up");
                }
            }
        }
Esempio n. 3
0
        private async Task BumpAsync()
        {
            var bumpCards = _web.FindElements(By.ClassName("modal-content bump-modal"));

            for (var i = 0; i < bumpCards.Count; i++)
            {
                var x         = bumpCards[i];
                var server    = x.FindElement(By.Name("serverEid"));
                var id        = server.GetAttribute("value");
                var googleKey = x.FindElement(By.Id("recaptcha")).GetAttribute("data-sitekey");
                var result    = await _captcha.SolveReCaptchaV2(googleKey, Constant.DefaultUrl);

                if (!result.Success)
                {
                    continue;
                }

                x.FindElement(By.Id("g-recaptcha-response")).SendKeys(result.Response);
                var button = x.FindElement(By.ClassName("btn btn-primary"));
                button.Click();
                await Task.Delay(TimeSpan.FromSeconds(5));
            }
        }
Esempio n. 4
0
        private static async Task Foo()
        {
            /*
             * Class initialization
             * Optionally you can pass 2nd parameter `httpClient` with custom HttpClient to use while requesting API
             */
            var captcha           = new _2Captcha("API_KEY");
            var captchaCustomHttp = new _2Captcha("API_KEY", new HttpClient());

            /*
             * Set custom API url (optional)
             */
            captcha.SetApiUrl("https://CUSTOM_URL");

            /*
             * Get current balance
             */
            var balance = await captcha.GetBalance();

            /*
             * Type: Image
             *
             * Documentation (2captcha): https://2captcha.com/2captcha-api#solving_normal_captcha
             */
            var image = await captcha.SolveImage(new FileStream("captcha.png", FileMode.Open), FileType.Png);

            var image2 = await captcha.SolveImage(File.ReadAllBytes("captcha.png"), FileType.Png);

            var image3 = await captcha.SolveImage("BASE64_IMAGE", FileType.Png);

            var imageCaseSensitive = await captcha.SolveImage(new FileStream("captcha.png", FileMode.Open), FileType.Png, new KeyValuePair <string, string>("regsense", "1"));

            var imageCaseSensitive2 = await captcha.SolveImage(File.ReadAllBytes("captcha.png"), FileType.Png, new KeyValuePair <string, string>("regsense", "1"));

            var imageCaseSensitive3 = await captcha.SolveImage("BASE64_IMAGE", FileType.Png, new KeyValuePair <string, string>("regsense", "1"));

            /*
             * Type: Text
             *
             * Documentation (2captcha): https://2captcha.com/2captcha-api#solving_text_captcha
             */
            var question = await captcha.SolveQuestion("1 + 3 = ?");

            /*
             * Type: ReCaptcha V2
             * Optionally you can pass 3rd parameter `isInvisible` to indicate if the reCaptcha is setup as invisible
             *
             * Homepage: https://www.google.com/recaptcha/
             * Documentation (vendor): https://developers.google.com/recaptcha/docs/display
             * Documentation (2captcha): https://2captcha.com/2captcha-api#solving_recaptchav2_new
             */
            var reCaptcha = await captcha.SolveReCaptchaV2("SITE_KEY", "https://WEBSITE_URL");

            var reCaptchaInvisible = await captcha.SolveReCaptchaV2("SITE_KEY", "https://WEBSITE_URL", true);

            var reCaptchaWithProxy = await captcha.SolveReCaptchaV2("SITE_KEY", "https://WEBSITE_URL", "username:password@address:port", ProxyType.Http);

            /*
             * Type: ReCaptcha V3
             *
             * Homepage: https://www.google.com/recaptcha/
             * Documentation (vendor): https://developers.google.com/recaptcha/docs/v3
             * Documentation (2captcha): https://2captcha.com/2captcha-api#solving_recaptchav3
             */
            var reCaptchaV3 = await captcha.SolveReCaptchaV3("SITE_KEY", "https://WEBSITE_URL", "ACTION", 0.4);

            var reCaptchaV3WithProxy = await captcha.SolveReCaptchaV3("SITE_KEY", "https://WEBSITE_URL", "username:password@address:port", ProxyType.Http, "ACTION", 0.4);

            /*
             * Type: hCaptcha
             *
             * Homepage: https://www.hcaptcha.com/
             * Documentation (vendor): https://docs.hcaptcha.com/
             * Documentation (2captcha): https://2captcha.com/2captcha-api#solving_hcaptcha
             */
            var hCaptcha = await captcha.SolveHCaptcha("SITE_KEY", "https://WEBSITE_URL");

            var hCaptchaWithProxy = await captcha.SolveHCaptcha("SITE_KEY", "https://WEBSITE_URL", "username:password@address:port", ProxyType.Http);

            /*
             * Type: GeeTest
             *
             * Homepage: https://www.geetest.com/en
             * Documentation (vendor): https://docs.geetest.com/en
             * Documentation (2captcha): https://2captcha.com/2captcha-api#solving_geetest
             */
            var geeTest = await captcha.SolveGeeTest("SITE_KEY", "https://WEBSITE_URL", "CHALLENGE");

            /*
             * Type: ClickCaptcha
             *
             * Documentation (2captcha): https://2captcha.com/2captcha-api#solving_clickcaptcha
             */
            var clickCaptcha = await captcha.SolveClickCaptcha(new FileStream("captcha.png", FileMode.Open), FileType.Png, "TASK");

            var clickCaptcha2 = await captcha.SolveClickCaptcha(File.ReadAllBytes("captcha.png"), FileType.Png, "TASK");

            var clickCaptcha3 = await captcha.SolveClickCaptcha("BASE64_IMAGE", FileType.Png, "TASK");

            /*
             * Type: RotateCaptcha
             *
             * Documentation (2captcha): https://2captcha.com/2captcha-api#solving_rotatecaptcha
             */
            var rotateCaptcha = await captcha.SolveRotateCaptcha(
                new Stream[]
            {
                new FileStream("captcha1.png", FileMode.Open),
                new FileStream("captcha2.png", FileMode.Open),
                new FileStream("captcha3.png", FileMode.Open),
            }, FileType.Png, "40");

            /*
             * Type: FunCaptcha
             *
             * Documentation (2captcha): https://2captcha.com/2captcha-api#solving_funcaptcha_new
             */
            var funCaptcha = await captcha.SolveFunCaptcha("PUBLIC_KEY", "https://WEBSITE_URL");

            var funCaptchaNoJavaScript = await captcha.SolveFunCaptcha("PUBLIC_KEY", "https://WEBSITE_URL", true);

            var funCaptchaWithProxy = await captcha.SolveFunCaptcha("PUBLIC_KEY", "https://WEBSITE_URL", "username:password@address:port", ProxyType.Http);

            /*
             * Type: KeyCaptcha
             *
             * Homepage: https://www.keycaptcha.com/
             * Documentation (2captcha): https://2captcha.com/2captcha-api#solving_keycaptcha
             */
            var keyCaptcha = await captcha.SolveKeyCaptcha("USER_ID", "SESSION_ID", "WEB_SIGN_1", "WEB_SIGN_2", "https://WEBSITE_URL");

            Debugger.Break();
        }
Esempio n. 5
0
        static async Task DoShit()
        {
            Random random = new Random();

            while (true)
            {
                //CAPTCHA INIT
                var captcha = new _2Captcha("5093eb3ba7608e487fd05f6abbeb2f21");
                var balance = await captcha.GetBalance();

                Console.WriteLine($"2Captcha Balance: {balance.Response}$");

                //PROXY PREP
                string[] lines = File.ReadAllLines("proxies.txt");
                Proxy = lines[random.Next(0, lines.Length - 1)];
                WebProxy proxy = new WebProxy(Proxy);
                Console.WriteLine($"Using Proxy: {Proxy}");

                //REST TEST
                Stopwatch watch = new Stopwatch();
                watch.Start();
                Console.WriteLine($"REST request test..");
                var client  = new RestClient("https://reqres.in/api/");
                var request = new RestRequest("users");
                request.AddHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0");
                request.Timeout = 15000;
                client.Proxy    = proxy;
                var response = await client.ExecutePostAsync(request);

                var content = response.Content;
                watch.Stop();
                Console.WriteLine($"Elapsed: {watch.Elapsed.TotalSeconds}s");
                if (content.Length > 0)
                {
                    Console.WriteLine($"Proxy usable - returned content ({content})");
                }
                if (content.Length == 0)
                {
                    continue;
                }
                if (watch.ElapsedMilliseconds > (15 * 1000))
                {
                    continue;
                }

                //CAPTCHA SOLVE
                Console.WriteLine($"Solving Captcha..");
                //var captcha = await captcha.SolveHCaptcha("f5561ba9-8f1e-40ca-9b5b-a0b3f719ef34", "https://discordapp.com/api/v6/auth/register", proxypick, _2CaptchaAPI.Enums.ProxyType.Https);
                var resCaptcha = await captcha.SolveReCaptchaV2("6Lef5iQTAAAAAKeIvIY-DeexoO3gj7ryl9rLMEnn", "https://discordapp.com/api/v6/auth/register", Proxy, _2CaptchaAPI.Enums.ProxyType.Https);

                Console.WriteLine($"Result: {resCaptcha.Response}");
                Console.WriteLine($"Success: {resCaptcha.Success}");

                //CLIENT NAME
                const string chars      = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
                string       randstring = new string(Enumerable.Range(1, 10).Select(_ => chars[random.Next(chars.Length)]).ToArray()).ToLower();
                Console.WriteLine($"Random user account: DB{randstring}");
                Login = randstring;

                Console.WriteLine();
                Console.WriteLine("--------------------------------------------------------------");
                Console.WriteLine("REGISTER LOGIC START");
                Console.WriteLine();

                while (true)
                {
                    //REGISTER REQUEST
                    Console.WriteLine("Discord register request..");
                    client  = new RestClient("https://discordapp.com/api/v6/");
                    request = new RestRequest("auth/register");
                    request.RequestFormat = DataFormat.Json;
                    request.AddJsonBody(new
                    {
                        email            = $"DB{randstring}@coolman.fun",
                        username         = $"Coolman",
                        password         = "******",
                        invite           = "",
                        consent          = true,
                        gift_code_sku_id = "",
                        captcha_key      = resCaptcha.Response
                    });
                    request.AddHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0");
                    //request.AddHeader("content-type", "application/json");
                    //request.AddHeader("Connection", "keep-alive");
                    client.Proxy = proxy;
                    response     = await client.ExecutePostAsync(request);

                    Console.WriteLine($"Register: {response.Content}");

                    if (response.Content.Length == 0)
                    {
                        Console.WriteLine("Response invalid, press ENTER to repeat process");
                        Console.ReadLine();
                        continue;
                    }

                    //RESPONSE PARSE
                    dynamic json = JObject.Parse(response.Content);
                    if (json.ContainsKey("token"))
                    {
                        Token = json.token;
                        Console.WriteLine($"Token: {Token}");

                        bool didIt = false;
                        while (true)
                        {
                            Imap4Client em = new Imap4Client();
                            Console.WriteLine(em.ConnectSsl("wes1-imap2.wedos.net", 993));
                            Console.WriteLine(em.Login("*****@*****.**", "-Poqwlkas1")); //custom

                            var mails = em.SelectMailbox("INBOX");
                            var msgs  = mails.SearchParse("ALL").Cast <Message>();
                            Console.WriteLine($"Loaded emails {msgs.Count()}");

                            if (msgs.Count() == 0)
                            {
                                continue;
                            }

                            //MAIL BROWSE
                            foreach (Message mail in msgs)
                            {
                                if (mail.To[0].Email == $"db{randstring}@coolman.fun")
                                {
                                    var   html = mail.BodyHtml.Text;
                                    Regex rg   = new Regex("https:\\/\\/click\\.discord\\.com\\/ls\\/click\\?upn=(.*)\" *style.*\n.*Verify");
                                    var   link = rg.Match(html);
                                    if (link.Success)
                                    {
                                        //VERIFY LINK RESOLVE
                                        Console.WriteLine($"Original: {link.Groups[1]}{Environment.NewLine}");
                                        var resolved = GetFinalRedirect("https://click.discord.com/ls/click?upn=" + link.Groups[1]);
                                        Console.WriteLine($"Resolved: {resolved}{Environment.NewLine}");
                                        resolved = resolved.Substring(33);
                                        Console.WriteLine($"Token: {resolved}{Environment.NewLine}");

                                        //CAPTCHA
                                        Console.WriteLine($"Solving Captcha..");
                                        resCaptcha = await captcha.SolveReCaptchaV2("6Lef5iQTAAAAAKeIvIY-DeexoO3gj7ryl9rLMEnn", "https://discordapp.com/", Proxy, _2CaptchaAPI.Enums.ProxyType.Https);

                                        Console.WriteLine($"Success: {resCaptcha.Success}");

                                        //VERIFY
                                        request = new RestRequest("auth/verify");
                                        request.RequestFormat = DataFormat.Json;
                                        request.AddJsonBody(new
                                        {
                                            token       = resolved,
                                            captcha_key = resCaptcha.Response
                                        });
                                        request.AddHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0");
                                        response = await client.ExecutePostAsync(request);

                                        Console.WriteLine($"Login: {response.Content}");
                                        dynamic data = JObject.Parse(response.Content);
                                        Token = data.token;
                                        ///////////////////
                                        didIt = true;
                                        break;
                                    }
                                }
                            }
                            if (didIt)
                            {
                                break;
                            }
                            Console.WriteLine("No e-mail.. Delay 5s");
                            await Task.Delay(5000);

                            continue;
                        }
                        break;
                    }
                    else
                    {
                        Console.WriteLine("Response invalid, press ENTER to repeat process");
                        Console.ReadLine();
                        continue;
                    }
                }

                Console.WriteLine();
                Console.WriteLine("--------------------------------------------------------------");
                Console.WriteLine("LOGIN & SPAM LOGIC START");
                Console.WriteLine();

                while (true)
                {
                    try
                    {
                        Console.WriteLine("Using RestSharp");
                        client       = new RestClient("https://discordapp.com/api/v6/");
                        client.Proxy = proxy;
                        /////////////////////////////////////////////

                        //LOGIN
                        request = new RestRequest("auth/login");
                        request.RequestFormat = DataFormat.Json;
                        request.AddJsonBody(new
                        {
                            email        = $"{Login}@coolman.fun",
                            password     = "******",
                            undelete     = "false",
                            captcha_key  = "null",
                            login_source = "null"
                        });
                        request.AddHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0");
                        response = await client.ExecutePostAsync(request);

                        dynamic data = JObject.Parse(response.Content);
                        Token = data.token;
                        Console.WriteLine($"Login: {response.Content}");
                        //Console.ReadLine();
                        ///////////////////

                        //INVITE
                        request = new RestRequest($"invite/{InviteID}");
                        request.AddHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0");
                        request.AddHeader("Authorization", Token);
                        response = await client.ExecutePostAsync(request);

                        Console.WriteLine($"Invite: {response.Content}");
                        //Console.ReadLine();
                        ///////////////////

                        //GATEWAY
                        Console.WriteLine("Connecting to Discord Gateway");
                        var factory = new Func <ClientWebSocket>(() => new ClientWebSocket
                        {
                            Options =
                            {
                                Proxy = proxy
                            }
                        });
                        var exitEvent = new ManualResetEvent(false);
                        using (var wsc = new WebsocketClient(new Uri("wss://gateway.discord.gg"), factory))
                        {
                            wsc.ReconnectTimeout = TimeSpan.FromSeconds(30);
                            //wsc.ReconnectionHappened.Subscribe(info =>
                            //Log.Information($"Reconnection happened, type: {info.Type}"));

                            wsc.MessageReceived.Subscribe(msg =>
                            {
                                Console.WriteLine($"Gateway incoming: {msg}");
                                exitEvent.Set();
                            });
                            wsc.Start();

                            //Task.Run(() => wsc.Send("{ message }"));

                            exitEvent.WaitOne();
                            //Console.ReadLine();
                            wsc.Send("{\"op\":2,\"d\":{\"token\":\"" + Token + "\",\"intents\":7,\"properties\":{\"$os\":\"linux\",\"$browser\":\"chrome\",\"$device\":\"build\"},\"compress\":true,\"large_threshold\":250,\"guild_subscriptions\":false,\"shard\":[0,1],\"presence\":{\"activities\":[{\"name\":\"What's up\",\"type\":0}],\"status\":\"dnd\",\"since\":91879201,\"afk\":false}}}");
                            //Console.ReadLine();
                            exitEvent.WaitOne();
                        }

                        //SPAM LOOP (unbreakable)
                        Console.WriteLine("Setup successful - SPAM READY");
                        Console.WriteLine("Press ENTER to start");
                        Console.ReadLine();
                        while (true)
                        {
                            var chat = File.ReadAllLines("chat.txt");
                            request = new RestRequest($"channels/{ChannelID}/messages");
                            //request.RequestFormat = DataFormat.Json;
                            request.AddQueryParameter("Authorization", Token);
                            request.AddParameter("Authorization", Token);
                            request.AddJsonBody(new
                            {
                                authorization = Token,
                                content       = chat[random.Next(chat.Length)],
                                nonce         = ((DateTime.Now.Ticks - 1420070400000) * 4194304),
                                tts           = "false"
                            });
                            request.AddHeader("Authorization", Token);
                            response = await client.ExecutePostAsync(request);

                            Console.WriteLine($"Message: {response.Content}");
                            data = JObject.Parse(response.Content);

                            if (data.ContainsKey("retry_after"))
                            {
                                await Task.Delay(int.Parse(data.retry_after));
                            }
                            else
                            {
                                await Task.Delay(random.Next(1000, 4000));
                            }
                        }
                        ;
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine($"Error S2: {e.Message}");
                        Console.ReadLine();
                        continue; //reset logic
                    }
                }

                Console.WriteLine("End of loop");
                Console.ReadLine();
                break;
            }
            Console.WriteLine("Program End");
        }
Esempio n. 6
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        static async Task DoNewShit()
        {
            string registerCaptchaToken = "";

            //MAIN BLOCK
            while (true)
            {
                try
                {
                    Console.WriteLine();
                    Console.WriteLine($"--------------------------------------------------------------------");
                    Console.WriteLine($"LOGIC INITIALIZATION");
                    Console.WriteLine();

                    //PROXY PREPARE
                    await PrepareProxy();

                    //CLIENT NAME
                    const string chars      = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
                    string       randstring = new string(Enumerable.Range(1, 10).Select(_ => chars[random.Next(chars.Length)]).ToArray()).ToLower();
                    Console.WriteLine($"Random user account: DB{randstring}");
                    Login = "******" + randstring;

                    //CAPTCHA BALANCE
                    var balance = await captcha.GetBalance();

                    Console.WriteLine($"- 2Captcha Balance: {balance.Response}$");

                    break;
                }
                catch (Exception e)
                {
                    Console.WriteLine($"- ERROR (MAIN BLOCK): {e.Message}");
                    Console.WriteLine("Press ENTER to restart the block");
                    Console.ReadLine();
                    continue;
                }
            }

            //REGISTER BLOCK
            while (true)
            {
                try
                {
                    Console.WriteLine();
                    Console.WriteLine($"--------------------------------------------------------------------");
                    Console.WriteLine($"LOGIC REGISTER");
                    Console.WriteLine();

                    //CAPTCHA PREPARE - REGISTER
                    Console.WriteLine($"- Solving register CAPTCHA..");
                    //var captcha = await captcha.SolveHCaptcha("f5561ba9-8f1e-40ca-9b5b-a0b3f719ef34", "https://discordapp.com/api/v6/auth/register", proxypick, _2CaptchaAPI.Enums.ProxyType.Https);
                    var regCaptcha = await captcha.SolveReCaptchaV2("6Lef5iQTAAAAAKeIvIY-DeexoO3gj7ryl9rLMEnn", "https://discordapp.com/api/v6/auth/register", Proxy, _2CaptchaAPI.Enums.ProxyType.Https);

                    Console.WriteLine($"- Success: {regCaptcha.Success}");
                    registerCaptchaToken = regCaptcha.Response;
                    if (!regCaptcha.Success)
                    {
                        Console.WriteLine($"- Captcha solver failed: {regCaptcha.Response}");
                        Console.WriteLine($"- Restarting block");
                        Console.WriteLine("Press ENTER to restart the block");
                        Console.ReadLine();
                        continue;
                    }

                    //REGISTER REQUEST
                    Console.WriteLine("- Sending register request to Discord");
                    var request = new RestRequest("auth/register");
                    request.RequestFormat = DataFormat.Json;
                    request.AddJsonBody(new
                    {
                        email            = $"{Login}@coolman.fun",
                        username         = $"Coolman",
                        password         = "******",
                        invite           = "",
                        consent          = true,
                        gift_code_sku_id = "",
                        captcha_key      = regCaptcha.Response
                    });
                    request.AddHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0");
                    var response = await client.ExecutePostAsync(request);

                    Console.WriteLine($"- Register: {response.Content}");

                    if (response.Content.Length == 0)
                    {
                        Console.WriteLine("- Response invalid, press ENTER to repeat process");
                        Console.ReadLine();
                        continue;
                    }
                    break;
                }
                catch (Exception e)
                {
                    Console.WriteLine($"- ERROR (REGISTER BLOCK): {e.Message}");
                    Console.WriteLine("Press ENTER to restart the block");
                    Console.ReadLine();
                    continue;
                }
            }

            //VERIFY BLOCK
            await VerifyAccount();

            //LOGIN BLOCK
            bool doLoginCaptcha = false;

            while (true)
            {
                try
                {
                    Console.WriteLine();
                    Console.WriteLine($"--------------------------------------------------------------------");
                    Console.WriteLine($"LOGIC LOGIN");
                    Console.WriteLine();

                    string captchaCode = "null";
                    if (doLoginCaptcha)
                    {
                        //CAPTCHA
                        Console.WriteLine($"- Solving Login Captcha..");
                        var logCaptcha = await captcha.SolveReCaptchaV2("6Lef5iQTAAAAAKeIvIY-DeexoO3gj7ryl9rLMEnn", "https://discordapp.com/", Proxy, _2CaptchaAPI.Enums.ProxyType.Https);

                        Console.WriteLine($"- Success: {logCaptcha.Success}");
                        if (!logCaptcha.Success)
                        {
                            Console.WriteLine($"- Captcha solver failed: {logCaptcha.Response}");
                            Console.WriteLine($"- Restarting block");
                            Console.WriteLine("Press ENTER to restart the block");
                            Console.ReadLine();
                            continue;
                        }
                        captchaCode = logCaptcha.Response;
                    }

                    //LOGIN
                    var request = new RestRequest("auth/login");
                    request.RequestFormat = DataFormat.Json;
                    request.AddJsonBody(new
                    {
                        email        = $"{Login}@coolman.fun",
                        password     = "******",
                        undelete     = "false",
                        captcha_key  = captchaCode,
                        login_source = "null"
                    });
                    request.AddHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0");
                    var response = await client.ExecutePostAsync(request);

                    dynamic data = JObject.Parse(response.Content);
                    if (data.ContainsKey("token"))
                    {
                        Token = data.token;
                        Console.WriteLine($"Login: {response.Content}");
                        break;
                    }
                    else
                    {
                        if (data.ContainsKey("retry_after"))
                        {
                            Console.WriteLine($"- Rate limited.. Waiting {data.retry_after}ms..");
                            await Task.Delay(int.Parse(data.retry_after));

                            Console.WriteLine("- Restarting block..");
                            continue;
                        }

                        Console.WriteLine("- Login failed, maybe CAPTCHA?");
                        Console.WriteLine(response.Content);
                        Console.WriteLine("- Restarting block");
                        doLoginCaptcha = true;
                        continue;
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine($"- ERROR (LOGIN BLOCK): {e.Message}");
                    Console.WriteLine("Press ENTER to restart the block");
                    Console.ReadLine();
                    continue;
                }
            }

            //INVITE & GATEWAY BLOCK
            while (true)
            {
                try
                {
                    Console.WriteLine();
                    Console.WriteLine($"--------------------------------------------------------------------");
                    Console.WriteLine($"LOGIC INVITE & GATEWAY");
                    Console.WriteLine();

                    //INVITE
                    Console.WriteLine($"- Accepting invite to server..");
                    var request = new RestRequest($"invite/{InviteID}");
                    request.AddHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0");
                    request.AddHeader("Authorization", Token);
                    var response = await client.ExecutePostAsync(request);

                    Console.WriteLine($"- Invite: {response.Content}");

                    dynamic data = JObject.Parse(response.Content);
                    if (data.ContainsKey("code") && data.code == 40002)
                    {
                        Console.WriteLine($"- Verification f****d up, repeating..");
                        await VerifyAccount();

                        Console.WriteLine($"- Restarting block..");
                        continue;
                    }
                    if (data.ContainsKey("retry_after"))
                    {
                        Console.WriteLine($"- Rate limited.. Waiting {data.retry_after}ms..");
                        await Task.Delay(int.Parse(data.retry_after));

                        Console.WriteLine("- Restarting block..");
                        continue;
                    }
                    ///////////////////

                    //GATEWAY
                    Console.WriteLine("- Connecting to Discord Gateway..");
                    var factory = new Func <ClientWebSocket>(() => new ClientWebSocket
                    {
                        Options =
                        {
                            Proxy = ProxyObj
                        }
                    });
                    var exitEvent = new ManualResetEvent(false);
                    using (var wsc = new WebsocketClient(new Uri("wss://gateway.discord.gg"), factory))
                    {
                        wsc.ReconnectTimeout = TimeSpan.FromSeconds(30);
                        //wsc.ReconnectionHappened.Subscribe(info =>
                        //Log.Information($"Reconnection happened, type: {info.Type}"));

                        wsc.MessageReceived.Subscribe(msg =>
                        {
                            Console.WriteLine($"Gateway incoming: {msg}");
                            exitEvent.Set();
                        });
                        wsc.Start();

                        //Task.Run(() => wsc.Send("{ message }"));

                        exitEvent.WaitOne();
                        //Console.ReadLine();
                        wsc.Send("{\"op\":2,\"d\":{\"token\":\"" + Token + "\",\"intents\":7,\"properties\":{\"$os\":\"linux\",\"$browser\":\"chrome\",\"$device\":\"build\"},\"compress\":true,\"large_threshold\":250,\"guild_subscriptions\":false,\"shard\":[0,1],\"presence\":{\"activities\":[{\"name\":\"What's up\",\"type\":0}],\"status\":\"dnd\",\"since\":91879201,\"afk\":false}}}");
                        //Console.ReadLine();
                        exitEvent.WaitOne();
                    }

                    break;
                }
                catch (Exception e)
                {
                    Console.WriteLine($"- ERROR (INVITE & GATEWAY BLOCK): {e.Message}");
                    Console.WriteLine("Press ENTER to restart the block");
                    Console.ReadLine();
                    continue;
                }
            }

            //SPAM BLOCK
            while (true)
            {
                try
                {
                    Console.WriteLine();
                    Console.WriteLine($"--------------------------------------------------------------------");
                    Console.WriteLine($"LOGIC SPAM");
                    Console.WriteLine();

                    Console.WriteLine("- Bot setup successful - SPAM READY");
                    Console.WriteLine("Press ENTER to start");
                    Console.ReadLine();
                    while (true)
                    {
                        var chat    = File.ReadAllLines("chat.txt");
                        var request = new RestRequest($"channels/{ChannelID}/messages");
                        //request.RequestFormat = DataFormat.Json;
                        request.AddQueryParameter("Authorization", Token);
                        request.AddParameter("Authorization", Token);
                        request.AddJsonBody(new
                        {
                            authorization = Token,
                            content       = chat[random.Next(chat.Length)],
                            nonce         = ((DateTime.Now.Ticks - 1420070400000) * 4194304),
                            tts           = "false"
                        });
                        request.AddHeader("Authorization", Token);
                        var response = await client.ExecutePostAsync(request);

                        Console.WriteLine($"Message: {response.Content}");
                        dynamic data = JObject.Parse(response.Content);

                        if (data.ContainsKey("code") && data.code == 40002)
                        {
                            await VerifyAccount();
                        }

                        if (data.ContainsKey("retry_after"))
                        {
                            await Task.Delay(int.Parse(data.retry_after));
                        }
                        else
                        {
                            await Task.Delay(random.Next(1000, 4000));
                        }
                    }
                    ;
                }
                catch (Exception e)
                {
                    Console.WriteLine($"- ERROR (SPAM BLOCK): {e.Message}");
                    Console.WriteLine("Press ENTER to restart the block");
                    Console.ReadLine();
                    continue;
                }
            }
        }
Esempio n. 7
0
        static async Task DoTempShit()
        {
            //CAPTCHA INIT
            var captcha = new _2Captcha("5093eb3ba7608e487fd05f6abbeb2f21");
            var balance = await captcha.GetBalance();

            Console.WriteLine($"2Captcha Balance: {balance.Response}$");

            //PROXY PREP
            WebProxy proxy = new WebProxy(Proxy);

            Console.WriteLine($"Using Proxy: {Proxy}");

            //REST TEST
            Stopwatch watch = new Stopwatch();

            watch.Start();
            Console.WriteLine($"REST request test..");
            var client  = new RestClient("https://reqres.in/api/");
            var request = new RestRequest("users");

            request.AddHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0");
            request.Timeout = 15000;
            client.Proxy    = proxy;
            //var response = await client.ExecutePostAsync(request);
            var content = "s"; //response.Content;

            watch.Stop();
            Console.WriteLine($"Elapsed: {watch.Elapsed.TotalSeconds}s");
            if (content.Length > 0)
            {
                Console.WriteLine($"Proxy usable - returned content ({content})");
            }

            //Console.WriteLine("Press ENTER to procceed");
            //Console.ReadLine();

            ///////

            Random rand = new Random();

            try
            {
                Console.WriteLine("Using RestSharp");
                client       = new RestClient("https://discordapp.com/api/v6/");
                client.Proxy = proxy;
                /////////////////////////////////////////////

                Imap4Client em = new Imap4Client();
                Console.WriteLine(em.ConnectSsl("wes1-imap2.wedos.net", 993));
                Console.WriteLine(em.Login("*****@*****.**", "-Poqwlkas1")); //custom

                var mails = em.SelectMailbox("INBOX");
                var msgs  = mails.SearchParse("ALL").Cast <Message>();
                Console.WriteLine($"Loaded emails {msgs.Count()}");


                bool didIt = false;

                //MAIL BROWSE
                foreach (Message mail in msgs)
                {
                    foreach (var to in mail.To)
                    {
                        Console.WriteLine($"{to.Email} vs {Login.ToLower()}");
                    }

                    if (mail.To[0].Email.CompareTo($"{Login.ToLower()}@coolman.fun") == 0)
                    {
                        Console.WriteLine("Found email");
                        var   html = mail.BodyHtml.Text;
                        Regex rg   = new Regex("https:\\/\\/click\\.discord\\.com\\/ls\\/click\\?upn=(.*)\" *style.*\n.*Verify");
                        var   link = rg.Match(html);
                        if (link.Success)
                        {
                            foreach (var grp in link.Groups)
                            {
                                Console.WriteLine($"Group:  <<<{grp}>>>");
                            }

                            //VERIFY LINK RESOLVE
                            Console.WriteLine($"Original: {link.Groups[1]}{Environment.NewLine}");
                            var resolved = GetFinalRedirect("https://click.discord.com/ls/click?upn=" + link.Groups[1]);
                            Console.WriteLine($"Resolved: {resolved}{Environment.NewLine}");
                            resolved = resolved.Substring(33);
                            Console.WriteLine($"Token: {resolved}{Environment.NewLine}");

                            Console.WriteLine("Press ENTER to procceed");
                            Console.ReadLine();

                            //CAPTCHA
                            Console.WriteLine($"Solving Captcha..");
                            var resCaptcha = await captcha.SolveReCaptchaV2("6Lef5iQTAAAAAKeIvIY-DeexoO3gj7ryl9rLMEnn", "https://discordapp.com/", Proxy, _2CaptchaAPI.Enums.ProxyType.Https);

                            Console.WriteLine($"Success: {resCaptcha.Success}");

                            //VERIFY
                            request = new RestRequest("auth/verify");
                            request.RequestFormat = DataFormat.Json;
                            request.AddJsonBody(new
                            {
                                token       = resolved,
                                captcha_key = resCaptcha.Response
                            });
                            request.AddHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0");
                            var response = await client.ExecutePostAsync(request);

                            Console.WriteLine($"Login: {response.Content}");
                            Console.ReadLine();
                            ///////////////////
                            didIt = true;
                            break;
                        }
                    }
                }
            }
            catch (WebException e)
            {
                Console.WriteLine($"Error: {e.Message}");
            }
        }