National Cyber Warfare Foundation (NCWF)login

camoufox-cli for fingerprint-resistant browser automation with AI agents


0 user ratings
2026-11-04 19:27:05
milo
Red Team (CNA)
"camoufox-cli

camoufox-cli wraps the Camoufox anti-detect Firefox build in a daemon-backed CLI with agent skills, letting authorized operators and researchers drive consistent spoofed identities from tools like Claude Code and Cursor.








ToolBin-Huang/camoufox-cli — anti-detect browser automation CLI and agent skills built on Camoufox and Playwright
CategoryBrowser automation / fingerprint spoofing / AI agent tooling
Primary UseDriving Camoufox from shell-capable agents (Claude Code, Cursor, Codex, OpenClaw) for scraping and research on sites with aggressive bot detection, with stable spoofed identities via --persistent
Safe UseIntended for authorized security assessments, red-team lab exercises, scraping of resources you are licensed to access, and defensive research into browser fingerprinting; it must not be used to violate site terms or access systems without permission
Telemetry NoteDespite spoofing canvas, WebGL, audio, fonts and screen metrics, traffic still leaves proxy logs, TLS/HTTP fingerprints, and behavioral patterns (interaction timing, navigation cadence) that defenders and anti-bot vendors can correlate; Unix socket activity and ~/.camoufox-cli/profiles/ artifacts are visible on the host

camoufox-cli is a Python/Node-distributed command-line interface that exposes the Camoufox anti-detect Firefox fork to any AI agent or human who can run shell commands. Rather than asking an agent to generate browser automation code, the tool's philosophy is explicit in its README: shell commands, no code generation. An agent issues discrete verbs — open, snapshot, click, fill — and consumes structured text output, which is a far safer interaction model for autonomous agents than handing them a Playwright script to improvise. The repo sits at roughly 350 stars, is MIT-licensed, and is written primarily in Python with an npm distribution path, which hints at a deliberate packaging strategy aimed at agent ecosystems.


The core value proposition is C++-level fingerprint spoofing inherited from Camoufox, covering canvas, WebGL, audio context, screen metrics, and fonts. This matters because most anti-detect wrappers operate at the JavaScript injection layer, which sophisticated bot-detection vendors can probe for inconsistencies. By patching deeper in the browser stack, Camoufox-derived builds present a more internally coherent fake device, and camoufox-cli makes that coherence persistent and scriptable. On top of that, the tool auto-enables GeoIP-consistent timezone and geolocation spoofing whenever a --proxy is active, closing one of the most common operational inconsistencies — a browser claiming one locale while egressing from another.


Architecturally, the README documents a clean three-stage pipeline: the camoufox-cli binary talks over a Unix socket to a long-running Python daemon, which in turn drives Camoufox (Firefox) through Playwright. The daemon auto-starts on first command and auto-exits after 30 minutes of idle, configurable with --timeout. This design solves the classic CLI-browser problem where every invocation pays browser startup cost; instead, the daemon maintains the browser process and — critically — the @ref element registry between commands, so a snapshot taken in one call remains addressable in the next.


Element targeting is done through accessibility-tree snapshots rather than DOM selectors. Running camoufox-cli snapshot -i emits an interactive-only tree where each node carries a [ref=eN] handle, and subsequent commands like click @e1 or fill @e3 "query" resolve against the daemon's registry. Scoped snapshots accept a CSS selector with -s. This mirrors the approach popularized by agentic browser tools because accessibility trees are smaller, more semantically meaningful for LLMs, and more robust to DOM churn than brittle XPath chains. The README also notes a deliberate escape hatch: mouse click at viewport coordinates, documented as reaching elements with no ref — its example is a checkbox inside a cross-origin iframe such as a Cloudflare Turnstile widget, which tells you plainly who this tool expects to be fighting.


The full command surface reads like a compact browser DSL. Navigation includes open, back, forward, reload, url, title, and close. Interaction covers click, fill, type, select, check, hover, press (with combos like Control+a). Extraction offers text @e1, text body, eval for arbitrary JavaScript, and screenshot with base64-JSON or file output plus --full for full-page captures. Waiting primitives — wait 2000, wait @e1, wait --url "*/dashboard" — give agents the patience primitives they notoriously lack. Installation itself is straightforward: npm install -g camoufox-cli (Node 20.10+) or pipx install camoufox-cli, followed by camoufox-cli install to pull the browser from GitHub releases, with --with-deps on Linux.


Identity management is where the tool separates itself from casual scrapers. Three concentric isolation models are documented. Named tabs (--tab ) let concurrent agents share one browser process — same fingerprint, same cookies — while each keeps its own page, refs, and history, at the cost of commands queuing behind slow tabs. Named sessions (--session ) run independent browser processes, each with a fresh random fingerprint and cookie jar. And --persistent [path] freezes an identity into a camoufox-cli.json beside the user data directory: user agent, OS, canvas and font noise seeds are generated once and never change, while locale and proxy-derived timezone/geolocation are stored but track current flags. The README is refreshingly precise about what is frozen, persisted, or per-launch — for example, --proxy is deliberately never stored because proxies rotate, so reusing a stale one silently is treated as a bug to avoid.


Configuration lives in ~/.camoufox-cli/config.json (relocatable via $CAMOUFOX_CLI_CONFIG), with a default block layered under optional per-session blocks. Sessions are never pre-registered; the name passed on the command line simply selects which block applies. Command-line flags always beat the file, which beats built-in defaults, and a broken config is ignored with a stderr warning rather than blocking execution — a small but telling robustness decision for agent-driven workflows where an agent may mangle a config. Note that config is only read at daemon launch, so an already-running session needs close before changes take effect.


The agent integration story is first-class: npx skills add Bin-Huang/camoufox-cli installs skill definitions for Claude Code, Cursor, Codex, and similar harnesses, teaching them the command vocabulary so they can operate the browser without hallucinating flags. Cookie import/export via cookies export file.json and cookies import file.json enables session portability — seeding a session with an authenticated state captured elsewhere, a common workflow in licensed data collection and authorized assessment pivots where re-authenticating through bot walls repeatedly is impractical.


From a defensive perspective, this tool is worth studying even if you never run it. It is a tidy catalog of what modern anti-detection considers necessary: deep fingerprint consistency, geo/locale coherence with egress IP, identity persistence across visits, coordinate-based interaction to bypass iframe-isolated challenges, and accessibility-tree-driven behavior that can look humanlike in cadence. Detection angles remain: TLS and HTTP/2 fingerprints, proxy reputation, behavioral biometrics, and the simple fact that a frozen Camoufox identity is still a finite set of spoofed device profiles that vendors can fingerprint and cluster over time.


Caveats for prospective users: the README's related-tools list is a family of analytics CLIs by the same author, and documentation depth here is genuinely good, but anti-detect tooling sits in a legally gray band — scraping in violation of terms, multi-account abuse, and circumventing challenge widgets can breach contracts or laws like the CFAA depending on jurisdiction and authorization. In authorized contexts — your own test ranges, licensed data collection, red-team labs with written scope, and fingerprinting research — camoufox-cli is a well-engineered, well-documented entry point that treats agents as first-class operators rather than an afterthought.



Official project repository for Bin-Huang/camoufox-cli.

Download Tool

Educational analysis for authorized security professionals. Use only in controlled, authorized environments.






Source: OffensiveSec
Source Link: https://www.offsecblog.com/2026/11/camoufox-cli-for-fingerprint-resistant.html


Comments
new comment
Nobody has commented yet. Will you be the first?
 
Forum
Red Team (CNA)



Copyright 2012 through 2026 - National Cyber Warfare Foundation - All rights reserved worldwide.