GeeTest CAPTCHA 演示

本页介绍如何显示 GeeTest CAPTCHA 以及 GeeTest CAPTCHA 验证的工作原理。 GeeTest验证码需要移动拼图碎片或按顺序选取数据进行破解。

GeeTest加载中。。。。。。
GeeTest CAPTCHA的徽标

在许多情况下,GeeTest CAPTCHA会妨碍无障碍访问,使用户感到沮丧,限制对公开信息的访问,使应用程序和网站的测试变得困难。使用 GeeTest CAPTCHA 解算器可自动绕过这些障碍。

如何破解GeeTest

  1. 在目标网站上找到以下GeeTest captcha参数(通常您可以在initGeetest函数中找到它们):
    gt - 公共网站密钥(静态)
    challenge - 动态挑战密钥
    api_server - API域名(可选)

    重要事项:您需要为向我们的API发送的的每个请求获取一个新的挑战值。一旦captcha在页面上加载,挑战值就无效了。您应该检查页面加载时向网站发出的请求,以识别获取了新挑战值的请求。 然后,您应该每次都提出这样的请求以获得有效的挑战值。

  2. 将这些参数发送到我们的API.

    使用SDK(推荐):

    PHP

    // https://github.com/2captcha/2captcha-php
    
    require(__DIR__ . '/../src/autoloader.php');
    
    $solver = new \TwoCaptcha\TwoCaptcha('YOUR_API_KEY');
    
    try {
        $result = $solver->geetest([
            'gt'        => '81388ea1fc187e0c335c0a8907ff2625',
            'apiServer' => 'api.geetest.com',
            'challenge' => '12345678abc90123d45678ef90123a456b',
            'url'       => 'https://2captcha.cn/demo/geetest',
        ]);
    } catch (\Exception $e) {
        die($e->getMessage());
    }
    
    die('Captcha solved: ' . $result->code);

    Python

    # https://github.com/2captcha/2captcha-python
    
    import sys
    import os
    import requests
    sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
    
    from twocaptcha import TwoCaptcha
    
    api_key = os.getenv('APIKEY_2CAPTCHA', 'YOUR_API_KEY')
    
    solver = TwoCaptcha(api_key)
    
    resp = requests.get("http://2captcha.cn/demo/geetest")
    challenge = resp.content.decode('utf-8').split(';')[0]
    
    try:
        result = solver.geetest(gt='f3bf6dbdcf7886856696502e1d55e00c',
                                apiServer='api.geetest.com',
                                challenge=challenge,
                                url='https://2captcha.cn/demo/geetest')
    
    except Exception as e:
        sys.exit(e)
    
    else:
        sys.exit('solved: ' + str(result))

    Java

    // https://github.com/2captcha/2captcha-java
    
    package examples;
    
    import com.twocaptcha.TwoCaptcha;
    import com.twocaptcha.captcha.GeeTest;
    
    public class GeeTestExample {
        public static void main(String[] args) {
            TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
            GeeTest captcha = new GeeTest();
            captcha.setGt("81388ea1fc187e0c335c0a8907ff2625");
            captcha.setApiServer("api.geetest.com");
            captcha.setChallenge("12345678abc90123d45678ef90123a456b");
            captcha.setUrl("https://2captcha.cn/demo/geetest");
            try {
                solver.solve(captcha);
                System.out.println("Captcha solved: " + captcha.getCode());
            } catch (Exception e) {
                System.out.println("Error occurred: " + e.getMessage());
            }
        }
    }

    C#

    // https://github.com/2captcha/2captcha-csharp
    
    using System;
    using System.Linq;
    using TwoCaptcha.Captcha;
    
    namespace TwoCaptcha.Examples
    {
        public class GeeTestExample
        {
            public void Main()
            {
                TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");
                GeeTest captcha = new GeeTest();
                captcha.SetGt("81388ea1fc187e0c335c0a8907ff2625");
                captcha.SetApiServer("api.geetest.com");
                captcha.SetChallenge("12345678abc90123d45678ef90123a456b");
                captcha.SetUrl("https://2captcha.cn/demo/geetest");
                try
                {
                    solver.Solve(captcha).Wait();
                    Console.WriteLine("Captcha solved: " + captcha.Code);
                }
                catch (AggregateException e)
                {
                    Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message);
                }
            }
        }
    }

    Go

    // https://github.com/2captcha/2captcha-go
    
    package main
    
    import (
        "fmt"
        "log"
        "github.com/2captcha/2captcha-go"
    )
    
    func main() {
        client := api2captcha.NewClient("API_KEY")
        captcha := api2captcha.GeeTest{
            GT: "81388ea1fc187e0c335c0a8907ff2625",
            ApiServer: "api.geetest.com",
            Challenge: "12345678abc90123d45678ef90123a456b",
            Url: "https://2captcha.cn/demo/geetest",
        }
        code, err := client.Solve(captcha.ToRequest())
        if err != nil {
            log.Fatal(err);
        }
        fmt.Println("code "+code)
    }

    C++

    // https://github.com/2captcha/2captcha-cpp
    
    #include <cstdio>
    
    #include "curl_http.hpp"
    #include "api2captcha.hpp"
    
    int main (int ac, char ** av)
    {
    api2captcha::curl_http_t http;
    http.set_verbose (true);
    
    api2captcha::client_t client;
    client.set_http_client (&http);
    client.set_api_key (API_KEY);
    
    api2captcha::geetest_t cap;
    cap.set_gt ("81388ea1fc187e0c335c0a8907ff2625");
    cap.set_api_server ("api.geetest.com");
    cap.set_challenge ("12345678abc90123d45678ef90123a456b");
    cap.set_url ("https://2captcha.cn/demo/geetest");
    
    try
    {
        client.solve (cap);
        printf ("code '%s'\n", cap.code ().c_str ());
    }
    catch (std::exception & e)
    {
        fprintf (stderr, "Failed: %s\n", e.what ());
    }
    
    return 0;   
    }

    Ruby

    # https://github.com/2captcha/2captcha-ruby
    require 'api_2captcha'
    
    client =  Api2Captcha.new("YOUR_API_KEY")
    
    result = client.geetest({
      gt: 'f1ab2cdefa3456789012345b6c78d90e',
      api_server: 'api-na.geetest.com',
      challenge: '12345678abc90123d45678ef90123a456b',
      pageurl: 'https://www.site.com/page/'
    })

    手动操作:

    1. 向我们的API URL:https://2captcha.cn/in.php提交HTTP GET或POST请求,method设置为geetest,提供在上一步请求中找到的值作为相应请求参数的值,并提供整页URL作为 pageurl值。
      请求URL示例:
      https://2captcha.cn/in.php?key=1abc234de56fab7c89012d34e56fa7b8&method=geetest&gt=929c4274113891610f91fecd8f98f84a&challenge=12345678abc90123d45678ef90123a456b&api_server=api-na.geetest.com&pageurl=http://2captcha.cn/demo/geetest

    2. 如果一切正常,服务器将返回您的captcha ID:

      OK|2122988149
      否则服务器将返回错误代码.

    3. 15-20秒后发送GET请求以获取结果:

      GET https://2captcha.cn/res.php?key=YOUR_API_KEY&action=get&id=2122988149
      如果验证码已破解,服务器将响应答案。

      如果captcha未破解,服务器将返回 CAPCHA_NOT_READY结果。在5秒内重复您的请求。如果出现问题,服务器将返回错误代码

  3. 如果captcha已破解,服务器将以JSON返回响应。响应包含三个值:challengevalidateseccode:

    {
        "challenge": "1a2b3456cd67890e12345fab678901c2de",
        "validate": "09fe8d7c6ba54f32e1dcb0a9fedc8765",
        "seccode": "12fe3d4c56789ba01f2e345d6789c012|jordan"
    }
  4. 使用从我们的API收到的值将您的请求提交到目标网站,将值填入相应的请求字段:

    geetest_challenge
    geetest_validate
    geetest_seccode
  5. 点击"检查"按钮提交表格。