pub trait StealthProfile: Send + Sync {
fn user_agent(&self) -> &str;
fn platform(&self) -> &str;
fn webgl_vendor(&self) -> &str;
fn webgl_renderer(&self) -> &str;
fn hardware_concurrency(&self) -> u32;
fn device_memory(&self) -> u32;
fn client_hints_brands(&self) -> Vec<(&str, &str)> {
vec![
("Google Chrome", "129"),
("Chromium", "129"),
("Not=A?Brand", "24"),
]
}
fn client_hints_platform(&self) -> &str {
"Windows"
}
fn bootstrap_script(&self) -> String {
format!(
r#"
// === chaser-oxide HARDWARE HARMONY ===
// Profile: {ua}
// 1. Platform alignment (on prototype to avoid getOwnPropertyNames detection)
Object.defineProperty(Navigator.prototype, 'platform', {{
get: () => '{platform}',
configurable: true
}});
// 2. Hardware specs (on prototype)
Object.defineProperty(Navigator.prototype, 'hardwareConcurrency', {{
get: () => {cores},
configurable: true
}});
Object.defineProperty(Navigator.prototype, 'deviceMemory', {{
get: () => {memory},
configurable: true
}});
// 3. WebGL spoofing (both contexts)
const spoofWebGL = (proto) => {{
const getParameter = proto.getParameter;
proto.getParameter = function(parameter) {{
if (parameter === 37445) return '{webgl_vendor}';
if (parameter === 37446) return '{webgl_renderer}';
return getParameter.apply(this, arguments);
}};
}};
spoofWebGL(WebGLRenderingContext.prototype);
if (typeof WebGL2RenderingContext !== 'undefined') {{
spoofWebGL(WebGL2RenderingContext.prototype);
}}
// 4. Client Hints (on prototype)
Object.defineProperty(Navigator.prototype, 'userAgentData', {{
get: () => ({{
brands: [{brands}],
mobile: false,
platform: "{hints_platform}"
}}),
configurable: true
}});
// 5. Video codecs (H.264/AAC)
const canPlayType = HTMLMediaElement.prototype.canPlayType;
HTMLMediaElement.prototype.canPlayType = function(type) {{
if (type.includes('avc1')) return 'probably';
if (type.includes('mp4a.40')) return 'probably';
if (type === 'video/mp4') return 'probably';
if (type === 'audio/mp4') return 'probably';
return canPlayType.apply(this, arguments);
}};
// 6. WebDriver - set to false (not delete, which makes it undefined)
Object.defineProperty(Object.getPrototypeOf(navigator), 'webdriver', {{
get: () => false,
configurable: true
}});
// 7. window.chrome
window.chrome = {{ runtime: {{}} }};
"#,
ua = self.user_agent(),
platform = self.platform(),
cores = self.hardware_concurrency(),
memory = self.device_memory(),
webgl_vendor = self.webgl_vendor(),
webgl_renderer = self.webgl_renderer(),
brands = self
.client_hints_brands()
.iter()
.map(|(b, v)| format!(r#"{{ brand: "{}", version: "{}" }}"#, b, v))
.collect::<Vec<_>>()
.join(", "),
hints_platform = self.client_hints_platform(),
)
}
}
#[derive(Debug, Clone, Default)]
pub struct WindowsNvidiaProfile;
impl StealthProfile for WindowsNvidiaProfile {
fn user_agent(&self) -> &str {
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
}
fn platform(&self) -> &str {
"Win32"
}
fn webgl_vendor(&self) -> &str {
"Google Inc. (NVIDIA)"
}
fn webgl_renderer(&self) -> &str {
"ANGLE (NVIDIA, NVIDIA GeForce RTX 3080 Direct3D11 vs_5_0 ps_5_0)"
}
fn hardware_concurrency(&self) -> u32 {
8
}
fn device_memory(&self) -> u32 {
8
}
}
#[derive(Debug, Clone, Default)]
pub struct MacOSProfile;
impl StealthProfile for MacOSProfile {
fn user_agent(&self) -> &str {
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
}
fn platform(&self) -> &str {
"MacIntel"
}
fn webgl_vendor(&self) -> &str {
"Google Inc. (Apple)"
}
fn webgl_renderer(&self) -> &str {
"ANGLE (Apple, Apple M1 Pro, OpenGL 4.1)"
}
fn hardware_concurrency(&self) -> u32 {
10
}
fn device_memory(&self) -> u32 {
16
}
fn client_hints_platform(&self) -> &str {
"macOS"
}
}
#[derive(Debug, Clone, Default)]
pub struct LinuxProfile;
impl StealthProfile for LinuxProfile {
fn user_agent(&self) -> &str {
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
}
fn platform(&self) -> &str {
"Linux x86_64"
}
fn webgl_vendor(&self) -> &str {
"Google Inc. (NVIDIA Corporation)"
}
fn webgl_renderer(&self) -> &str {
"NVIDIA GeForce GTX 1080/PCIe/SSE2"
}
fn hardware_concurrency(&self) -> u32 {
8
}
fn device_memory(&self) -> u32 {
16
}
fn client_hints_platform(&self) -> &str {
"Linux"
}
}