fix: randomize hardware fingerprints across sessions #74

Merged
steve merged 1 commits from feature/71-randomize-fingerprints into main 2026-02-24 01:39:27 +00:00
Collaborator

Summary

  • Replace static stealthChromiumScripts and stealthFirefoxScripts slices with buildChromiumStealthScripts() and buildFirefoxStealthScripts() builder functions that accept hardware profile structs
  • Add pools of 6 realistic hardware profiles per engine (Chromium uses ANGLE strings, Firefox uses Mesa/native driver strings), randomly sampled per session via math/rand/v2
  • Chromium connection stats receive per-session jitter: ±20ms RTT, ±2 Mbps downlink
  • Profile index 0 preserves the original hardcoded values so existing marker-based test checks pass unchanged

Parent: Epic #68
Closes: #71

Test plan

  • go build ./... passes
  • go vet ./... clean
  • go test ./... — all 14 adapted tests pass with builder functions, plus 7 new tests:
    • TestChromiumHWProfiles_NotEmpty / TestFirefoxHWProfiles_NotEmpty — pool has ≥2 entries
    • TestBuildChromiumStealthScripts_ProfileValues / TestBuildFirefoxStealthScripts_ProfileValues — known profile values appear in output
    • TestBuildChromiumStealthScripts_ConnectionJitter — 50 calls with same profile, connection script varies
    • TestChromiumHWProfiles_NoSingleQuotes / TestFirefoxHWProfiles_NoSingleQuotes — guard against JS string breakage

🤖 Generated with Claude Code

## Summary - Replace static `stealthChromiumScripts` and `stealthFirefoxScripts` slices with `buildChromiumStealthScripts()` and `buildFirefoxStealthScripts()` builder functions that accept hardware profile structs - Add pools of 6 realistic hardware profiles per engine (Chromium uses ANGLE strings, Firefox uses Mesa/native driver strings), randomly sampled per session via `math/rand/v2` - Chromium connection stats receive per-session jitter: ±20ms RTT, ±2 Mbps downlink - Profile index 0 preserves the original hardcoded values so existing marker-based test checks pass unchanged **Parent:** Epic #68 **Closes:** #71 ## Test plan - [x] `go build ./...` passes - [x] `go vet ./...` clean - [x] `go test ./...` — all 14 adapted tests pass with builder functions, plus 7 new tests: - `TestChromiumHWProfiles_NotEmpty` / `TestFirefoxHWProfiles_NotEmpty` — pool has ≥2 entries - `TestBuildChromiumStealthScripts_ProfileValues` / `TestBuildFirefoxStealthScripts_ProfileValues` — known profile values appear in output - `TestBuildChromiumStealthScripts_ConnectionJitter` — 50 calls with same profile, connection script varies - `TestChromiumHWProfiles_NoSingleQuotes` / `TestFirefoxHWProfiles_NoSingleQuotes` — guard against JS string breakage 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Claude added 1 commit 2026-02-24 01:38:30 +00:00
fix: randomize hardware fingerprint values across browser sessions
All checks were successful
CI / build (pull_request) Successful in 30s
CI / vet (pull_request) Successful in 2m17s
CI / test (pull_request) Successful in 2m21s
4772b153b8
Replace static stealthChromiumScripts and stealthFirefoxScripts slices
with builder functions that accept hardware profile structs. Each browser
session now randomly selects from a pool of 6 realistic profiles per
engine, and Chromium connection stats receive per-session jitter (±20ms
RTT, ±2 Mbps downlink). This prevents anti-bot systems from correlating
sessions via identical WebGL, connection, mozInnerScreen, and
hardwareConcurrency fingerprints.

Closes #71

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
steve merged commit 01aea52533 into main 2026-02-24 01:39:27 +00:00
steve deleted branch feature/71-randomize-fingerprints 2026-02-24 01:39:27 +00:00
Sign in to join this conversation.