mcpField
S
stealth-browser-launch

stealth-browser-launch

github.com/uphiago安全1.3k43 次安装8 周前更新
代码仓库

关于 stealth-browser-launch

stealth-browser-launch 是通过 cloakbrowser 和 Playwright 启动 Chromium 的技能,可在 C++ 层修改浏览器指纹。它面向需要访问反机器人保护网站的安全测试和自动化侦察流程,并支持配置指纹与持久化配置文件。

主要功能

  1. 01修改 Chromium 浏览器指纹
  2. 02Playwright 浏览器自动化
  3. 03代理与 GeoIP 选项
  4. 04可配置指纹参数
  5. 05持久化浏览器配置文件
  6. 06通过 cloakserve 管理多个身份

适用场景

  1. 01测试会拦截 HTTP 客户端的网站
  2. 02在受保护页面提交表单
  3. 03访问受 CAPTCHA 保护的端点
  4. 04使用不同身份开展自动侦察

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/uphiago/recon-skills --skill stealth-browser-launch

安装后在 Claude Code 中输入/stealth-browser-launch确认已加载。

详细介绍

隐身浏览器启动

启动经过补丁修改的 Chromium 二进制文件,通过 C++ 源码级指纹修改绕过反机器人检测。该二进制文件在二进制层面伪装 canvas、WebGL、音频、GPU、屏幕、WebRTC、网络时序和自动化信号,而非通过 JavaScript 注入或会因 Chrome 更新而失效的配置补丁。可通过 Cloudflare Turnstile、reCAPTCHA v3(0.9 分数)、FingerprintJS、BrowserScan 和 30 多个检测网站。

适用场景

  • 目标使用 Cloudflare、Akamai、DataDome 或 Kasada 拦截 curl/httpx/nuclei。
  • 需要完整的浏览器 JavaScript 执行能力,以提交表单、登录或测试 XSS。
  • 即使使用正确的标头,目标仍会对所有未经身份验证的请求返回 403。
  • 需要访问受 reCAPTCHA 保护的端点,而不解决 CAPTCHA。
  • 通过住宅代理运行自动化侦察——隐身浏览器可防止 IP 与 UA 关联。

前置条件

  • 安装了 python3 和 pip 的 terminal。
  • 已安装 playwright:pip install playwright && playwright install-deps chromium。
  • 住宅代理(无论浏览器指纹如何,数据中心 IP 都会因信誉问题而被拦截)。
  • 可选:使用 cloakbrowser[geoip],根据代理出口 IP 自动解析时区和区域设置。

快速开始

pip install cloakbrowser
python3 -c "
from cloakbrowser import launch
browser = launch()
page = browser.new_page()
page.goto('https://target.com')
print(page.title())
browser.close()
"

操作步骤

阶段 1 — 基本隐身启动

二进制文件会在每次启动时自动生成随机指纹种子。基本隐身无需任何标志:

from cloakbrowser import launch

browser = launch(
    headless=True,
    proxy="http://user:pass@residential-proxy:port",
    geoip=True,    # auto-detect timezone/locale from proxy exit IP
)
page = browser.new_page()
page.goto("https://target.com")
# Standard Playwright API from here
page.locator("input[name='username']").fill("test")
page.locator("button[type='submit']").click()
browser.close()
阶段 2 — 持久身份

再次访问同一目标时使用固定的指纹种子,以呈现回访访客的身份:

browser = launch(
    proxy="http://user:pass@residential-proxy:port",
    geoip=True,
    args=["--fingerprint=42069"],  # fixed seed = same fingerprint every launch
)
阶段 3 — 使用有头模式实现最大程度的隐身

有些网站即使在应用 C++ 补丁后,仍能检测到无头模式。使用虚拟显示器运行有头模式:

# Start virtual display
Xvfb :99 -screen 0 1920x1080x24 &
export DISPLAY=:99
browser = launch(
    headless=False,  # real rendering
    proxy="http://residential-proxy:port",
    geoip=True,
    humanize=True,   # human-like mouse/keyboard/scroll
)
阶段 4 — 自定义指纹

覆盖特定指纹值,以匹配目标环境:

browser = launch(stealth_args=False, args=[
    "--fingerprint=42069",
    "--fingerprint-platform=windows",
    "--fingerprint-gpu-vendor=NVIDIA Corporation",
    "--fingerprint-gpu-renderer=NVIDIA GeForce RTX 3060/PCIe/SSE2",
    "--fingerprint-hardware-concurrency=16",
    "--fingerprint-device-memory=16",
    "--fingerprint-screen-width=2560",
    "--fingerprint-screen-height=1440",
    "--fingerprint-timezone=America/Sao_Paulo",
    "--fingerprint-locale=pt-BR",
    "--fingerprint-webrtc-ip=auto",
    "--fingerprint-noise=false",  # disable noise for FingerprintJS ML bypass
])
阶段 5 — 持久化配置文件

在不同会话间保留 cookie 和 localStorage,以绕过“首次访问”验证:

from cloakbrowser import launch_persistent_context

ctx = launch_persistent_context(
    "./target-profile",
    headless=False,
    proxy="http://residential-proxy:port",
    geoip=True,
)
page = ctx.new_page()
page.goto("https://target.com")
# Session persists across restarts
ctx.close()
阶段 6 — 通过 CDP Multiplexer 管理多个身份

使用 cloakserve 在单个容器中运行多个浏览器身份:

docker run -d --name cloak -p 127.0.0.1:9222:9222 cloakhq/cloakbrowser cloakserve
from playwright.sync_api import sync_playwright

pw = sync_playwright().start()

# Each unique fingerprint seed spawns separate Chrome process with independent identity
b1 = pw.chromium.connect_over_cdp("http://localhost:9222?fingerprint=11111")
b2 = pw.chromium.connect_over_cdp("http://localhost:9222?fingerprint=22222")

# Full identity control via query params
b3 = pw.chromium.connect_over_cdp(
    "http://localhost:9222?fingerprint=33333"
    "&timezone=America/New_York&locale=en-US&platform=windows"
    "&hardware-concurrency=4&device-memory=8"
)

# Each browser has independent cookies, localStorage, canvas noise
阶段 7 — 反机器人字体设置

对于会检查 canvas 表情符号渲染的严格网站(Kasada、Akamai):

apt install -y fonts-noto-color-emoji fonts-freefont-ttf fonts-unifont \
    fonts-ipafont-gothic fonts-wqy-zenhei fonts-tlwg-loma-otf

为规避 CreepJS 的字体枚举,安装 Windows 字体:

# Copy from Windows machine: C:\Windows\Fonts\
mkdir -p ~/.local/share/fonts/windows
cp /path/to/windows/fonts/SegoeUI*.ttf ~/.local/share/fonts/windows/
fc-cache -f

# Then launch with:
browser = launch(args=["--fingerprint-fonts-dir=/home/user/.local/share/fonts/windows"])

指纹标志参考

标志默认值控制内容
--fingerprint=SEED随机 5 位数字canvas/WebGL/音频/字体的主种子
--fingerprint-platformwindows/macosnavigator.platform、UA 操作系统、GPU 池
--fingerprint-gpu-vendor自动WebGL UNMASKED_VENDOR_WEBGL
--fingerprint-gpu-renderer自动WebGL UNMASKED_RENDERER_WEBGL
--fingerprint-hardware-concurrency8navigator.hardwareConcurrency
--fingerprint-device-memory8navigator.deviceMemory
--fingerprint-screen-width1920/1440屏幕宽度
--fingerprint-screen-height1080/900屏幕高度
--fingerprint-timezone—IANA 时区
--fingerprint-locale—BCP 47 区域设置
--fingerprint-webrtc-ip—WebRTC ICE IP(使用 auto 获取代理出口 IP)
--fingerprint-noise=falsetrue禁用 canvas/WebGL/音频噪声
--fingerprint-fonts-dir—目标平台字体路径
--fingerprint-windows-font-metrics—将字体度量与 Windows 对齐(v148+)
--fingerprint-storage-quota自动存储配额,单位为 MB
--fingerprint-taskbar-height48/95/0任务栏高度伪装

陷阱

  • 无论浏览器指纹如何,数据中心 IP 都会被拦截。 请始终使用住宅代理。
  • page.wait_for_timeout() 会泄漏 CDP 流量,从而被 reCAPTCHA 检测到。 请改用 time.sleep()。
  • Puppeteer 发送的 CDP 流量比 Playwright 更多。 对于 reCAPTCHA 检测严格的目标,请使用 Playwright。
  • 缺少字体会导致 Kasada/Akamai 的画布哈希不匹配。 请安装第 7 阶段列出的字体包。
  • --fingerprint-noise=false 可能触发 FingerprintJS 基于 ML 的检测。 只有在被其专门拦截时才禁用噪声。
  • 即使使用 C++ 补丁,也可能检测到无头模式。 若要在检测严格的网站上实现最高隐蔽性,请使用有头模式(headless=False)。
  • 二进制文件的自动更新会缓存约 24 小时。 如需保证可复现性,请使用 browser_version= 固定版本。

验证

  1. 使用 https://browserscan.net 测试——所有 4 项机器人检查都应显示 NORMAL。
  2. 使用 https://demo.fingerprint.com/playground 测试——不应显示“nodriver”或“bot”检测结果。
  3. 使用 reCAPTCHA v3 测试:https://antcpt.com/eng/information/demo-form/recaptcha-3-test-score.html——得分应 ≥ 0.7。
  4. 使用 https://deviceandbrowserinfo.com 测试——isBot 应为 false,且 true 标志数为 0。
  5. 使用 page.evaluate("navigator.webdriver") 验证 navigator.webdriver 为 false。

相关技能

  • humanize-automation — 模拟人类鼠标、键盘和滚动操作,以绕过行为检测。
  • tls-fingerprint-impersonation — 在 HTTP 客户端层伪造 TLS/JA4 指纹。
  • http2-header-impersonation — 模拟特定浏览器的 HTTP/2 伪标头顺序和 SETTINGS 帧。

评论

支持 Markdown