Exemple #1
0
        /// <summary>
        /// Browser test recaptcha normal
        /// </summary>
        private static void browser_test_normal()
        {
            Console.WriteLine("[=] BROWSER TEST STARTED (NORMAL CAPTCHA) [=]");
            var s = ChromeDriverService.CreateDefaultService();

            s.HideCommandPromptWindow = true;
            ChromeDriver d = new ChromeDriver(s);

            try
            {
                d.Navigate().GoToUrl(TEST_PAGE_NORMAL);               // go to normal test page
                // complete regular data
                d.FindElementByName("username").SendKeys("my-username");
                d.FindElementByName("password").SendKeys("password-here");
                Console.WriteLine("[+] Completed regular info");
                // ---------------------

                // get sitekey
                string site_key = d.FindElementByClassName("g-recaptcha").GetAttribute("data-sitekey");
                Console.WriteLine(string.Format("[+] Site key: {0}", site_key));

                // complete captcha

                Console.WriteLine("[+] Waiting for recaptcha to be solved ...");
                ImageTypersAPI i = new ImageTypersAPI(IMAGETYPERS_TOKEN);
                Dictionary <string, string> p = new Dictionary <string, string>();
                p.Add("page_url", TEST_PAGE_NORMAL);
                p.Add("sitekey", site_key);
                string recaptcha_id = i.submit_recaptcha(p);       // submit recaptcha info
                // while in progress, sleep for 10 seconds
                while (i.in_progress(recaptcha_id))
                {
                    Thread.Sleep(10000);
                }
                string g_response_code = i.retrieve_captcha(recaptcha_id);

                //Console.Write("CODE:"); Console.ReadLine(); string g_response_code = File.ReadAllText("g-response.txt");        // get manually
                Console.WriteLine(string.Format("[+] Got g-response-code: {0}", g_response_code));

                // set g-response-code in page source (with javascript)
                IJavaScriptExecutor e  = (IJavaScriptExecutor)d;
                string javascript_code = string.Format("document.getElementById('g-recaptcha-response').innerHTML = '{0}';", g_response_code);
                e.ExecuteScript(javascript_code);
                Console.WriteLine("[+] Code set in page");

                // submit form
                d.FindElementByTagName("form").Submit();
                Console.WriteLine("[+] Form submitted");
            }
            finally
            {
                Thread.Sleep(5000);
                d.Quit();       // quit browser
                Console.WriteLine("[=] BROWSER TEST FINISHED [=]");
            }
        }
Exemple #2
0
        public static void run()
        {
            // get access token from: http://www.imagetyperz.com
            string         token = Config.TOKEN;
            ImageTypersAPI i     = new ImageTypersAPI(token);

            // balance
            string balance = i.account_balance();

            Console.WriteLine(string.Format("Balance: {0}", balance));

            Dictionary <string, string> d = new Dictionary <string, string>();

            d.Add("page_url", "https://your-site.com");
            d.Add("sitekey", "7LrGJmcUABBAALFtIb_FxC0LXm_GwOLyJAfbbUCL");
            // reCAPTCHA type(s) - optional, defaults to 1
            // ---------------------------------------------
            // 1 - v2
            // 2 - invisible
            // 3 - v3
            // 4 - enterprise v2
            // 5 - enterprise v3
            //
            // d.Add("type", "1");                 // optional
            //
            //d.Add("v3_min_score", "0.1");       // optional
            //d.Add("v3_action", "homepage");     // optional
            //d.Add("proxy", "126.45.34.53:123"); // or with auth 126.45.34.53:123:user:pass - optional
            //d.Add("user_agent", "Your user agent"); // optional
            //d.Add("data-s", "recaptcha data-s value"); // optional
            //d.Add("cookie_input", "a=b;c=d"); // optional

            string captcha_id = i.submit_recaptcha(d);

            Console.WriteLine("Waiting for captcha to be solved...");
            Dictionary <string, string> response = null;

            while (response == null)
            {
                System.Threading.Thread.Sleep(10000);       // sleep for 10 secons before checking for response
                response = i.retrieve_response(captcha_id);
            }
            ImageTypers.Utils.print_response(response);

            // other examples
            // ImagetypersAPI i = new ImagetypersAPI(username, password, 123);     // init with affiliate id
            // i.set_timeout(10);                                                  // set timeout to 10 seconds
            // Console.WriteLine(i.set_captcha_bad(captcha_id));                   // if response is incorrect, set captcha as bad using ID
        }
Exemple #3
0
        /// <summary>
        /// Requests test recaptcha invisible
        /// </summary>
        private static void requests_test_invisible()
        {
            ////button[@class="g-recaptcha"]
            Console.WriteLine("[=] REQUESTS TEST STARTED (INVISIBLE RECAPTCHA) [=]");
            try
            {
                Console.WriteLine("[+] Getting sitekey from test page...");
                string       resp = get(TEST_PAGE_INVISIBLE); // download page first (to get sitekey)
                HtmlDocument d    = new HtmlDocument();
                d.LoadHtml(resp);

                // get sitekey
                string site_key = d.DocumentNode.SelectSingleNode("//button").GetAttributeValue("data-sitekey", "");
                Console.WriteLine(string.Format("[+] Site key: {0}", site_key));

                // complete captcha
                Console.WriteLine("[+] Waiting for recaptcha to be solved ...");
                ImageTypersAPI i = new ImageTypersAPI(IMAGETYPERS_TOKEN);
                Dictionary <string, string> p = new Dictionary <string, string>();
                p.Add("page_url", TEST_PAGE_NORMAL);
                p.Add("sitekey", site_key);
                p.Add("type", "2");
                string recaptcha_id = i.submit_recaptcha(p);       // submit recaptcha info
                // while in progress, sleep for 10 seconds
                while (i.in_progress(recaptcha_id))
                {
                    Thread.Sleep(10000);
                }
                string g_response_code = i.retrieve_captcha(recaptcha_id);
                //Console.Write("CODE:"); Console.ReadLine(); string g_response_code = File.ReadAllText("g-response.txt");        // get manually
                Console.WriteLine(string.Format("[+] Got g-response-code: {0}", g_response_code));

                // create post request data
                string data = string.Format(
                    "username=my-username&" +
                    "password=password-here&" +
                    "g-recaptcha-response={0}",
                    g_response_code);

                // submit
                string response = post(TEST_PAGE_REQUESTS_VERIFY, data);
                Console.WriteLine(string.Format("[+] Response: {0}", response));
            }
            finally
            {
                Console.WriteLine("[=] REQUESTS TEST FINISHED [=]");
            }
        }
        /// <summary>
        /// Test API
        /// </summary>
        static void test_api()
        {
            // change to your own username & password
            // -----------------------------------------
            string access_key = "access_token_here";

            // init imagetypersAPI obj with username and password
            ImageTypersAPI i = new ImageTypersAPI(access_key);

            // old school / legacy way
            // i.set_user_and_password("your_username", "your_password");

            // balance
            // ------------
            string balance = i.account_balance();

            Console.WriteLine(string.Format("Balance: {0}", balance));

            // captcha image
            // ==========================================================================================
            // optional parameters dict
            Dictionary <string, string> image_params = new Dictionary <string, string>();

            //image_params.Add("iscase", "true");         // case sensitive captcha
            //image_params.Add("isphrase", "true");       // text contains at least one space (phrase)
            //image_params.Add("ismath", "true");         // instructs worker that a math captcha has to be solved
            //image_params.Add("alphanumeric", "1");      // 1 - digits only, 2 - letters only
            //image_params.Add("minlength", "2");         // captcha text length (minimum)
            //image_params.Add("maxlength", "5");         // captcha text length (maximum)

            Console.WriteLine("Solving image captcha ...");
            string captcha_image_text = i.solve_captcha("captcha.jpg", image_params);

            Console.WriteLine(string.Format("Captcha text: {0}", captcha_image_text));

            // ==========================================================================================
            // recaptcha
            // ----------
            // submit
            // -------
            // check https://www.github.com/imagetyperz-api/imagetyperz-api-csharp for more details
            // about how to get the page_url and sitekey

            // create params dict
            Dictionary <string, string> d = new Dictionary <string, string>();

            d.Add("page_url", "page_url_here");   // add --capy or --hcaptcha at the end, to submit capy or hCaptcha
            d.Add("sitekey", "sitekey_here");
            //d.Add("type", "3");                 // optional
            //d.Add("v3_min_score", "0.1");       // optional
            //d.Add("v3_action", "homepage");     // optional
            //d.Add("proxy", "126.45.34.53:123"); // or with auth 126.45.34.53:123:user:pass - optional
            //d.Add("user_agent", "Your user agent"); // optional

            string captcha_id = i.submit_recaptcha(d);

            Console.WriteLine("Waiting for recaptcha to be solved ...");

            // retrieve
            // ---------
            while (i.in_progress(captcha_id))
            {
                System.Threading.Thread.Sleep(10000);                                    // sleep for 10 seconds and retry
            }
            string gresponse = i.retrieve_captcha(captcha_id);

            Console.WriteLine(string.Format("Recaptcha response: {0}", gresponse));

            // Geetest
            // ----------
            // create params dict
            //Dictionary<string, string> dg = new Dictionary<string, string>();
            //dg.Add("domain", "geetest captcha domain");
            //dg.Add("challenge", "geetest captcha challenge");
            //dg.Add("gt", "geetest captcha gt");
            ////dg.Add("proxy", "126.45.34.53:123"); // or with auth 126.45.34.53:123:user:pass - optional
            ////dg.Add("user_agent", "Your user agent"); // optional

            //string geetest_id = i.submit_geetest(dg);
            //Console.WriteLine(string.Format("Geetest captcha id: {0}", geetest_id));
            //Console.WriteLine("Waiting for geetest captcha to be solved ...");

            //// retrieve
            //// ---------
            //while (i.in_progress(geetest_id)) System.Threading.Thread.Sleep(10000);      // sleep for 10 seconds and retry

            //// we got a response at this point
            //// ---------------------------------
            //Dictionary<string, string> geetest_response = i.retrieve_geetest(geetest_id);     // get the response
            //Console.WriteLine(string.Format("Geetest response: {0} - {1} - {2}", geetest_response["challenge"],
            //    geetest_response["validate"], geetest_response["seccode"]));

            // Other examples
            // ----------------
            // ImagetypersAPI i = new ImagetypersAPI(username, password, 123);     // init with refid
            // i.set_timeout(10);                                                  // set timeout to 10 seconds
            // Console.WriteLine(i.set_captcha_bad(captcha_id));                   // set captcha bad
            // i.submit_recaptcha(page_url, sitekey, "127.0.0.1:1234");    // solve recaptcha with proxy
            // i.submit_recaptcha(page_url, sitekey, "127.0.0.1:1234:user:pass");    // solve recaptcha with proxy - auth

            // Console.WriteLine(i.was_proxy_used(captcha_id));         // get status of proxy (if submitted with recaptcha)

            // Console.WriteLine(i.captcha_id());                       // last captcha solved id
            // Console.WriteLine(i.captcha_text());                     // last captcha solved text
            // Console.WriteLine(i.recaptcha_id());                     // last recaptcha solved id
            // Console.WriteLine(i.recaptcha_response());               // last recaptcha solved response
            // Console.WriteLine(i.error());                            // last error
        }
Exemple #5
0
        private static void abreReceitaIE()
        {
            Console.WriteLine("[=] BROWSER TEST STARTED (NORMAL CAPTCHA) [=]");

            //var s = ChromeDriverService.CreateDefaultService();
            //s.HideCommandPromptWindow = true;
            var options = new InternetExplorerOptions();

            var driverService = InternetExplorerDriverService.CreateDefaultService();

            driverService.HideCommandPromptWindow = true;

            var d = new InternetExplorerDriver(driverService, new InternetExplorerOptions());

            // ChromeDriver d = new ChromeDriver(s);
            try
            {
                d.Navigate().GoToUrl(TEST_PAGE_receita);               // go to normal test page
                                                                       // complete regular data
                var xID = "ctl00_ContentPlaceHolder1_txtChaveAcessoCompleta";

                d.FindElementById(xID).SendKeys("35190700214121000217570010005716071769317990");
                //d.SwitchTo().Frame(0);
                //d.FindElementById("recaptcha-anchor").Click();

                //d.FindElementByName("password").SendKeys("113001");
                //Console.WriteLine("[+] Completed regular info");
                // ---------------------

                // get sitekey
                string site_key = d.FindElementByClassName("g-recaptcha").GetAttribute("data-sitekey");
                Console.WriteLine(string.Format("[+] Site key: {0}", site_key));


                // complete captcha

                Console.WriteLine("[+] Waiting for recaptcha to be solved ...");
                ImageTypersAPI i = new ImageTypersAPI(IMAGETYPERS_TOKEN);
                Dictionary <string, string> p = new Dictionary <string, string>();
                p.Add("page_url", TEST_PAGE_receita);
                p.Add("sitekey", site_key);
                string recaptcha_id = i.submit_recaptcha(p);       // submit recaptcha info
                // while in progress, sleep for 10 seconds
                while (i.in_progress(recaptcha_id))
                {
                    Thread.Sleep(10000);
                }
                string g_response_code = i.retrieve_captcha(recaptcha_id);

                //Console.Write("CODE:"); Console.ReadLine(); string g_response_code = File.ReadAllText("g-response.txt");        // get manually
                Console.WriteLine(string.Format("[+] Got g-response-code: {0}", g_response_code));

                // set g-response-code in page source (with javascript)
                IJavaScriptExecutor e  = (IJavaScriptExecutor)d;
                string javascript_code = string.Format("document.getElementById('g-recaptcha-response').innerHTML = '{0}';", g_response_code);
                e.ExecuteScript(javascript_code);
                Console.WriteLine("[+] Code set in page");


                ////input[@id='ctl00_ContentPlaceHolder1_btnConsultar']
                /// name = ctl00$ContentPlaceHolder1$btnConsultar
                /// id = ctl00_ContentPlaceHolder1_btnConsultar
                ///
                try
                {
                    System.Threading.Thread.Sleep(7000);

                    var button = d.FindElementByCssSelector("input[value='Continuar']");


                    button.Click();
                    button.Click();

                    d.ExecuteScript("javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions('ctl00$ContentPlaceHolder1$btnConsultar', '', true, 'completa', '', false, false))");

                    Console.WriteLine("[+] btnConsulta submitted");
                }
                catch { }


                // javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ContentPlaceHolder1$btnConsultar", "", true, "completa", "", false, false))
                // submit form
                // d.FindElementByTagName("form").Submit();
                //  Console.WriteLine("[+] Form submitted");

                // botao download  ctl00_ContentPlaceHolder1_btnDownload
                Console.WriteLine("[+] botao download");
                System.Threading.Thread.Sleep(8000);
                //Download do documento
                var buttonDownload = d.FindElementByCssSelector("input[value='Download do documento']");
                buttonDownload.Click();
                //d.FindElementById("ctl00_ContentPlaceHolder1_btnDownload").Click();
            }
            catch (Exception ex)
            {
                string erro = ex.Message;
            }
            finally
            {
                Thread.Sleep(5000);
                // d.Quit();       // quit browser
                Console.WriteLine("[=] BROWSER TEST FINISHED [=]");
            }
        }
        /// <summary>
        /// Private _run method
        /// </summary>
        private void _run()
        {
            var a = this._arguments;        // for easier use local

            ImageTypersAPI i;
            var            token = a.get_token();

            if (string.IsNullOrWhiteSpace(token))
            {
                throw new Exception("token is missing");
            }
            i = new ImageTypersAPI(token);
            switch (a.get_mode())
            {
            case "get_balance":
                string balance = i.account_balance();
                this.show_output(balance);          // show balance
                break;

            case "submit_image":
                // solve normal captcha
                string captcha_file = a.get_captcha_file();
                if (string.IsNullOrWhiteSpace(captcha_file))
                {
                    throw new Exception("Invalid captcha file");
                }
                // optional params
                Dictionary <string, string> id = new Dictionary <string, string>();

                // optional
                if (a.is_case_sensitive())
                {
                    id.Add("iscase", "true");
                }
                if (a.get_is_phrase())
                {
                    id.Add("isphrase", "true");
                }
                if (a.get_is_math())
                {
                    id.Add("ismath", "true");
                }
                if (a.get_alpha_numeric() != -1)
                {
                    id.Add("alphanumeric", a.get_alpha_numeric().ToString());
                }
                if (a.get_min_length() != -1)
                {
                    id.Add("minlength", a.get_min_length().ToString());
                }
                if (a.get_max_length() != -1)
                {
                    id.Add("maxlength", a.get_max_length().ToString());
                }

                string captcha_id = i.submit_image(captcha_file, id);
                this.show_output(captcha_id);
                break;

            case "submit_recaptcha":
                string page_url = a.get_page_url();
                string site_key = a.get_site_key();
                if (string.IsNullOrWhiteSpace(page_url))
                {
                    throw new Exception("Invalid pageurl");
                }
                if (string.IsNullOrWhiteSpace(site_key))
                {
                    throw new Exception("Invalid sitekey");
                }

                Dictionary <string, string> d = new Dictionary <string, string>();
                d.Add("page_url", page_url);
                d.Add("sitekey", site_key);

                // optional
                if (!string.IsNullOrWhiteSpace(a.get_type()))
                {
                    d.Add("type", a.get_type());
                }
                if (!string.IsNullOrWhiteSpace(a.get_v3_action()))
                {
                    d.Add("v3_action", a.get_v3_action());
                }
                if (!string.IsNullOrWhiteSpace(a.get_v3_score()))
                {
                    d.Add("v3_min_score", a.get_v3_score());
                }
                if (!string.IsNullOrWhiteSpace(a.get_user_agent()))
                {
                    d.Add("user_agent", a.get_user_agent());
                }
                if (!string.IsNullOrWhiteSpace(a.get_datas()))
                {
                    d.Add("data-s", a.get_datas());
                }
                if (!string.IsNullOrWhiteSpace(a.get_cookie_input()))
                {
                    d.Add("cookie_input", a.get_cookie_input());
                }
                if (!string.IsNullOrWhiteSpace(a.get_proxy()))
                {
                    d.Add("proxy", a.get_proxy());
                }
                if (!string.IsNullOrWhiteSpace(a.get_user_agent()))
                {
                    d.Add("user_agent", a.get_user_agent());
                }
                string cid = i.submit_recaptcha(d);
                this.show_output(cid);
                break;

            case "submit_hcaptcha":
                string page_urlh = a.get_page_url();
                string site_keyh = a.get_site_key();
                if (string.IsNullOrWhiteSpace(page_urlh))
                {
                    throw new Exception("Invalid pageurl");
                }
                if (string.IsNullOrWhiteSpace(site_keyh))
                {
                    throw new Exception("Invalid sitekey");
                }
                Dictionary <string, string> dh = new Dictionary <string, string>();
                if (!string.IsNullOrWhiteSpace(a.get_proxy()))
                {
                    dh.Add("proxy", a.get_proxy());
                }
                if (!string.IsNullOrWhiteSpace(a.get_user_agent()))
                {
                    dh.Add("user_agent", a.get_user_agent());
                }
                if (a.get_invisible_hcaptcha())
                {
                    dh.Add("invisible", "1");
                }
                dh.Add("page_url", page_urlh);
                dh.Add("sitekey", site_keyh);
                string hcaptcha_id_sub = i.submit_hcaptcha(dh);
                this.show_output(hcaptcha_id_sub);
                break;

            case "submit_capy":
                string page_urlc = a.get_page_url();
                string site_keyc = a.get_site_key();
                if (string.IsNullOrWhiteSpace(page_urlc))
                {
                    throw new Exception("Invalid pageurl");
                }
                if (string.IsNullOrWhiteSpace(site_keyc))
                {
                    throw new Exception("Invalid sitekey");
                }

                Dictionary <string, string> dc = new Dictionary <string, string>();
                if (!string.IsNullOrWhiteSpace(a.get_proxy()))
                {
                    dc.Add("proxy", a.get_proxy());
                }
                if (!string.IsNullOrWhiteSpace(a.get_user_agent()))
                {
                    dc.Add("user_agent", a.get_user_agent());
                }
                dc.Add("page_url", page_urlc);
                dc.Add("sitekey", site_keyc);
                string capy_id_sub = i.submit_capy(dc);
                this.show_output(capy_id_sub);
                break;

            case "submit_geetest":
                string gt_domain    = a.get_gt_domain();
                string gt_challenge = a.get_gt_challenge();
                string gt_gt        = a.get_gt_gt();
                if (string.IsNullOrWhiteSpace(gt_domain))
                {
                    throw new Exception("Invalid domain");
                }
                if (string.IsNullOrWhiteSpace(gt_challenge))
                {
                    throw new Exception("Invalid challenge");
                }
                if (string.IsNullOrWhiteSpace(gt_gt))
                {
                    throw new Exception("Invalid gt");
                }

                Dictionary <string, string> dg = new Dictionary <string, string>();
                dg.Add("domain", gt_domain);
                dg.Add("challenge", gt_challenge);
                dg.Add("gt", gt_gt);

                // optional
                if (!string.IsNullOrWhiteSpace(a.get_proxy()))
                {
                    dg.Add("proxy", a.get_proxy());
                }
                if (!string.IsNullOrWhiteSpace(a.get_user_agent()))
                {
                    dg.Add("user_agent", a.get_user_agent());
                }
                string geetest_id_sub = i.submit_geetest(dg);
                this.show_output(geetest_id_sub);
                break;

            case "submit_geetest_v4":
                string gt_v4_domain    = a.get_gt_domain();
                string gt_v4_geetestid = a.get_gt_geetestid();
                if (string.IsNullOrWhiteSpace(gt_v4_domain))
                {
                    throw new Exception("Invalid domain");
                }
                if (string.IsNullOrWhiteSpace(gt_v4_geetestid))
                {
                    throw new Exception("Invalid geetestid");
                }

                Dictionary <string, string> dg4 = new Dictionary <string, string>();
                dg4.Add("domain", gt_v4_domain);
                dg4.Add("geetestid", gt_v4_geetestid);

                // optional
                if (!string.IsNullOrWhiteSpace(a.get_proxy()))
                {
                    dg4.Add("proxy", a.get_proxy());
                }
                if (!string.IsNullOrWhiteSpace(a.get_user_agent()))
                {
                    dg4.Add("user_agent", a.get_user_agent());
                }
                string geetest_v4_id_sub = i.submit_geetest_v4(dg4);
                this.show_output(geetest_v4_id_sub);
                break;

            case "submit_tiktok":
                string page_urlt    = a.get_page_url();
                string cookie_input = a.get_cookie_input();
                if (string.IsNullOrWhiteSpace(page_urlt))
                {
                    throw new Exception("Invalid pageurl");
                }
                if (string.IsNullOrWhiteSpace(cookie_input))
                {
                    throw new Exception("Invalid cookie_input");
                }

                Dictionary <string, string> dcc = new Dictionary <string, string>();
                if (!string.IsNullOrWhiteSpace(a.get_proxy()))
                {
                    dcc.Add("proxy", a.get_proxy());
                }
                if (!string.IsNullOrWhiteSpace(a.get_user_agent()))
                {
                    dcc.Add("user_agent", a.get_user_agent());
                }
                dcc.Add("page_url", page_urlt);
                dcc.Add("cookie_input", cookie_input);
                string tiktok_id = i.submit_tiktok(dcc);
                this.show_output(tiktok_id);
                break;

            case "submit_funcaptcha":
                string page_urlfc = a.get_page_url();
                string site_keyfc = a.get_site_key();
                if (string.IsNullOrWhiteSpace(page_urlfc))
                {
                    throw new Exception("Invalid pageurl");
                }
                if (string.IsNullOrWhiteSpace(site_keyfc))
                {
                    throw new Exception("Invalid sitekey");
                }
                Dictionary <string, string> dcf = new Dictionary <string, string>();
                dcf.Add("page_url", page_urlfc);
                dcf.Add("sitekey", site_keyfc);

                // others
                if (!string.IsNullOrWhiteSpace(a.get_s_url()))
                {
                    dcf.Add("s_url", a.get_s_url());
                }
                if (!string.IsNullOrWhiteSpace(a.get_data()))
                {
                    dcf.Add("data", a.get_data());
                }
                if (!string.IsNullOrWhiteSpace(a.get_proxy()))
                {
                    dcf.Add("proxy", a.get_proxy());
                }
                if (!string.IsNullOrWhiteSpace(a.get_user_agent()))
                {
                    dcf.Add("user_agent", a.get_user_agent());
                }
                string funcaptcha_id = i.submit_funcaptcha(dcf);
                this.show_output(funcaptcha_id);
                break;

            case "retrieve_response":
                string kid = a.get_captcha_id();
                if (string.IsNullOrWhiteSpace(kid))
                {
                    throw new Exception("id is invalid");
                }
                var recaptcha_response = i.retrieve_response(kid); // get recaptcha response
                this.show_output(recaptcha_response);              // show response
                break;

            case "set_captcha_bad":
                string bad_id = a.get_captcha_id();
                if (string.IsNullOrWhiteSpace(bad_id))
                {
                    throw new Exception("id is invalid");
                }
                string response = i.set_captcha_bad(bad_id); // set it bad
                this.show_output(response);                  // show response
                break;

            default:
                throw new Exception("invalid mode");
            }
        }