Passing AntiBot

Getting Past Cloudflare's Anti-Bot / Challenge Page — The Full Toolbox

Cloudflare layers many signals on top of each other. No single trick works universally; you often need to combine several. Below is the full stack, from easiest to most aggressive.


1. The Signal Stack Cloudflare Actually Inspects

Before diving into tricks, know what's being scored:

Layer What it checks
IP reputation Datacenter vs residential vs mobile, ASN, geo, prior abuse
TLS fingerprint (JA3 / JA4) Cipher order, extensions, curve list, ALPN — unique per library/browser
HTTP/2 fingerprint SETTINGS frame values, pseudo-header order, WINDOW_UPDATE size
HTTP headers Which headers, their order, values (UA, Accept-Language, etc.)
JavaScript execution The actual challenge: a PoW hash, DOM checks, or Turnstile
Browser fingerprint Canvas, WebGL, AudioContext, fonts, screen size, plugins, navigator.*
Behavioural signals Mouse movement, scroll, timing of clicks, focus events
Cookie state cf_clearance, __cf_bm, __cf_chl_* — tied to IP + UA + TLS
Rate / volume How fast you're hitting, from how many IPs

A request that looks fine at layer 3 but has a Python-requests TLS fingerprint at layer 1 will get flagged.


2. Quick / Low-Effort Fixes


3. IP / Network Layer

This is often the #1 reason you keep getting challenged.


4. TLS & HTTP/2 Fingerprint (the "invisible" wall)

Even with a residential IP, python-requests, curl, or Node fetch have a distinct TLS handshake that a real browser doesn't. Cloudflare fingerprints this.

Tools that impersonate a real browser's TLS + HTTP/2 fingerprint:

Tool Language Notes
curl_cffi Python pip install curl_cffi – impersonates Chrome / Safari / Edge / Firefox TLS. Easiest
to start.
curl-impersonate C (CLI) Patched curl binary that clones Chrome/Safari handshake byte-for-byte.
tls-client (bogdanfinn) Go Very popular in the scraping community. Supports cookie jars, proxy
rotation.
cycletls Go Fork of tls-client, actively maintained.
utls Go Low-level; you build the handshake yourself.
httpx + curl_cffi backend Python Modern async HTTP with the right fingerprint.

Example (Python, curl_cffi):

from curl_cffi import requests

session = requests.Session(impersonate="chrome124")
session.proxies = {"https": "http://user:pass@residential-proxy:port"}

r = session.get("https://protected-site.com", headers={
    "Accept-Language": "en-US,en;q=0.9",
})
print(r.status_code, r.text[:200])

This alone clears a surprising number of 403 / challenge pages that vanilla requests can't.


5. The cf_clearance Cookie (the "master key")

When a real browser successfully passes the challenge, Cloudflare sets a cf_clearance cookie. It is:

Strategy: solve once, reuse many

  1. Open the site in a real Chrome on a machine with a residential IP.
  2. Let the challenge auto-resolve (or click Turnstile).
  3. Extract the cookies:
    • DevTools → Application → Cookies, or
    • A browser extension (e.g., Get cookies.txt, EditThisCookie).
  4. Replay those cookies in your script with the same UA, same IP, same TLS fingerprint.
# Reuse the clearance cookie
cookies = {
    "cf_clearance": "abcdef...",
    "__cf_bm": "123456...",
}
r = session.get("https://protected-site.com/data", cookies=cookies)

⚠️ If the IP, UA, or TLS fingerprint changes even slightly, the cookie is rejected.

Automate the "solve once" step:


6. Headless Browser + Stealth (when you must script)

If you need a full browser (for dynamic content, SPAs, etc.):

Key stealth plugins / configs

Things the stealth plugins patch:

Extra hardening:


7. Cloudflare Turnstile (the "new" captcha)

Turnstile replaced the old I-AM-HUMAN checkbox in many deployments. It's a small widget that:

How to handle it:


8. Alternative Endpoints (cheeky but effective)

Sometimes the main site is behind a heavy challenge, but:

Check the site's robots.txt and look for API docs.


9. If You Own / Control the Site

You (or the site owner) can simply turn the dial down:


10. Nuclear / "For All Costs" Options

If nothing above works:

  1. Run a real Chrome on a residential-IP VPS (e.g., a $5/month VPS in a datacenter + a residential proxy on the outbound), drive it with Playwright + stealth. This is what most scraping farms do.
  2. Use a managed scraping service (Bright Data, Oxylabs, ScrapingBee, Apify, Zyte). They've already solved the fingerprint + IP + challenge dance and sell you the clean HTML/JSON.
  3. curl-impersonate + a real cf_clearance cookie: the closest you can get to "invisible" without a full browser.
  4. Solve the PoW manually (advanced): Cloudflare's old managed challenge is a hash-based proof-of-work. You can:
    • Intercept the JS with a breakpoint.
    • Extract the challenge parameters (cf_chl_opt).
    • Run the hash loop in your own code.
    • POST the result back and collect the cf_clearance cookie.
    • (This is what libraries like cloudscraper tried to do, but Cloudflare keeps rotating the algorithm, so it breaks periodically.)
  5. Use Cloudflare's own edge: if you own the zone, add a Cloudflare Worker that sets a custom header or rewrites the response before it hits the challenge logic.

11. A Practical Decision Flowchart

GET request → 200?  → Done ✅
                → 403 / challenge page?
                     ├─ Are you on a datacenter IP?  → Switch to residential
                     ├─ Are you using raw requests/curl? → Switch to curl_cffi / tls-client
                     ├─ Is your UA / headers consistent with IP geo?  → Fix
                     ├─ Can you solve it once in a real browser and reuse the cookie? → Do that
                     ├─ Do you need dynamic content / a SPA?  → Playwright + stealth + residential proxy
                     ├─ Is it Turnstile?  → Real browser, wait, click checkbox if shown
                     └─ Still stuck?  → Managed scraping API, or ask the site owner to whitelist you

TL;DR: For most people, the combo that "just works" is:

Residential proxy + curl_cffi (or tls-client) + a real browser's UA + solve the challenge once in Chrome to grab cf_clearance + reuse the cookie.

That covers ~90 % of cases. The remaining 10 % (heavy behavioural checks, Turnstile with visible UI, rate-limited APIs) need a full stealth-browser session or a paid scraping service.

Want me to write a concrete script for a specific target or toolchain?


Revision #1
Created 11 September 2026 15:07:49 by Togoboi
Updated 11 September 2026 15:10:57 by Togoboi