How eduaguixd/mtcaptcha-solver works
1. Purpose and scope
- This repository is a proof-of-concept MTCaptcha audio solver.
- The architecture centers on one workflow: fetch a challenge, satisfy MTCaptcha’s proof-of-work/fingerprint checks, transcribe the audio CAPTCHA, and submit the answer token.
2. Entry point
- main.py is the CLI boundary.
- It accepts sitekey, hostname, and optional proxy, then hands control to the solver pipeline.
- This keeps user interaction separate from the network/ML logic.
3. Core orchestration layer
- solve_audio.py is the main application engine.
- It coordinates the end-to-end solve flow: challenge retrieval, fold computation, audio download, Whisper transcription, answer normalization, and final submission.
- This file is where most of the integration logic lives.
4. Challenge acquisition and submission boundary
- The solver talks to MTCaptcha’s backend at service.mtcaptcha.com.
- That boundary includes fetching the challenge, handling the returned metadata, and submitting the final token.
- The README indicates the protocol is reverse-engineered, so the code is effectively emulating a browser client rather than using a public API.
5. Browser spoofing subsystem
- spoofing.py provides a pool of browser fingerprints across common browsers and OS combinations.
- Its role is to shape outbound requests to resemble legitimate browser traffic, including header ordering and client-hint fields.
- Architecturally, this is a request-morphing layer placed in front of the MTCaptcha network calls.
6. Proof-of-work / fold challenge subsystem
- MTCaptcha may require a “fold” challenge before accepting an answer.
- The repository implements this in two forms: the native C accelerator in _fold_accel.c, and a Python fallback when the native library is unavailable.
- This subsystem is performance-sensitive but isolated from the rest of the solve pipeline.
7. Native acceleration boundary
- _fold_accel.c is compiled at runtime and loaded through ctypes.
- That creates a clear boundary between Python orchestration and low-level computation.
- The C path is the preferred execution mode; the Python path preserves portability if no compiler is present.
8. Audio recognition subsystem
- The audio CAPTCHA is transcribed using faster-whisper.
- The model choice and CPU/int8 behavior are controlled in config.py.
- After transcription, the solver applies a phonetic mapping so Whisper’s spoken letter outputs become the single-character response MTCaptcha expects.
9. Configuration and tuning
- config.py centralizes runtime settings such as model selection, timeouts, and version metadata.
- This keeps behavioral tuning separate from the solver logic and makes it easy to swap Whisper models or adjust operational parameters.
10. Data flow through the system
- The overall flow is: CLI input → spoofed challenge request → optional fold computation → audio fetch → Whisper transcription → answer normalization → token submission.
- The network path and the ML path are sequential, with the fold step acting as a prerequisite gate when present.
- The solver’s success depends on both correct transcription and server-side acceptance of the spoofed client fingerprint/proxy origin.
11. External dependencies that materially shape the architecture
- faster-whisper is the primary ML dependency and drives the compute profile of the project.
- rnet is used for HTTP/network handling and likely supports the request construction/fingerprint behavior.
- The optional C toolchain (GCC or MSVC) is part of the runtime environment because the accelerator can compile itself on first run.
12. Operational constraints / architecture implications
- The README makes clear that IP reputation and fingerprint quality affect acceptance, so the solver is not purely a transcription problem.
- Proxy support is therefore part of the architecture, not just a convenience feature.
- The project is best understood as three cooperating subsystems: browser impersonation, challenge computation, and speech recognition.
Main entry points: solve_audio.py solve_audio.py · spoofing.py spoofing.py · _fold_accel.c _fold_accel.c · main.py main.py
Components 10
CLI
User entry and invocation boundary
- main.py · Parses sitekey, hostname, and proxy, then starts the solver
main.py
Solver core
End-to-end solve orchestration
- solve_audio.py · Coordinates challenge fetch, fold handling, audio transcription, normalization, and submission
solve_audio.py - config.py · Central runtime tuning for models, timeouts, and version metadata
config.py - normalize · Maps transcription output into the single-character answer expected by MTCaptcha
Client shaping
Fingerprinting and request construction
- spoofing.py · Provides browser and OS fingerprints plus request-shaping data
spoofing.py - HTTP client · Handles outbound challenge, audio, and submission requests against MTCaptcha
- MTCaptcha service · Challenge and token acceptance boundary at service.mtcaptcha.com
Runtime engines
Native acceleration and speech recognition
- fold Python · Portable implementation of the proof-of-work fold challenge
- _fold_accel.c · C accelerator compiled and loaded for fast fold computation
_fold_accel.c - Whisper · Transcribes the audio CAPTCHA using faster-whisper
Connections 13
- main.py → solve_audio.py: starts · CLI hands execution to the solver pipeline
- solve_audio.py → config.py: reads · Uses configured timeouts, model settings, and version metadata
- solve_audio.py → spoofing.py: selects · Chooses a browser fingerprint and request profile
- spoofing.py → HTTP client: shapes · Provides headers and client-hint ordering for requests
- solve_audio.py → HTTP client: requests · Fetches challenge data, audio, and submits the final token
- HTTP client → MTCaptcha service: talks to · Communicates with the MTCaptcha backend
- solve_audio.py → _fold_accel.c: prefers · Uses native acceleration when available for fold computation
- solve_audio.py → fold Python: falls back to · Uses the Python implementation if the native path is unavailable
- fold Python → _fold_accel.c: matches · Alternative implementations of the same fold challenge logic
- solve_audio.py → Whisper: transcribes · Runs speech recognition on downloaded audio CAPTCHA
- Whisper → normalize: feeds · Transcription is normalized into the expected answer token
- normalize → HTTP client: submits · Sends the final normalized answer back to the service
- solve_audio.py → MTCaptcha service: depends on · Success requires server acceptance of spoofed client state and submitted token