rustenium-identity
A Rust crate that transforms a raw CDP browser session into a fully-personified browser instance. Built on top of rustenium, it consumes an identity record and applies fingerprint spoofing to make the session indistinguishable from a real user.
Features
- Full UA construction for all OS/browser combinations (Windows, macOS, Linux, Android, iOS x Chrome, Safari, Edge)
- iOS-aware: CriOS/EdgiOS user agents, no client hints, Safari stealth block for all iOS browsers
- CDP emulation overrides: screen metrics, locale, timezone, touch, hardware concurrency
- Client Hints (Sec-CH-UA) for Chrome/Edge with platform-specific grease brands
- JS stealth injection via
Page.addScriptToEvaluateOnNewDocument(runs before page JS):- Navigator properties (platform, hardwareConcurrency, deviceMemory, languages, maxTouchPoints, webdriver)
- WebGL parameter spoofing (vendor/renderer)
- Battery status with randomized percentage
- History count manipulation
- Browser-specific overrides (Chrome plugins, Safari vendor, Edge plugins)
- Timezone resolution: explicit value or auto-fetch from ip-api.com via proxy
- Runtime GPU update via
Runtime.evaluate - Optional BSON deserialization behind
bsonfeature flag
Quick Start
use ;
async
Identity JSON Example
Custom ChromeConfig
use ChromeConfig;
use ;
let identity = from_json?;
let config = new;
let mut session = launch.await?;
Project Structure
src/
lib.rs - Public API (IdentityConfig, IdentitySession)
identity.rs - Data model (Identity, Gpu, Os, Browser, etc.)
ua.rs - User-agent string construction
cdp.rs - CDP emulation commands + client hints
script/mod.rs - Stealth JS builder (template substitution)
tz.rs - Timezone resolution
error.rs - Error types
js/
property_modifier.js - Stealthy property spoofing utility
main_world.js - Main stealth script (templated)
browser_chrome.js - Chrome-specific overrides
browser_safari.js - Safari-specific overrides
browser_edge.js - Edge-specific overrides
update_gpu.js - Runtime GPU update script