Giter Site home page Giter Site logo

dzmitry-duboyski / geetest-demo Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 490 KB

This is demonstration how to solve GeeTest captcha (行为验证) with puppeteer (JavaScript) and 2captcha service

JavaScript 100.00%
geetest geetest-captcha geetest-solver puppeteer 2captcha 2captcha-api javascript nodejs puppeteer-demo

geetest-demo's Introduction

English | **语文科 | Русский

geetest captcha

Example for solving of GeeTest Captcha in JavaScript using Puppeteer library

Description

This example clearly shows how you can automate the GeeTest captcha solution. In the example, the captcha is bypassed on the demo page, but the principle of bypassing the captcha is similar everywhere.

How to start

Cloning:

git clone https://github.com/dzmitry-duboyski/GeeTest-demo.git

Installing dependencies:

npm install

Set your apikey in .env file

Start:

npm run start


GeeTest security platform is used on many popular sites. In this manual, it is described how to successfully undergo a GeeTest security check using service 2Captcha.com and Puppeteer. For a successful check of the GeeTest captcha, you must have an account in the 2Captcha.com service.

This example describes how to solve captcha GeeTest on the demo page https://2captcha.com/demo/geetest.

Description of the GeeTest solution algorithm:

  1. Find captcha parameters gt, challenge, api_server:

    1.1. You can find the value of gt in the page code. Screenshot: the gt value in the page code

    1.2 Finding the meaning of challenge is a bit more difficult. To do this, you need to find the request that the captcha makes on this page, this request must contain the value challenge.

    The response to the request will be in the following format: {"success":1,"challenge":"21aaa1c62221631516179b492b9e80cc","gt":"81388ea1fc187e0c335c0a8907ff2625"}. From this answer, you need to take the value challenge.

    If we consider the example with a captcha on the page https://2captcha.com/demo/geetest, then in this case it will be a request to https://2captcha.com/api/v1/captcha-demo/gee-test/. The response to this request contains the required challenge'. Response: {"success":1,"challenge":"21aaa1c62221631516179b492b9e80cc","gt":"81388ea1fc187e0c335c0a8907ff2625"}`.

    Screenshot: the challenge value in the page code

    You can read more about the challenge on the page.

  2. Sending captcha to API.

To solve the captcha, you need to send the found captcha parameters to the API:

"key":"your_api_key",
"method":"geetest"
"pageurl":"https://2captcha.com/demo/geetest"
"gt": "81388ea1fc187e0c335c0a8907ff2625",
"challenge": "21aaa1c62221631516179b492b9e80cc"
  1. Getting a answer for Captcha.

After successfully solving the captcha, the API will return a response with the solution. Example of a response with a solution from the API:

{
   "status": 1,
   "request": {
       "geetest_challenge": "fd4847c8a368356a0e3a6636392c2854k9",
       "geetest_validate": "4606cdf89c8c2e5a43c5a14fe475fc40",
       "geetest_seccode": "4606cdf89c8c2e5a43c5a14fe475fc40|jordan"
   }
}
  1. Using the solution. The resulting values must be inserted into the corresponding html elements of the GeeTest captcha on the page.

Example:

<div class="geetest_form">
  <input type="hidden" name="geetest_challenge" value="fd4847c8a368356a0e3a6636392c2854k9">
  <input type="hidden" name="geetest_validate" value="4606cdf89c8c2e5a43c5a14fe475fc40">
  <input type="hidden" name="geetest_seccode" value="4606cdf89c8c2e5a43c5a14fe475fc40">
</div>

Screenshot: inserting the answer into the html elements of the GeeTest captcha on the page

Done. After that, you can proceed to perform actions on the page. In this example, after that, the "Check" button is clicked.

The source code is available in the file index.js

Additional information:

geetest-demo's People

Contributors

dzmitry-duboyski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

geetest-demo's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.