mirror of
https://github.com/CloakHQ/CloakBrowser.git
synced 2026-06-23 11:41:46 +02:00
feat: cloakbrowser v0.1.0 — stealth Chromium wrapper for Playwright
Drop-in Playwright replacement with source-level fingerprint patches. Auto-downloads patched Chromium 142 from GitHub Releases on first use. 17/17 stealth tests passing (reCAPTCHA 0.9, Cloudflare Turnstile, BrowserScan).
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
"""Basic example: launch stealth browser and load a page."""
|
||||
|
||||
from cloakbrowser import launch
|
||||
|
||||
browser = launch(headless=False)
|
||||
page = browser.new_page()
|
||||
|
||||
page.goto("https://example.com")
|
||||
print(f"Title: {page.title()}")
|
||||
print(f"URL: {page.url}")
|
||||
|
||||
browser.close()
|
||||
print("Done!")
|
||||
@@ -0,0 +1,32 @@
|
||||
"""Check reCAPTCHA v3 score with stealth browser.
|
||||
|
||||
Visits Google's reCAPTCHA demo page and extracts the score.
|
||||
Expected: 0.9 (human-level) with cloakbrowser.
|
||||
Default Playwright typically scores 0.1-0.3.
|
||||
"""
|
||||
|
||||
from cloakbrowser import launch
|
||||
|
||||
browser = launch(headless=True)
|
||||
page = browser.new_page()
|
||||
|
||||
# Google's official reCAPTCHA v3 demo
|
||||
page.goto("https://recaptcha-demo.appspot.com/recaptcha-v3-request-scores.php")
|
||||
page.wait_for_load_state("networkidle")
|
||||
|
||||
# Click to trigger reCAPTCHA scoring
|
||||
button = page.query_selector("button")
|
||||
if button:
|
||||
button.click()
|
||||
page.wait_for_timeout(3000)
|
||||
|
||||
# Extract score from page
|
||||
content = page.content()
|
||||
print("Page loaded. Check the score in the response.")
|
||||
print(f"URL: {page.url}")
|
||||
|
||||
# Take screenshot as proof
|
||||
page.screenshot(path="recaptcha_score.png")
|
||||
print("Screenshot saved: recaptcha_score.png")
|
||||
|
||||
browser.close()
|
||||
@@ -0,0 +1,57 @@
|
||||
"""Run stealth tests against major bot detection services.
|
||||
|
||||
Tests cloakbrowser against multiple detection sites and reports results.
|
||||
"""
|
||||
|
||||
from cloakbrowser import launch
|
||||
|
||||
TESTS = [
|
||||
{
|
||||
"name": "bot.incolumitas.com",
|
||||
"url": "https://bot.incolumitas.com",
|
||||
"check": "Bot detection analysis",
|
||||
},
|
||||
{
|
||||
"name": "BrowserScan",
|
||||
"url": "https://www.browserscan.net/bot-detection",
|
||||
"check": "Bot detection status",
|
||||
},
|
||||
{
|
||||
"name": "deviceandbrowserinfo.com",
|
||||
"url": "https://deviceandbrowserinfo.com/are_you_a_bot",
|
||||
"check": "isBot flag",
|
||||
},
|
||||
{
|
||||
"name": "FingerprintJS",
|
||||
"url": "https://demo.fingerprint.com/web-scraping",
|
||||
"check": "Bot detection result",
|
||||
},
|
||||
]
|
||||
|
||||
browser = launch(headless=True)
|
||||
page = browser.new_page()
|
||||
|
||||
print("=" * 60)
|
||||
print("CloakBrowser Stealth Test Suite")
|
||||
print("=" * 60)
|
||||
|
||||
for test in TESTS:
|
||||
print(f"\n--- {test['name']} ---")
|
||||
print(f"URL: {test['url']}")
|
||||
try:
|
||||
page.goto(test["url"], wait_until="networkidle", timeout=30000)
|
||||
page.wait_for_timeout(3000)
|
||||
|
||||
# Screenshot each test
|
||||
filename = f"stealth_test_{test['name'].replace('.', '_').replace(' ', '_')}.png"
|
||||
page.screenshot(path=filename)
|
||||
print(f"Screenshot: {filename}")
|
||||
print(f"Title: {page.title()}")
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
|
||||
browser.close()
|
||||
|
||||
print("\n" + "=" * 60)
|
||||
print("Tests complete. Check screenshots for results.")
|
||||
print("=" * 60)
|
||||
Reference in New Issue
Block a user