Logo of «2Captcha»To home page
Captcha bypass tutorials

Was this helpful?

How to solve CaptchaFox on register.gmx.net

Jerry Slimane
Jerry Slimane

Technical engineer

The sign-up page of the GMX mail service (register.gmx.net) is protected by CaptchaFox. Normally the script for this captcha is loaded from CaptchaFox's own server, but GMX loads it from an address of its own — s.uicdn.com. That is a separate version of the captcha, and its token is separate too: a correct token starts with MAM_.

For a successful solve it is critical to pass the apiServer parameter with the address of the GMX build. Without it, or with a wrong value, the worker solves the captcha on the default server, you get an ordinary token with no prefix, and the site rejects it with an HTTP 424 error. On top of that, CaptchaFox requires a proxy and a User-Agent: the task will not be created without them.

Task parameters

The CaptchaFoxTask task type is used.

Parameter Type Required Description
type String Yes Must be set to CaptchaFoxTask
websiteURL String Yes Full URL of the sign-up page: https://register.gmx.net/
websiteKey String Yes Site key, starts with sk_
apiServer String Yes for GMX Address of the captcha build. For GMX: https://s.uicdn.com/mampkg/@mamdev/core.frontend.libs.captchafox/. The field is formally optional, but without it the token comes back in the wrong format
userAgent String Yes Browser User-Agent. Has to match the real one
proxyType String Yes Proxy type: http, socks4 or socks5
proxyAddress String Yes Proxy IP address or hostname
proxyPort Number Yes Proxy port
proxyLogin String No Login for proxy authentication
proxyPassword String No Password for proxy authentication

How to find the parameters

The GMX site key is static; at the time of writing it is sk_vpYGVnHsK9Aw5o8t2pweWzOMHAWHt. You can check it and read it again like this.

  1. Open https://register.gmx.net/ and press F12 to open the developer tools.
  2. Go to the Elements tab and find the captcha-widget tag on the page.
  3. The key is in its data-sitekey attribute, and the page address is in data-pageurl:
html Copy
<captcha-widget data-captcha-type="captchafox"
                data-sitekey="sk_vpYGVnHsK9Aw5o8t2pweWzOMHAWHt"
                data-pageurl="https://register.gmx.net/">

The address of the captcha build is visible on the Network tab. Filter the requests by captchafox and see where api.js is loaded from. On GMX it is https://s.uicdn.com/mampkg/@mamdev/core.frontend.libs.captchafox/api.js — the path up to the file name is the value of apiServer. If the script were loaded from cdn.captchafox.com, the build would be the ordinary one and the parameter would not be needed.

Take the User-Agent you open the site with. In a script it is easier to read it straight from the browser rather than typing it in by hand.

Code examples

Python + requests

Sending the task and polling for the result with no extra libraries.

python Copy
import time
 
import requests
 
API_KEY = "YOUR_API_KEY"
WEBSITE_KEY = "sk_vpYGVnHsK9Aw5o8t2pweWzOMHAWHt"
API_SERVER = "https://s.uicdn.com/mampkg/@mamdev/core.frontend.libs.captchafox/"
USER_AGENT = ("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 "
              "(KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36")
 
task = {
    "type": "CaptchaFoxTask",
    "websiteURL": "https://register.gmx.net/",
    "websiteKey": WEBSITE_KEY,
    "apiServer": API_SERVER,
    "userAgent": USER_AGENT,
    "proxyType": "http",
    "proxyAddress": "1.2.3.4",
    "proxyPort": 8080,
    "proxyLogin": "user23",
    "proxyPassword": "p4$w0rd",
}
 
created = requests.post(
    "https://api.2captcha.com/createTask",
    json={"clientKey": API_KEY, "task": task},
    timeout=30,
).json()
 
if created.get("errorId") != 0:
    raise RuntimeError(f"Task was not created: {created}")
 
task_id = created["taskId"]
print("Task created:", task_id)
 
for _ in range(24):
    time.sleep(5)
    result = requests.post(
        "https://api.2captcha.com/getTaskResult",
        json={"clientKey": API_KEY, "taskId": task_id},
        timeout=30,
    ).json()
 
    if result.get("status") == "ready":
        token = result["solution"]["token"]
        print("Token received:", token[:20], "…")
        break
 
    if result.get("errorId") != 0:
        raise RuntimeError(f"Error: {result}")
else:
    raise RuntimeError("No solution arrived within the time limit")

Check the start of the token: it has to begin with MAM_. If the prefix is missing, the task went out without apiServer or with a wrong value.

Python + Playwright

The script opens the page, reads the site key and the User-Agent from the browser, sends the task, receives the token and puts it into the form. The key is taken from the widget attribute rather than by searching the page source, so it cannot be confused with another string.

python Copy
import os
 
from playwright.sync_api import sync_playwright
from twocaptcha import TwoCaptcha
 
API_KEY = os.getenv("APIKEY_2CAPTCHA", "YOUR_API_KEY")
TARGET_URL = "https://register.gmx.net/"
API_SERVER = "https://s.uicdn.com/mampkg/@mamdev/core.frontend.libs.captchafox/"
 
PROXY_BROWSER = {"server": "http://1.2.3.4:8080", "username": "user23", "password": "p4$w0rd"}
PROXY_API = {"type": "HTTP", "uri": "user23:p4$w0rd@1.2.3.4:8080"}
 
solver = TwoCaptcha(API_KEY)
 
with sync_playwright() as p:
    browser = p.chromium.launch(headless=False, proxy=PROXY_BROWSER)
    page = browser.new_page()
 
    try:
        page.goto(TARGET_URL)
        page.wait_for_load_state("networkidle")
 
        widget = page.locator("captcha-widget[data-sitekey]").first
        if widget.count() == 0:
            raise RuntimeError("Captcha widget not found on the page")
 
        website_key = widget.get_attribute("data-sitekey")
        user_agent = page.evaluate("navigator.userAgent")
        print("Site key:", website_key)
 
        result = solver.captchafox(
            sitekey=website_key,
            pageurl=TARGET_URL,
            userAgent=user_agent,
            proxy=PROXY_API,
            api_server=API_SERVER,
        )
        token = result["code"]
        print("Token received:", token[:20], "…")
 
        page.evaluate("""(token) => {
            const field = document.querySelector('textarea[name="cf-captcha-response"]');
            if (!field) {
                throw new Error('The cf-captcha-response field was not found on the page');
            }
            field.value = token;
        }""", token)
 
        print("Token is in place, the form can be submitted")
 
    except Exception as e:
        print(f"Error: {e}")
    finally:
        browser.close()

How to use the received token (Hidden form field)

CaptchaFox adds a hidden field for the token to the form by itself, and when the form is submitted the token goes to the server together with the rest of the data as the cf-captcha-response parameter. No callback function is needed.

On the GMX sign-up page the field looks like this:

html Copy
<div class="captchafox">
  <div>
    <div class="cf-button cf-1dxnin"></div>
    <textarea name="cf-captcha-response" id="cf-response-fcb9c972316d98"></textarea>
  </div>
</div>

Two details make this easy to get wrong. It is a textarea, not an input, so looking for a field by type will not find it. And its identifier is generated anew on every page load, so a selector by id will not work. Look it up by name.

python Copy
page.evaluate("""(token) => {
    const field = document.querySelector('textarea[name="cf-captcha-response"]');
    if (!field) {
        throw new Error('The cf-captcha-response field was not found on the page');
    }
    field.value = token;
}""", token)

The check is needed: without it the script submits the form with an empty field and reports a successful submission.

After that submit the form the usual way — the token goes out with the other fields.

Common errors and solutions

Error / Problem Cause Solution
The site answers with HTTP 424 The token came in the standard format, without the MAM_ prefix Pass apiServer with the value https://s.uicdn.com/mampkg/@mamdev/core.frontend.libs.captchafox/
The token does not start with MAM_ apiServer was not passed or has a wrong value Check the value against the address the page loads the captcha script from
The task goes out without a proxy An empty dictionary or None was passed in proxy The SDK drops such values silently. Pass a filled dictionary: a proxy is required for CaptchaFox
The captcha widget is not found The captcha appears only after you start filling the form Wait for the page to load, start filling the form and only then look for the captcha-widget tag
ERROR_BAD_PARAMETERS when creating the task The site key on the page has changed Open the page and compare data-sitekey with the one in your code
The form is submitted without a token The field was looked up by id, which is generated anew on every load Look the field up by name: textarea[name="cf-captcha-response"]
The token field is not found The captcha has not rendered yet; the field appears together with the widget Wait for the widget to appear and only then put the token in