Rust Library Solves Cloudflare Turnstile Without Headless Browser
cfsolve is a Rust library and command line tool for solving Cloudflare Turnstile widgets and challenge pages without a headless browser. It generates authentication tokens for widgets or clearance cookies for challenge pages, accepting the target URL, sitekey, and optionally the page HTML as inputs.
The tool operates by impersonating specific browsers using profile files containing recorded responses to Cloudflare’s browser checks stored as JSON. A profile for Safari on iPhone is included by default. Creating new profiles requires manual effort or AI assistance, though the project provides a proxy capture tool to record interactions from real browsers. Safari and Chromium profiles are currently supported.
Integration requires Rust from rust-toolchain.toml, plus CMake, a C/C++ compiler, libclang, and Git. The library can be added as a path dependency in Rust projects or used as a standalone tool. It handles concurrent operations and supports proxy configuration, though clearance cookies must be sent from the same IP address and user agent as the profile used to generate them. The project is MIT-licensed, with patched dependencies in the vendor directory retaining their original licenses.
Read the full article
Continue reading at Hacker News →This is an AI-generated summary. Read the original for the full story.