Skip to main content

Module peripheral_stealth

Module peripheral_stealth 

Source
Expand description

Peripheral detection surface hardening.

Covers secondary browser detection vectors that build bot-confidence scores:

  1. iframe innerWidth mismatch — ensures iframe inner dimensions differ slightly from the parent window (Kasada check).
  2. Document visibility — forces document.hidden = false and visibilityState = "visible".
  3. Camera / microphone device names — returns platform-appropriate fake device names with seeded random deviceId/groupId.
  4. Port scan protection — blocks fetch and XMLHttpRequest to localhost on commonly-probed ports.
  5. History length — overrides history.length to a plausible 3-8.
  6. requestAnimationFrame timing — adds light per-frame jitter to prevent headless rAF timing detection.
  7. PDF viewer — ensures navigator.pdfViewerEnabled reads true.

§Example

use stygian_browser::peripheral_stealth::{peripheral_stealth_script, PeripheralStealthConfig};
use stygian_browser::noise::NoiseSeed;

let cfg = PeripheralStealthConfig::default_with_seed(NoiseSeed::from(1_u64));
let js = peripheral_stealth_script(&cfg);
assert!(js.contains("document.hidden"));
assert!(js.contains("History.prototype"));

Structs§

PeripheralStealthConfig
Per-subsystem toggles for peripheral stealth injection.

Functions§

peripheral_stealth_script
Generate the peripheral stealth injection script.
peripheral_stealth_script_with_profile
Generate peripheral stealth script with optional FingerprintProfile for platform-aware device names.