How to bypass MTCaptcha

This guide shows how to bypass MTCaptcha: capture the image of distorted text, have a captcha solver API read it, type the returned characters into the widget’s field, and let MTCaptcha issue its own verified token. It explains what makes that text hard to read, how the site’s server checks the token, and the two calls to make with ilovecaptcha.

Updated on · Written and maintained by the ilovecaptcha team

Preview: the API described here is in public beta. Endpoint names, fields and codes can still change until the end of the beta, and no API key is distributed yet.

What is MTCaptcha, and what does it ask the visitor to type?

MTCaptcha is a text CAPTCHA aimed at enterprise forms. Its widget draws a short string of distorted characters over a photographic background, and the visitor types that string into the widget’s input field. An audio version of the same challenge serves visitors who cannot read the image. According to MTCaptcha, the service is GDPR compliant, stores no personally identifiable information and obscures visitor IP addresses to 3 octets.

What figures does MTCaptcha publish about its challenge?

MTCaptcha in figures, as stated in the publisher’s documentation
Property Documented value
Text length, default range 4 to 8 characters
Text length, range a site can select 3 to 10 characters
Standard widget width 270 px minimum, 350 px maximum
Standard widget height 185 px by default
Verified token lifetime 60 to 120 seconds by default
CheckToken calls accepted per token 1 by default

The length is not set once per site. According to MTCaptcha, the number of characters each visitor sees is picked inside that range from the risk score computed by its Risk Engine.

Why is MTCaptcha’s distorted text hard for a machine to read?

Because nothing around the characters helps. The string is random, so no dictionary can repair a doubtful letter, and one misread character is enough to fail the answer. According to OWASP, optical character recognition is one of the techniques behind OAT-009, CAPTCHA Defeat, the threat it defines as solving anti-automation tests.

Hard for a machine does not mean pleasant for people: in a USENIX Security 2023 study, 1,400 participants solved 14,000 CAPTCHAs, and solving time did not always follow the preference they stated.

Which details make an OCR engine misread the string?

  • Background: the text lies over a photograph that changes with every image, so the contrast keeps changing.
  • Patches: oval shapes cover part of the string and change the colour of the strokes beneath them.
  • Case and look-alikes: capitals and small letters are mixed, and the letter o and the digit 0, or l, i and 1, differ by a few pixels.
  • Unknown length: 4 to 8 characters by default, so there is no fixed number of slots to expect.
  • Rare characters: those an engine met least often during training are the ones it still gets wrong.

How does a solver read the whole string at once?

A reader trained for this challenge does not isolate letters. It scans the image from left to right as one sequence and outputs the most probable string, whatever its length. ilovecaptcha exposes it under the task type mtcaptcha: one image in, one string out in solution.text, written in small letters and digits. In our tests the live widget ignored case and accepted the classic look-alike pairs, o for 0 and i for 1.

What happens once the text is typed into MTCaptcha?

The widget checks the entry and, if it is right, creates a verified token. According to MTCaptcha’s documentation, that token is inserted into the form as a hidden input named mtcaptcha-verifiedtoken; a script can also read it with mtcaptcha.getVerifiedToken(). What the form carries to the site is therefore the token, not the typed text. A refused entry produces no token: the widget draws a new image instead.

How does the site’s server verify the token?

It calls MTCaptcha’s CheckToken API from the server side only, because the call carries the site’s private key.

  1. The server sends a GET request to the checktoken endpoint with two required parameters, privatekey and token.
  2. MTCaptcha answers with a JSON object whose success field is true or false.
  3. On success, tokeninfo describes the token: code 201 stands for a solved captcha, and hostname names the page that served it.
  4. On failure, fail_codes gives the reason, for instance token-expired or token-duplicate-cal.

How long does a verified token last, and can it be reused?

Not long, and no. MTCaptcha states that a verified token is normally valid for a few minutes, 60 to 120 seconds by default, and can be verified only once through CheckToken, to prevent replay attacks. The widget guarantees that at least 50 seconds remain for the server to run the check. A site may stretch the lifetime up to 1,200 seconds with the optional tokenExpireMiniSec parameter of that API.

Why does MTCaptcha sometimes show no text at all?

Because a site can switch on an invisible mode. MTCaptcha documents two: Low Friction, where the image appears only when the Risk Engine sees some risk, and IP Whitelist, where visitors from listed addresses never see it. A verified token is still created, with code 212 or 211 in place of 201. According to MTCaptcha, Low Friction lifts the first-attempt pass rate of real humans above 99.5%. On such a page there may be nothing to read or to send to a solver: watch the hidden field, and capture the text only if the widget draws it.

What do you send for an MTCaptcha task, and what comes back?

You send the image of the distorted text, in base64 or as a URL, with the task type mtcaptcha. No instruction is needed: the job is always to read the characters. The API answers with solution.text, the string to type into the widget.

The MTCaptcha task at a glance
Item Value
Publisher MTCaptcha
Challenge family Text to type
Task type mtcaptcha
You send Challenge image (base64 or URL)
You get back Text to type into the field
Vendor documentation MTCaptcha documentation

How do you bypass MTCaptcha with the ilovecaptcha API?

In five steps, with an automated browser that displays the widget. The API reads the image; the browser types the answer and MTCaptcha issues the token.

  1. Display the text. Load the page and wait until the widget has drawn its image.
  2. Capture the image. Screenshot the text image alone, without the input field or the buttons.
  3. Create the task. POST createTask with the type mtcaptcha and the image in base64.
  4. Poll the result. Call getTaskResult every 1 to 2 seconds until status is ready.
  5. Type the string. Enter solution.text in the widget’s field, then wait for mtcaptcha-verifiedtoken to be filled.

Send the form at once: the token expires within minutes and is checked a single time.

What does an MTCaptcha request look like?

The request below submits one MTCaptcha image: the image field carries the capture in base64 and no instruction is sent. The response holds a single string in solution.text, here six characters; by default its length falls between 4 and 8. Type it as returned into the widget’s field. A text answer has no coordinates, so nothing has to be rescaled.

POST /createTask
Content-Type: application/json

{
  "clientKey": "YOUR_API_KEY",
  "task": {
    "type": "mtcaptcha",
    "image": "iVBORw0KGgoAAAANSUhEUg…"
  }
}

→ 200 { "errorId": 0, "taskId": "tsk_8f3a1c2e", "status": "processing" }

POST /getTaskResult
Content-Type: application/json

{ "clientKey": "YOUR_API_KEY", "taskId": "tsk_8f3a1c2e" }

→ 200 { "errorId": 0, "status": "ready", "solution": { "text": "x7kp2m" } }
A createTask request for a MTCaptcha task, then the getTaskResult answer once the task is ready (preview format).

Bypassing MTCaptcha: questions developers ask

Can MTCaptcha be solved with OCR?

Yes, but not with a general-purpose OCR engine. Tools built for scanned documents expect clean print on a plain page and fail on characters laid over a photograph. A reader trained on MTCaptcha images returns the whole string in one pass. What OCR does not replace is the widget: the text must be typed into the real MTCaptcha field, because only the widget turns a right answer into the verified token.

Is the MTCaptcha text case sensitive?

The image mixes capitals and small letters, but in our tests on the live widget the case of the typed answer did not change the verdict. Look-alike pairs, the letter o for the digit 0 and i for 1, were accepted too. The solver returns small letters and digits: type the string as it comes back. A refusal almost always means that one character was misread, not that the format was wrong.

How long is an MTCaptcha verified token valid?

According to MTCaptcha’s documentation, 60 to 120 seconds by default, and the widget guarantees at least 50 seconds for the server-side check. A token can be verified only once through the CheckToken API; a second call fails with a duplicate-call code. The site itself can raise both limits, up to 1,200 seconds and 20 calls. If the token expires before the form is sent, the widget has to be passed again.

Can I skip the browser and call CheckToken myself?

No. CheckToken belongs to the site’s server: it requires the site’s private key, which never reaches the page, and it only validates a token that already exists. The token is created by MTCaptcha’s JavaScript widget once the right text has been typed. An automated browser, driven by Selenium, Puppeteer or Playwright, is therefore needed to display the widget, capture the image and type the answer.

When is it acceptable to automate MTCaptcha, and what about my own tests?

On a site you run, MTCaptcha documents the first option: a TestKey that lets an automated browser pass the widget in test mode and marks the token with code 301, so your server can tell test traffic apart. A solver API fits the other authorised cases: end-to-end checks on production settings, accessibility automation, availability monitoring, academic research, or collection of public data within the target site’s terms and the applicable law. Credential stuffing, spam and payment fraud are outside what ilovecaptcha supports.

Sources

The facts and figures quoted on this page come from these sources.