{"id":457191,"date":"2025-04-24T09:00:49","date_gmt":"2025-04-24T09:00:49","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=457191"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2025-04-24T09:00:49","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=457191","title":{"rendered":"<span>GeeTest CAPTCHA Bypass: How to Solve a Sophisticated Anti-Bot System<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>One could write, \u201cExperienced developers working on parsing and automation often face the need to bypass modern CAPTCHAs.\u201d But that\u2019s too boring\u2026 I\u2019d rather start like this\u2014continuing to explore the amusing world of CAPTCHAs, I finally stumbled upon the Chinese variant of protection: the GeeTest CAPTCHA. Let\u2019s break down what this beast is, where it dwells, and why you should (or shouldn\u2019t) fear it\u2026 You\u2019ll understand as we go!<\/p>\n<p>GeeTest is one of the advanced anti-bot systems combining user puzzles with behavioral analysis. I decided to take a close look at recognizing the GeeTest CAPTCHA under real-world conditions and figure out how to bypass GeeTest with various methods. But first\u2014a classic introduction (which, by the way, may be more interesting than the practical part of the article, since bypassing the GeeTest CAPTCHA is already a non-trivial task for many readers).<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dea\/d92\/37b\/dead9237b211aeb07c9cb4ba0612e0c4.jpg\" width=\"857\" height=\"1202\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/dea\/d92\/37b\/dead9237b211aeb07c9cb4ba0612e0c4.jpg 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dea\/d92\/37b\/dead9237b211aeb07c9cb4ba0612e0c4.jpg 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h3>What Is GeeTest and Why Is This CAPTCHA Difficult (You Need Know it For Successful Bypass Geetest)?<\/h3>\n<p><strong>GeeTest<\/strong> (developer: Chinese company GeeTest) is a modern CAPTCHA system designed to protect websites from bots. Unlike classic \u201cEnter the characters from the image,\u201d GeeTest emphasizes interactive puzzles: for example, the user must slide a puzzle piece or solve a mini-game. Meanwhile, the system analyzes user behavior (mouse movements, solving speed, clicks) and collects extensive device information (so\u2011called <code><em>device fingerprint<\/em><\/code>). All of this complicates automatic recognition.<\/p>\n<p>The hallmark of GeeTest is <strong>adaptivity<\/strong>: when the system suspects a bot, the challenges become harder. For instance, a genuine user may only see a simple one-step slider, whereas suspicious traffic will get a series of complex tasks. Such multi-level protection greatly raises the bar for bots.<\/p>\n<p><strong>Key reasons why bypassing GeeTest can be fatal for some scripts:<\/strong><\/p>\n<ul>\n<li>\n<p><strong>Interactive challenges.<\/strong> You must emulate real interactions (dragging the slider, clicking objects, etc.), not just recognize text or move a slider from point A to B.<\/p>\n<\/li>\n<li>\n<p><strong>Behavioral analysis.<\/strong> GeeTest tracks cursor trajectory, pauses, movement sharpness, attempts, and more. Atypical \u201crobotic\u201d behavior leads to failure.<\/p>\n<\/li>\n<li>\n<p><strong>Device fingerprinting.<\/strong> The CAPTCHA gathers browser\/system data: User-Agent, screen resolution, installed plugins, fonts, time zone, Canvas\/WebGL fingerprint, and more. If these look suspicious (e.g., typical of an automated browser), the system may either escalate the challenge or block the attempt entirely.<\/p>\n<\/li>\n<li>\n<p><strong>Obfuscation and server\u2011side validation.<\/strong> GeeTest scripts are heavily obfuscated (especially in v4), and final answers are verified server\u2011side via tokens. You can\u2019t simply guess the puzzle position\u2014you must correctly form the response that the server will accept.<\/p>\n<\/li>\n<\/ul>\n<p>Thus, GeeTest poses a serious challenge for developers in parsing and automation. Yet, there are still ways to bypass this CAPTCHA\u2014let\u2019s explore them next.<\/p>\n<hr\/>\n<h3>GeeTest v3 vs. v4: CAPTCHA Evolution (Differents with Bypassing)<\/h3>\n<p>GeeTest has undergone several iterations, with versions v3 and v4 being the most widespread. Understanding their differences is crucial for choosing a bypass method.<\/p>\n<ul>\n<li>\n<p><strong>GeeTest v3<\/strong> (classic version) presents a visible CAPTCHA (most often a slider puzzle). Initialization uses two parameters in the page\u2019s code:<\/p>\n<ol>\n<li>\n<p><code>gt<\/code> \u2013 the site ID in the GeeTest system (public key).<\/p>\n<\/li>\n<li>\n<p><code>challenge <\/code>\u2013 a unique challenge string for the current session.<\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p>Typically, the page loads <code>gt.js<\/code> from the GeeTest server, and solving it triggers requests like <code>\/get.php<\/code> and <code>\/validate.php<\/code>. Version 3 supports several challenge types: <em>Slide CAPTCHA<\/em> (slider puzzle), <em>Icon CAPTCHA<\/em> (select\/drag icons), <em>Space CAPTCHA<\/em>, etc.<\/p>\n<\/li>\n<li>\n<p><strong>GeeTest v4<\/strong> (Adaptive CAPTCHA) is the newer, more flexible version with invisible modes. Key differences:<\/p>\n<ol>\n<li>\n<p>Instead of <code>gt + challenge<\/code>, it uses a single <code>captcha_id<\/code> (analogous to <code>gt<\/code>), and all other parameters are passed in an <code>initParameters<\/code> object during initialization. In practice, the frontend calls <code>initGeetest4<\/code> with an options object where <code>captcha_id<\/code> is primary.<\/p>\n<\/li>\n<li>\n<p>Scripts load from paths containing <code>\/v4\/<\/code> (e.g., <code>gcaptcha4.js<\/code>), which is evident in traffic analysis.<\/p>\n<\/li>\n<li>\n<p><strong>Adaptivity<\/strong>: v4 dynamically adjusts difficulty. If a user seems \u201cclean,\u201d the CAPTCHA may run in silent mode (barely noticeable). v4 features a <em>NoCaptcha<\/em> mode with a single \u201cVerify\u201d button\u2014background checks have already confirmed human traffic. For suspicious users, v4 will impose a series of tough trials.<\/p>\n<\/li>\n<li>\n<p>The v4 protocol is more complex: user interaction data is packaged and encrypted before sending to the server. In v4, the parameter w is an encrypted \u201canswer\u201d containing all user actions, timestamps, etc., calculated in an obfuscated script, making it hard to forge without replicating the full logic.<\/p>\n<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<p>To detect the version on a site, inspect the page code and network requests: if you see <code>gt <\/code>and <code>challenge<\/code>, it\u2019s v3; if the CAPTCHA loads via <code>gcaptcha4.geetest.com<\/code> with <code>captcha_id<\/code>, it\u2019s v4. For example, a typical v4 load URL:<\/p>\n<pre><code class=\"python\">https:\/\/gcaptcha4.geetest.com\/load?captcha_id=&lt;ID&gt;&amp;challenge=&lt;UUID&gt;<\/code><\/pre>\n<p>Here, <code>captcha_id<\/code> is the key, and a dynamic <code>challenge <\/code>is generated per case. In v3, you usually find <code>challenge <\/code>directly in the HTML or initialization data.<\/p>\n<hr\/>\n<h3>Types of GeeTest Challenges: Slider, Icons, \u201cFifteen Puzzle,\u201d and Mini\u2011Games &#8212; Smart Bypass GeeTest<\/h3>\n<p>Over the years, GeeTest has introduced a variety of challenge types. Here are the main ones a developer might encounter:<\/p>\n<ol>\n<li>\n<p><strong>Slide CAPTCHA (slider puzzle).<\/strong> The classic GeeTest: an image with a missing fragment and a separate puzzle piece. The user must drag the slider so the piece fits perfectly into the gap. Although it looks simple, the system evaluates how smoothly and human\u2011like you moved the piece. <strong>Bot task<\/strong>: determine the offset of the cutout and simulate human cursor movement. Slide CAPTCHA appears in both v3 and v4 (it remains the most common challenge).<\/p>\n<\/li>\n<\/ol>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/207\/9a6\/841\/2079a68417eec2204810d02499904436.jpg\" width=\"392\" height=\"377\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/207\/9a6\/841\/2079a68417eec2204810d02499904436.jpg 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/207\/9a6\/841\/2079a68417eec2204810d02499904436.jpg 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<ul>\n<li>\n<p><strong>Click\/Icon CAPTCHA.<\/strong> The user sees images or icons and must click all that meet the prompt (e.g., \u201cFind all the cats among these pictures\u201d) or drag icons to match their shadows. GeeTest records click coordinates and timing\u200b. In v3, Icon CAPTCHA was rarer; in v4 it\u2019s been technically enhanced.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/795\/46f\/f1d\/79546ff1dc077980606d713aaeef99ef.png\" width=\"411\" height=\"440\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/795\/46f\/f1d\/79546ff1dc077980606d713aaeef99ef.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/795\/46f\/f1d\/79546ff1dc077980606d713aaeef99ef.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<ul>\n<li>\n<p><strong>IconCrush CAPTCHA.<\/strong> A v4\u2011specific type: a grid of icons similar to a \u201cmatch\u2011three\u201d game, where the user must select three identical icons in a row\u200b. It\u2019s a mini\u2011game requiring image\u2011analysis to identify identical elements\u2014challenging for bots.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/633\/e35\/e23\/633e35e237ecb73f0bccd169b71e75c6.png\" width=\"1000\" height=\"1000\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/633\/e35\/e23\/633e35e237ecb73f0bccd169b71e75c6.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/633\/e35\/e23\/633e35e237ecb73f0bccd169b71e75c6.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<ul>\n<li>\n<p><strong>Gobang CAPTCHA.<\/strong> Named after the game \u201c\u4e94\u5b50\u68cb\u201d (Gobang\/five\u2011in\u2011a\u2011row). The user places stones on a board trying to get five in a row\u200b. This simple puzzle is used under high suspicion. For a bot, solving Gobang means either fully simulating gameplay (non\u2011trivial) or avoiding reaching this stage by passing earlier, easier challenges.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/78b\/217\/585\/78b21758503f342fa65b645dff426530.png\" width=\"1000\" height=\"1000\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/78b\/217\/585\/78b21758503f342fa65b645dff426530.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/78b\/217\/585\/78b21758503f342fa65b645dff426530.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<ul>\n<li>\n<p><strong>Space CAPTCHA.<\/strong> Mentioned in v3 docs, likely another click\u2011based task: place objects into correct \u201cspaces\u201d or slots. Details are scarce; I haven\u2019t personally encountered a clear example, nor found precise illustrations. The goal is similar: verify dynamic user actions when positioning objects.<\/p>\n<\/li>\n<li>\n<p><strong>NoCAPTCHA (OneTap).<\/strong> Like reCAPTCHA v2 Checkbox: the user simply clicks \u201cI\u2019m not a robot.\u201d Behind the scenes, GeeTest conducts extensive checks\u2014behavioral analysis, fingerprints, hidden JavaScript tests, maybe even Proof\u2011of\u2011Work\u200b. If everything looks legitimate, one click suffices; otherwise, a full challenge (slider or other) may appear. NoCAPTCHA is common for real users; for us, it means v4 may show no visible puzzle if traffic seems human.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3ae\/2af\/9e6\/3ae2af9e6af59e93b1cedb2134144f68.png\" width=\"1000\" height=\"1004\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/3ae\/2af\/9e6\/3ae2af9e6af59e93b1cedb2134144f68.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3ae\/2af\/9e6\/3ae2af9e6af59e93b1cedb2134144f68.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>GeeTest continually experiments. Other types (e.g., Image CAPTCHA\u2014reordering image fragments\u2014or audio CAPTCHA for vision\u2011impaired users) may appear. The above are the most known and illustrative from a bypass perspective.<\/p>\n<hr\/>\n<h3>How GeeTest Identifies Bots: Behavior and Fingerprints &#8212; Making Bypass GeeTest Easier<\/h3>\n<p>Before exploring solutions, it\u2019s vital to understand which signals GeeTest uses to distinguish bots from humans. This knowledge helps you emulate human behavior convincingly (or reveals the difficulty if you lack the skill).<\/p>\n<h4>Behavioral Analysis<\/h4>\n<p>Every interaction stage is tracked. For sliders, the system logs cursor trajectory (X\/Y coordinates every millisecond), jerks, pauses. A movement that\u2019s too straight, without micro\u2011oscillations, looks scripted. Teleporting the cursor or constant speed also flags a bot. Reaction time matters: humans won\u2019t start dragging the slider in the exact millisecond the widget loads, but bots might. For click CAPTCHAs, the order and speed of clicks matter. Icon CAPTCHA checks how quickly and accurately you dragged icons\u200b\u2014too fast or too precise will raise suspicion\u200b. All data is sent to the server (partially in clear in v3, fully encrypted inside <code>w <\/code>in v4).<\/p>\n<h4>Device Fingerprinting<\/h4>\n<p>GeeTest collects browser info via JavaScript:<\/p>\n<ul>\n<li>\n<p>Screen parameters: resolution, color depth, viewport size.<\/p>\n<\/li>\n<li>\n<p>Browser data: User-Agent, presence of <code>webdriver <\/code>(WebDriver flag), plugin and MIME\u2011type lists, platform, language, time zone.<\/p>\n<\/li>\n<li>\n<p>Canvas\/WebGL fingerprint: draws hidden content on a <code>&lt;canvas&gt;<\/code> and reads pixel data (different systems yield slightly different patterns), checks the WebGL renderer.<\/p>\n<\/li>\n<li>\n<p>Audio fingerprinting: creates an <code>AudioContext <\/code>and records minute variations in generated sound.<\/p>\n<\/li>\n<li>\n<p>Fonts: enumerates installed fonts hiddenly.<\/p>\n<\/li>\n<\/ul>\n<p>Together, these form a unique \u201cfingerprint.\u201d If a bot repeatedly presents the same fingerprint, it can be detected. Or if the fingerprint is atypical (e.g., a headless browser), the system will escalate\u200b. For example, Headless Chrome sets <code>navigator.webdriver=true<\/code>\u2014GeeTest checks that and can instantly harden the challenge.<\/p>\n<h4>Network Information (IP, Proxy)<\/h4>\n<p>IP address, geolocation, and proxy usage factor in. Known VPN or datacenter IPs almost always get a tougher challenge. Multiple attempts from one IP within minutes look like a botnet\/script. GeeTest may share data with other anti\u2011bot systems or use its own IP reputation databases.<\/p>\n<h4>General Heuristics<\/h4>\n<p>Like reCAPTCHA, GeeTest uses machine learning on huge datasets, analyzing hundreds of parameters server\u2011side (load times, JS call order, device performance, etc.). For instance, humans can\u2019t click ten distinct targets in 0.1 seconds or exhibit perfectly random movements\u2014you usually twitch before starting. Bots often act too linearly. Ultimately, GeeTest computes a trust score or directly decides pass\/fail. Anomalous behavior either leads to harder tasks or outright failure, regardless of a correct puzzle answer. Therefore, bypassing requires not just solving the puzzle correctly, but doing so in a convincingly human manner.<\/p>\n<hr\/>\n<h3>Approaches to Solving and Bypassing the GeeTest CAPTCHA<\/h3>\n<p>Let\u2019s move to the most interesting part: bypass methods. There\u2019s no one\u2011size\u2011fits\u2011all solution\u2014it depends on the version, challenge type, and the site\u2019s anti\u2011bot strictness. Here are several approaches you can combine:<\/p>\n<h4>1. Using Third\u2011Party Services (RuCaptcha, 2Captcha, SolveCaptcha, etc.)<\/h4>\n<p>The simplest path is outsourcing CAPTCHA solving to a specialized service. Services like RuCaptcha\/2Captcha or SolveCaptcha employ real humans or proprietary ML models. You send the CAPTCHA parameters via API and receive a ready\u2011to\u2011use solution (tokens) to inject back into the site.<\/p>\n<p><strong>Example with 2Captcha<\/strong>:<br \/> You extract necessary parameters from the target page (for v3: <code>gt<\/code>, <code>challenge<\/code>, page URL; for v4: <code>captcha_id<\/code> and page URL\u20142Captcha fetches <code>challenge<\/code>). Then:<\/p>\n<pre><code class=\"python\">import requests, time  API_KEY = \"YOUR_2CAPTCHA_APIKEY\" website_url = \"https:\/\/example-with-captcha.com\/page\" gt = \"81388ea1fc187e0c335c0a8907ff2625\"          # gt value (v3) challenge = \"2e2f0f65240058b683cb6ea21c303eea6n\"  # challenge value (v3)  # 1. Send CAPTCHA task to 2Captcha payload = {     'key': API_KEY,     'method': 'geetest',     'gt': gt,     'challenge': challenge,     'pageurl': website_url } resp = requests.post(\"http:\/\/2captcha.com\/in.php\", data=payload) if resp.text.startswith(\"OK|\"):     captcha_id = resp.text.split('|')[1] else:     raise Exception(f\"2Captcha API error: {resp.text}\")  # 2. Poll for the result result = None result_url = f\"http:\/\/2captcha.com\/res.php?key={API_KEY}&amp;action=get&amp;id={captcha_id}\" for i in range(20):     time.sleep(5)  # wait 5 seconds between polls     res = requests.get(result_url)     if res.text == \"CAPCHA_NOT_READY\":         continue     if res.text.startswith(\"OK|\"):         result = res.text.split('|', 1)[1]         break  if not result:     raise Exception(\"Failed to get CAPTCHA solution in time\")  print(\"GeeTest solution:\", result) <\/code><\/pre>\n<p>For v3, the service usually returns JSON with <code>challenge<\/code>, <code>validate<\/code>, and <code>seccode<\/code>. For v4, it may return a different format (e.g., a single <code>captcha_output<\/code> token)\u2014check the service docs.<\/p>\n<p><strong>Injection<\/strong>: Inject the returned values back into the page\u2019s hidden form or call the appropriate JS callback. For v3, set the hidden fields <code>geetest_challenge<\/code>, <code>geetest_validate<\/code>, <code>geetest_seccode<\/code> and submit the form. For v4, call the CAPTCHA object\u2019s submit function or set the token.<\/p>\n<ul>\n<li>\n<p><strong>Pros<\/strong>: Minimal effort, solves most CAPTCHAs in 2\u201320 seconds, cost \u2248$0.001\u2013$0.002 per CAPTCHA.<\/p>\n<\/li>\n<li>\n<p><strong>Cons<\/strong>: External dependency, potential delays, cost. Complex challenges (Gobang, IconCrush) may fail or incur extra human intervention.<\/p>\n<\/li>\n<\/ul>\n<p><strong>Tip<\/strong>: Use proxyless mode if you don\u2019t need to relay your own IP, or proxy mode to solve from your address (helps if the site ties the CAPTCHA to your IP). RuCaptcha\/2Captcha support both via their GeeTestTask\/GeeTestTaskProxyless methods.<\/p>\n<p>Other services (e.g., SolveCaptcha) use neural nets first and fall back to humans\u2014also paid, sometimes more economical at scale. Conceptually identical: send images or parameters, receive the answer.<\/p>\n<p><strong>Conclusion<\/strong>: Third\u2011party services are ideal for quick prototypes or small\/large\u2011scale scraping. For full autonomy or speed, consider harder approaches.<\/p>\n<hr\/>\n<h4>2. Solving with OpenCV and Computer Vision Algorithms<\/h4>\n<p>This approach teaches your code to solve the CAPTCHA itself, especially suitable for graphic challenges like slider puzzles. The idea is to download the images, analyze them (find the cut\u2011out), and compute the required movement in pixels.<\/p>\n<p><strong>Common slider\u2011CAPTCHA case<\/strong>: You have two images\u2014background with a missing piece and the puzzle fragment. Using OpenCV:<\/p>\n<pre><code class=\"python\">import cv2 import numpy as np  # Load images (e.g., previously downloaded) background = cv2.imread(\"captcha_bg.png\", 0)  # background (grayscale) template   = cv2.imread(\"captcha_piece.png\", 0)  # puzzle piece  # Enhance images: apply edge detection to highlight the cut shape bg_edges  = cv2.Canny(background, 50, 150) tpl_edges = cv2.Canny(template, 50, 150)  # Perform template matching result = cv2.matchTemplate(bg_edges, tpl_edges, cv2.TM_CCOEFF_NORMED) _, max_val, _, max_loc = cv2.minMaxLoc(result)  match_x, match_y = max_loc print(f\"Found insertion position: X={match_x}px, Y={match_y}px (match {max_val:.2f})\") <\/code><\/pre>\n<p>Here, <code>match_x <\/code>is the horizontal offset where the piece should go (vertical <code>Y<\/code> is usually fixed). Next, you must emulate human-like slider movement using a browser automation library (Selenium, Puppeteer, Playwright):  <\/p>\n<pre><code class=\"python\">from selenium.webdriver import ActionChains import time, random  slider = driver.find_element(By.CSS_SELECTOR, \".geetest_slider_button\") actions = ActionChains(driver) actions.click_and_hold(slider).perform()  distance = match_x moved = 0 while moved &lt; distance:     step = random.randint(5, 8)     if moved + step &gt; distance:         step = distance - moved     actions.move_by_offset(xoffset=step, yoffset=0).perform()     moved += step     time.sleep(random.uniform(0.01, 0.03))  # Micro\u2011adjustments to mimic human tremor actions.move_by_offset(xoffset=-3, yoffset=0).perform() time.sleep(0.1) actions.move_by_offset(xoffset=3, yoffset=0).perform()  actions.release().perform()  <\/code><\/pre>\n<p>This script drags the slider in small, irregular steps with pauses and micro\u2011adjustments, emulating human motion. If done correctly, GeeTest will render the movement, validate it server\u2011side, and return <code>validate\/seccode<\/code> tokens.<\/p>\n<p><strong>CV can apply<\/strong> to other challenges too\u2014IconCrush or Gobang\u2014but they require more advanced image recognition or game\u2011logic solving. Some have resorted to building a hash-based database of all slider backgrounds: precompute offsets by matching hashes, then look up instantly.<\/p>\n<ul>\n<li>\n<p><strong>Pros<\/strong>: Independence from external services, millisecond\u2011level solves, full control.<\/p>\n<\/li>\n<li>\n<p><strong>Cons<\/strong>: Maintenance overhead\u2014must update for new designs or logic. Hard challenges (Gobang) may be impractical without deep AI work.<\/p>\n<\/li>\n<\/ul>\n<p>A <strong>hybrid<\/strong> strategy is powerful: try OpenCV first; if it fails or times out, fall back to 2Captcha. This balances speed, cost, and reliability.<\/p>\n<hr\/>\n<h4>3. Browser Automation and User Emulation (Selenium, Puppeteer)<\/h4>\n<p>While we used the browser above to apply the solution, some developers attempt to bypass without explicit recognition\u2014by brute\u2011forcing human\u2011like actions in a real browser.<\/p>\n<p><strong>Example<\/strong>: Without OpenCV or paid services, spin up Chrome\/Firefox under script control, wait for the widget, and attempt slider movements of varying lengths until success. Or for Icon CAPTCHA, inspect the DOM for hints or alt\u2011tags. This \u201chit\u2011and\u2011try\u201d method is generally unreliable\u2014GeeTest limits attempts and escalates on failure. Yet, it exists.<\/p>\n<p>More practical is a <strong>hybrid<\/strong>: use Puppeteer or Selenium to open the page (ensuring full JS execution), extract <code>gt\/challenge<\/code> or <code>captcha_id<\/code>, send to 2Captcha, then inject the result back via the browser. This addresses frontend quirks\u2014some sites expect the CAPTCHA to be solved in the live page context.<\/p>\n<p><strong>Puppeteer sketch<\/strong>:<\/p>\n<pre><code class=\"python\">\/\/ Extract parameters const gt        = await page.evaluate(() =&gt; window.gt); const challenge = await page.evaluate(() =&gt; window.challenge);  \/\/ Solve via API const solveResponse = await solveGeeTest(gt, challenge, page.url()); const { challenge: ch, validate, seccode } = solveResponse;  \/\/ Inject solution back await page.evaluate((ch, validate, seccode) =&gt; {     document.getElementById('geetest_challenge').value = ch;     document.getElementById('geetest_validate').value  = validate;     document.getElementById('geetest_seccode').value   = seccode;     document.querySelector('form#geetest-demo-form').submit(); }, ch, validate, seccode); <\/code><\/pre>\n<p><strong>Anti\u2011detection<\/strong> is critical: plain headless Selenium\/Puppeteer flags itself (<code>navigator.webdriver<\/code>, missing plugins, unusual headers). To avoid this:<\/p>\n<ul>\n<li>\n<p>Use stealth plugins (e.g., <code>puppeteer-extra-plugin-stealth<\/code>) or undetected-chromedriver.<\/p>\n<\/li>\n<li>\n<p>Set real User-Agent, add fake plugins, align timezone\/language with proxy region.<\/p>\n<\/li>\n<li>\n<p>Emulate human input events (mousemove, mousedown, small delays).<\/p>\n<\/li>\n<\/ul>\n<p>Full browser automation simulates a real user at the browser level. It consumes more resources but may be the only way against combined defenses (e.g., Cloudflare + GeeTest).<\/p>\n<hr\/>\n<h4>4. Reverse\u2011Engineering and Protocol Emulation<\/h4>\n<p>The most arduous\u2014yet \u201csporting\u201d\u2014method is fully reverse-engineering GeeTest\u2019s protocol to forge valid responses without a browser. GeeTest\u2019s JS is obfuscated; data is encrypted. Nonetheless, enthusiasts have:<\/p>\n<ul>\n<li>\n<p><strong>v3<\/strong>: Analyzed <code>gt.js<\/code> to understand request parameters for \/validate.php, including mouse-trail checks. Early versions had flaws allowing empty or fixed tracks\u200b\u2014these are long closed. Some bots now algorithmically generate plausible tracks server\u2011side without real browsers.<\/p>\n<\/li>\n<li>\n<p><strong>v4<\/strong>: Scrutinized <code>gcaptcha4.js<\/code> to decipher the encrypted w payload (which packs all user actions). By dissecting the obfuscated \u201clotParser\u201d and AES\/RSA routines, they replicated logic in Python to produce valid <code>validate <\/code>tokens, bypassing the browser altogether.<\/p>\n<\/li>\n<\/ul>\n<p>However, public successes prompt countermeasures: GeeTest frequently updates obfuscation, adds fields, tweaks algorithms. Reverse-engineering is a constant arms race. Yet understanding the protocol can reveal shortcuts\u2014e.g., direct image URLs or alternative CAPTCHA modes\u2014leveraging system \u201claziness.\u201d<\/p>\n<p><strong>In my view<\/strong>, reverse-engineering is for enthusiasts needing ultimate speed or control. In production, teams typically combine the first three methods and reserve pure protocol emulation as a last resort.<\/p>\n<hr\/>\n<h3>Anti\u2011Detection: Masking the Bot as a Human<\/h3>\n<p>Regardless of your chosen approach, the following best practices help avoid bot detection by GeeTest:<\/p>\n<ol>\n<li>\n<p><strong>Use relevant proxies.<\/strong> Ideally residential or mobile IPs matching the site\u2019s audience. Avoid public datacenter proxies. If using a solving service, ensure it uses your proxy IP to submit solutions.<\/p>\n<\/li>\n<li>\n<p><strong>Mimic real browser requests.<\/strong> Some anti-bot layers require solving JS challenges before the CAPTCHA. Use a full browser or replicate all headers (<code>Sec-Fetch-Mode<\/code>, <code>Accept-Language<\/code>, <code>cookies<\/code>, etc.).<\/p>\n<\/li>\n<li>\n<p><strong>Harden your browser environment.<\/strong> Stealth plugins, undetected drivers, or anti-detect browsers (Multilogin, Dolphin{anty}, Mimic) let you create profiles with realistic fingerprints.<\/p>\n<\/li>\n<li>\n<p><strong>Generate plausible input events.<\/strong> Avoid linear, constant-speed mouse tracks. Use B\u00e9zier curves, random deviations, varied delays, micro\u2011adjustments\u2014humans rarely move perfectly.<\/p>\n<\/li>\n<li>\n<p><strong>Respect timing.<\/strong> Don\u2019t start solving immediately; wait 1\u20132 seconds as a human would. Insert pauses between clicks\u2014humans don\u2019t click five targets in one second.<\/p>\n<\/li>\n<li>\n<p><strong>Update signatures.<\/strong> Monitor changes: follow forums (Habr, BlackHatWorld, Reddit \/r\/webscraping), analyze network logs, adapt to new parameters.<\/p>\n<\/li>\n<li>\n<p><strong>Limit attempts.<\/strong> After 2\u20133 failures, rotate IP\/session. For mass scraping, distribute load\u2014avoid sending 100 solves from one IP.<\/p>\n<\/li>\n<\/ol>\n<p>By combining these strategies\u2014third\u2011party APIs, OpenCV, browser automation\u2014you can achieve reliable performance. GeeTest, like other CAPTCHAs, is a cat\u2011and\u2011mouse game: defenders add complexity, bot authors adapt. For an experienced engineer, this challenge can be engaging: computer vision, reverse-engineering, and web automation all play a part. Apply hybrid methods (browser + API or OpenCV + input emulation) to maximize success. Stay ready for GeeTest v5\u2014until then, happy parsing and may no CAPTCHA stand in your way!<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/903870\/\"> https:\/\/habr.com\/ru\/articles\/903870\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>One could write, \u201cExperienced developers working on parsing and automation often face the need to bypass modern CAPTCHAs.\u201d But that\u2019s too boring\u2026 I\u2019d rather start like this\u2014continuing to explore the amusing world of CAPTCHAs, I finally stumbled upon the Chinese variant of protection: the GeeTest CAPTCHA. Let\u2019s break down what this beast is, where it dwells, and why you should (or shouldn\u2019t) fear it\u2026 You\u2019ll understand as we go!<\/p>\n<p>GeeTest is one of the advanced anti-bot systems combining user puzzles with behavioral analysis. I decided to take a close look at recognizing the GeeTest CAPTCHA under real-world conditions and figure out how to bypass GeeTest with various methods. But first\u2014a classic introduction (which, by the way, may be more interesting than the practical part of the article, since bypassing the GeeTest CAPTCHA is already a non-trivial task for many readers).<\/p>\n<figure class=\"full-width\"><\/figure>\n<h3>What Is GeeTest and Why Is This CAPTCHA Difficult (You Need Know it For Successful Bypass Geetest)?<\/h3>\n<p><strong>GeeTest<\/strong> (developer: Chinese company GeeTest) is a modern CAPTCHA system designed to protect websites from bots. Unlike classic \u201cEnter the characters from the image,\u201d GeeTest emphasizes interactive puzzles: for example, the user must slide a puzzle piece or solve a mini-game. Meanwhile, the system analyzes user behavior (mouse movements, solving speed, clicks) and collects extensive device information (so\u2011called <code><em>device fingerprint<\/em><\/code>). All of this complicates automatic recognition.<\/p>\n<p>The hallmark of GeeTest is <strong>adaptivity<\/strong>: when the system suspects a bot, the challenges become harder. For instance, a genuine user may only see a simple one-step slider, whereas suspicious traffic will get a series of complex tasks. Such multi-level protection greatly raises the bar for bots.<\/p>\n<p><strong>Key reasons why bypassing GeeTest can be fatal for some scripts:<\/strong><\/p>\n<ul>\n<li>\n<p><strong>Interactive challenges.<\/strong> You must emulate real interactions (dragging the slider, clicking objects, etc.), not just recognize text or move a slider from point A to B.<\/p>\n<\/li>\n<li>\n<p><strong>Behavioral analysis.<\/strong> GeeTest tracks cursor trajectory, pauses, movement sharpness, attempts, and more. Atypical \u201crobotic\u201d behavior leads to failure.<\/p>\n<\/li>\n<li>\n<p><strong>Device fingerprinting.<\/strong> The CAPTCHA gathers browser\/system data: User-Agent, screen resolution, installed plugins, fonts, time zone, Canvas\/WebGL fingerprint, and more. If these look suspicious (e.g., typical of an automated browser), the system may either escalate the challenge or block the attempt entirely.<\/p>\n<\/li>\n<li>\n<p><strong>Obfuscation and server\u2011side validation.<\/strong> GeeTest scripts are heavily obfuscated (especially in v4), and final answers are verified server\u2011side via tokens. You can\u2019t simply guess the puzzle position\u2014you must correctly form the response that the server will accept.<\/p>\n<\/li>\n<\/ul>\n<p>Thus, GeeTest poses a serious challenge for developers in parsing and automation. Yet, there are still ways to bypass this CAPTCHA\u2014let\u2019s explore them next.<\/p>\n<hr\/>\n<h3>GeeTest v3 vs. v4: CAPTCHA Evolution (Differents with Bypassing)<\/h3>\n<p>GeeTest has undergone several iterations, with versions v3 and v4 being the most widespread. Understanding their differences is crucial for choosing a bypass method.<\/p>\n<ul>\n<li>\n<p><strong>GeeTest v3<\/strong> (classic version) presents a visible CAPTCHA (most often a slider puzzle). Initialization uses two parameters in the page\u2019s code:<\/p>\n<ol>\n<li>\n<p><code>gt<\/code> \u2013 the site ID in the GeeTest system (public key).<\/p>\n<\/li>\n<li>\n<p><code>challenge <\/code>\u2013 a unique challenge string for the current session.<\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p>Typically, the page loads <code>gt.js<\/code> from the GeeTest server, and solving it triggers requests like <code>\/get.php<\/code> and <code>\/validate.php<\/code>. Version 3 supports several challenge types: <em>Slide CAPTCHA<\/em> (slider puzzle), <em>Icon CAPTCHA<\/em> (select\/drag icons), <em>Space CAPTCHA<\/em>, etc.<\/p>\n<\/li>\n<li>\n<p><strong>GeeTest v4<\/strong> (Adaptive CAPTCHA) is the newer, more flexible version with invisible modes. Key differences:<\/p>\n<ol>\n<li>\n<p>Instead of <code>gt + challenge<\/code>, it uses a single <code>captcha_id<\/code> (analogous to <code>gt<\/code>), and all other parameters are passed in an <code>initParameters<\/code> object during initialization. In practice, the frontend calls <code>initGeetest4<\/code> with an options object where <code>captcha_id<\/code> is primary.<\/p>\n<\/li>\n<li>\n<p>Scripts load from paths containing <code>\/v4\/<\/code> (e.g., <code>gcaptcha4.js<\/code>), which is evident in traffic analysis.<\/p>\n<\/li>\n<li>\n<p><strong>Adaptivity<\/strong>: v4 dynamically adjusts difficulty. If a user seems \u201cclean,\u201d the CAPTCHA may run in silent mode (barely noticeable). v4 features a <em>NoCaptcha<\/em> mode with a single \u201cVerify\u201d button\u2014background checks have already confirmed human traffic. For suspicious users, v4 will impose a series of tough trials.<\/p>\n<\/li>\n<li>\n<p>The v4 protocol is more complex: user interaction data is packaged and encrypted before sending to the server. In v4, the parameter w is an encrypted \u201canswer\u201d containing all user actions, timestamps, etc., calculated in an obfuscated script, making it hard to forge without replicating the full logic.<\/p>\n<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<p>To detect the version on a site, inspect the page code and network requests: if you see <code>gt <\/code>and <code>challenge<\/code>, it\u2019s v3; if the CAPTCHA loads via <code>gcaptcha4.geetest.com<\/code> with <code>captcha_id<\/code>, it\u2019s v4. For example, a typical v4 load URL:<\/p>\n<pre><code class=\"python\">https:\/\/gcaptcha4.geetest.com\/load?captcha_id=&lt;ID&gt;&amp;challenge=&lt;UUID&gt;<\/code><\/pre>\n<p>Here, <code>captcha_id<\/code> is the key, and a dynamic <code>challenge <\/code>is generated per case. In v3, you usually find <code>challenge <\/code>directly in the HTML or initialization data.<\/p>\n<hr\/>\n<h3>Types of GeeTest Challenges: Slider, Icons, \u201cFifteen Puzzle,\u201d and Mini\u2011Games &#8212; Smart Bypass GeeTest<\/h3>\n<p>Over the years, GeeTest has introduced a variety of challenge types. Here are the main ones a developer might encounter:<\/p>\n<ol>\n<li>\n<p><strong>Slide CAPTCHA (slider puzzle).<\/strong> The classic GeeTest: an image with a missing fragment and a separate puzzle piece. The user must drag the slider so the piece fits perfectly into the gap. Although it looks simple, the system evaluates how smoothly and human\u2011like you moved the piece. <strong>Bot task<\/strong>: determine the offset of the cutout and simulate human cursor movement. Slide CAPTCHA appears in both v3 and v4 (it remains the most common challenge).<\/p>\n<\/li>\n<\/ol>\n<figure class=\"\"><\/figure>\n<ul>\n<li>\n<p><strong>Click\/Icon CAPTCHA.<\/strong> The user sees images or icons and must click all that meet the prompt (e.g., \u201cFind all the cats among these pictures\u201d) or drag icons to match their shadows. GeeTest records click coordinates and timing\u200b. In v3, Icon CAPTCHA was rarer; in v4 it\u2019s been technically enhanced.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"\"><\/figure>\n<ul>\n<li>\n<p><strong>IconCrush CAPTCHA.<\/strong> A v4\u2011specific type: a grid of icons similar to a \u201cmatch\u2011three\u201d game, where the user must select three identical icons in a row\u200b. It\u2019s a mini\u2011game requiring image\u2011analysis to identify identical elements\u2014challenging for bots.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><\/figure>\n<ul>\n<li>\n<p><strong>Gobang CAPTCHA.<\/strong> Named after the game \u201c\u4e94\u5b50\u68cb\u201d (Gobang\/five\u2011in\u2011a\u2011row). The user places stones on a board trying to get five in a row\u200b. This simple puzzle is used under high suspicion. For a bot, solving Gobang means either fully simulating gameplay (non\u2011trivial) or avoiding reaching this stage by passing earlier, easier challenges.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><\/figure>\n<ul>\n<li>\n<p><strong>Space CAPTCHA.<\/strong> Mentioned in v3 docs, likely another click\u2011based task: place objects into correct \u201cspaces\u201d or slots. Details are scarce; I haven\u2019t personally encountered a clear example, nor found precise illustrations. The goal is similar: verify dynamic user actions when positioning objects.<\/p>\n<\/li>\n<li>\n<p><strong>NoCAPTCHA (OneTap).<\/strong> Like reCAPTCHA v2 Checkbox: the user simply clicks \u201cI\u2019m not a robot.\u201d Behind the scenes, GeeTest conducts extensive checks\u2014behavioral analysis, fingerprints, hidden JavaScript tests, maybe even Proof\u2011of\u2011Work\u200b. If everything looks legitimate, one click suffices; otherwise, a full challenge (slider or other) may appear. NoCAPTCHA is common for real users; for us, it means v4 may show no visible puzzle if traffic seems human.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><\/figure>\n<p>GeeTest continually experiments. Other types (e.g., Image CAPTCHA\u2014reordering image fragments\u2014or audio CAPTCHA for vision\u2011impaired users) may appear. The above are the most known and illustrative from a bypass perspective.<\/p>\n<hr\/>\n<h3>How GeeTest Identifies Bots: Behavior and Fingerprints &#8212; Making Bypass GeeTest Easier<\/h3>\n<p>Before exploring solutions, it\u2019s vital to understand which signals GeeTest uses to distinguish bots from humans. This knowledge helps you emulate human behavior convincingly (or reveals the difficulty if you lack the skill).<\/p>\n<h4>Behavioral Analysis<\/h4>\n<p>Every interaction stage is tracked. For sliders, the system logs cursor trajectory (X\/Y coordinates every millisecond), jerks, pauses. A movement that\u2019s too straight, without micro\u2011oscillations, looks scripted. Teleporting the cursor or constant speed also flags a bot. Reaction time matters: humans won\u2019t start dragging the slider in the exact millisecond the widget loads, but bots might. For click CAPTCHAs, the order and speed of clicks matter. Icon CAPTCHA checks how quickly and accurately you dragged icons\u200b\u2014too fast or too precise will raise suspicion\u200b. All data is sent to the server (partially in clear in v3, fully encrypted inside <code>w <\/code>in v4).<\/p>\n<h4>Device Fingerprinting<\/h4>\n<p>GeeTest collects browser info via JavaScript:<\/p>\n<ul>\n<li>\n<p>Screen parameters: resolution, color depth, viewport size.<\/p>\n<\/li>\n<li>\n<p>Browser data: User-Agent, presence of <code>webdriver <\/code>(WebDriver flag), plugin and MIME\u2011type lists, platform, language, time zone.<\/p>\n<\/li>\n<li>\n<p>Canvas\/WebGL fingerprint: draws hidden content on a <code>&lt;canvas&gt;<\/code> and reads pixel data (different systems yield slightly different patterns), checks the WebGL renderer.<\/p>\n<\/li>\n<li>\n<p>Audio fingerprinting: creates an <code>AudioContext <\/code>and records minute variations in generated sound.<\/p>\n<\/li>\n<li>\n<p>Fonts: enumerates installed fonts hiddenly.<\/p>\n<\/li>\n<\/ul>\n<p>Together, these form a unique \u201cfingerprint.\u201d If a bot repeatedly presents the same fingerprint, it can be detected. Or if the fingerprint is atypical (e.g., a headless browser), the system will escalate\u200b. For example, Headless Chrome sets <code>navigator.webdriver=true<\/code>\u2014GeeTest checks that and can instantly harden the challenge.<\/p>\n<h4>Network Information (IP, Proxy)<\/h4>\n<p>IP address, geolocation, and proxy usage factor in. Known VPN or datacenter IPs almost always get a tougher challenge. Multiple attempts from one IP within minutes look like a botnet\/script. GeeTest may share data with other anti\u2011bot systems or use its own IP reputation databases.<\/p>\n<h4>General Heuristics<\/h4>\n<p>Like reCAPTCHA, GeeTest uses machine learning on huge datasets, analyzing hundreds of parameters server\u2011side (load times, JS call order, device performance, etc.). For instance, humans can\u2019t click ten distinct<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-457191","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/457191","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=457191"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/457191\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=457191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=457191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=457191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}