Unreal Brains Logo Unreal Brains
← Back to All Work
Web scraping • 2025

Bypassing Anti-Bot Systems via TLS Fingerprinting Without Headless Browsers

How StealthKit and AmzPy match a real browser's TLS fingerprint to extract protected data at under 400ms and 48MB of memory.

Target Domain Open source

Verified Engineering Benchmarks

Average Latency
381 ms
18% faster than standard requests
Memory Footprint
48.5 MB
Zero Chromium process overhead
WAF Bypasses
6 / 6 Passed
Akamai, CF, DataDome, PerimeterX
HTML Parser
BS4 Native
Direct socket extraction

In short: Modern bot protection (Cloudflare, Akamai, DataDome) flags a request at the TLS handshake, before any page is served. I built StealthKit, which matches a real browser’s TLS and HTTP/2 fingerprint through curl_cffi, and AmzPy, which adds session handling for Amazon. On the six protected sites I tested it returned 200 OK at 381ms average latency and 48.5MB of memory, with no 450MB+ headless browsers. A few targets (eBay, Best Buy) still need a challenge solver or proxy rotation.


The problem

Bot protection from Cloudflare, Akamai Bot Manager, DataDome and PerimeterX decides whether you are a bot before any page is sent. It looks at the TLS handshake (the JA3 and JA4 fingerprints), the cipher suite order and the HTTP/2 defaults.

Scrapers built on requests or httpx show an OpenSSL fingerprint and get an HTTP 403 straight away. Headless browsers (Playwright, Puppeteer) get through some of the time, but each one uses 450MB to 650MB of RAM, leaks signs of automation such as navigator.webdriver, and takes 1,500ms or more per page.

I built two tools that avoid the browser: StealthKit and AmzPy.

  1. StealthKit: A networking layer around curl_cffi that copies a real browser’s TLS Client Hello and HTTP/2 settings.
  2. AmzPy: An extraction layer on top of StealthKit that warms up a session, keeps headers in the right order, rotates cookies and parses the HTML with BeautifulSoup4.

How it works

StealthKit handles the connection fingerprint. AmzPy handles session state:

Layer 1: Application State AmzPy Extraction Core
Session Profile Seeder & Rotator
Header & Cookie Persistence Matrix
BeautifulSoup4 DOM Parser Engine
↓
Layer 2: Transport & Handshake StealthKit (curl_cffi)
  • • C-Level BoringSSL Handshake Impersonation (JA3 / JA4 Fingerprint Spoofing)
  • • Native HTTP/2 SETTINGS & WINDOW_UPDATE Frame Alignment
  • • Exact Cipher Suite Ordering & ALPN Negotiation (h2, http/1.1)
↓
Enterprise WAF Target (Cloudflare, Akamai, DataDome)
200 OK • 381ms Average

Details

  1. TLS fingerprint impersonation (StealthKit): Standard Python HTTP client libraries rely on Python’s native ssl module, which broadcasts an unmistakable OpenSSL fingerprint. StealthKit utilizes Libcurl compiled with BoringSSL, matching Chrome and Safari’s exact cipher suite order, elliptic curve extension sequences, and ALPN parameters (h2, http/1.1).

  2. HTTP/2 settings: Anti-bot algorithms analyze initial HTTP/2 connection parameters. Real Chrome browsers send precise values for SETTINGS_HEADER_TABLE_SIZE (65536), SETTINGS_MAX_CONCURRENT_STREAMS (1000), SETTINGS_INITIAL_WINDOW_SIZE (6291456), and SETTINGS_MAX_HEADER_LIST_SIZE (262144). StealthKit injects these exact frame settings during socket setup.

  3. Session handling (AmzPy): High-defense e-commerce targets like Amazon flag unseeded automated runs, returning 404 or CAPTCHA redirects even when TLS signatures pass. AmzPy resolves this by executing session profile warming, maintaining persistent cookie store state across request chains, rotating proxies dynamically, and parsing DOM trees with BeautifulSoup4.


Benchmarks

Test results for standard Python libraries, headless Chromium (Playwright) and StealthKit + AmzPy against six protected targets:

Results by target

WAF Target / Defense SystemStandard requests / httpxHeadless Chromium (Playwright)StealthKit + AmzPy
Cloudflare (V2 / Enterprise)Blocked (HTTP 403)Passed (High CPU)Passed (200 OK)
Akamai Bot ManagerBlocked (HTTP 403)Blocked (CDP Leak)Passed (200 OK)
DataDomeBlocked (HTTP 403)Blocked (Canvas/CDP)Passed (200 OK)
PerimeterX / HUMANBlocked (HTTP 403)Passed (Slow)Passed (200 OK)
Amazon Product PagesBlocked / CAPTCHAPassed (480MB RAM)Passed (200 OK)
KasadaBlocked (HTTP 403)Blocked (Handshake)Passed (200 OK)

Performance & Resource Comparison

MetricHeadless Chromium (Playwright)Standard Python (requests)StealthKit + AmzPy
Average Request Latency1,640 ms465 ms (Blocked)381 ms
Memory Footprint (RAM)480.0 MB28.0 MB48.5 MB
HTML Parsing EngineHeavy Chromium DOMN/ABS4 Native Parser
Browser CDP LeaksFlagged (navigator.webdriver)N/AZero CDP Artifacts
Infrastructure Cost / 1M Req$1,450 / monthN/A$180 / month (-87%)

Production Python Implementation

The following Python code snippet demonstrates the high-level amzpy capability for extracting full product details directly from target URLs:

from amzpy import AmazonScraper

# Create scraper with default settings (amazon.com)
scraper = AmazonScraper()

# Fetch product details
url = "https://www.amazon.com/dp/B00JUM4Y42"
product = scraper.get_product_details(url)

if product:
    print(f"Title: {product['title']}")
    print(f"Price: {product['currency']}{product['price']}")
    print(f"Brand: {product['brand']}")
    print(f"Rating: {product['rating']}")
    print(f"Image URL: {product['img_url']}")

Results

  • Memory: 480MB down to 48.5MB per worker, so about ten times as many workers fit on a small VPS.
  • Latency: 381ms on average, 18% faster than standard HTTP requests and about 4x faster than a headless browser page load.
  • Coverage: 6 of 6 protected targets returned 200 OK (Cloudflare, Akamai, DataDome, PerimeterX, Kasada, Amazon), with no browser running.

Need something like this?

I build data pipelines that get past anti-bot blocks, iOS apps from web apps, and SaaS MVPs.

Start a Project →