Spoof-when-possible browser personas, Tier-2 telemetry kill + artifact wipe, UI polish
Browser: identity persona dropdown (blend Windows-Chrome / Firefox / mac-Safari / hardened / custom) + cookie policy dropdown. Blend personas relax RFP/FPI/strict-TP so the machine looks normal while still hiding behind the chain. Persona TZ applied via env var; UA / language / locale / screen via user.js. WebRTC still forced off (it leaks real IP). Privacy: Telemetry kill toggle (DiagTrack, Activity History, ad ID, Cortana, scheduled tasks) with full snapshot/restore. One-button forensic artifact wipe (TEMP, Recent, Jump Lists, Prefetch, MRU, clipboard). UI: neon palette, glow card borders, gradient header banner. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -217,6 +217,65 @@ class TestValidator(unittest.TestCase):
|
||||
self.assertIsNone(asyncio.run(run()))
|
||||
|
||||
|
||||
class TestBrowserPersona(unittest.TestCase):
|
||||
def test_blend_persona_relaxes_block_flags(self) -> None:
|
||||
from proxy_chain_manager.browser_profile import (
|
||||
FirefoxHardening, apply_persona, build_user_js,
|
||||
)
|
||||
h = FirefoxHardening(
|
||||
persona_key="blend_windows_chrome",
|
||||
resist_fingerprinting=True,
|
||||
first_party_isolation=True,
|
||||
strict_tracking_protection=True,
|
||||
timezone_utc=True,
|
||||
)
|
||||
applied = apply_persona(h)
|
||||
self.assertFalse(applied.resist_fingerprinting)
|
||||
self.assertFalse(applied.first_party_isolation)
|
||||
self.assertFalse(applied.strict_tracking_protection)
|
||||
self.assertFalse(applied.timezone_utc)
|
||||
self.assertIsNotNone(applied.persona)
|
||||
# And the user.js carries a spoofed UA when blend is selected.
|
||||
js = build_user_js("127.0.0.1", 18888, h)
|
||||
self.assertIn("general.useragent.override", js)
|
||||
self.assertIn("Chrome/124", js)
|
||||
|
||||
def test_hardened_persona_keeps_block_flags(self) -> None:
|
||||
from proxy_chain_manager.browser_profile import FirefoxHardening, apply_persona
|
||||
h = FirefoxHardening(
|
||||
persona_key="hardened",
|
||||
resist_fingerprinting=False, # should be forced True
|
||||
first_party_isolation=False,
|
||||
)
|
||||
applied = apply_persona(h)
|
||||
self.assertTrue(applied.resist_fingerprinting)
|
||||
self.assertTrue(applied.first_party_isolation)
|
||||
self.assertTrue(applied.strict_tracking_protection)
|
||||
self.assertIsNone(applied.persona)
|
||||
|
||||
def test_cookie_behavior_mapping(self) -> None:
|
||||
from proxy_chain_manager.browser_identity import (
|
||||
cookie_behavior_value, cookie_session_only,
|
||||
)
|
||||
self.assertEqual(cookie_behavior_value("accept_all"), 0)
|
||||
self.assertEqual(cookie_behavior_value("block_third_party"), 1)
|
||||
self.assertEqual(cookie_behavior_value("block_third_party_trackers"), 4)
|
||||
self.assertEqual(cookie_behavior_value("session_only"), 0)
|
||||
self.assertEqual(cookie_behavior_value("block_all"), 2)
|
||||
self.assertTrue(cookie_session_only("session_only"))
|
||||
self.assertFalse(cookie_session_only("accept_all"))
|
||||
|
||||
def test_persona_env_returns_tz_for_blend(self) -> None:
|
||||
from proxy_chain_manager.browser_profile import FirefoxHardening, persona_env
|
||||
env = persona_env(FirefoxHardening(persona_key="blend_windows_chrome"))
|
||||
self.assertIn("TZ", env)
|
||||
self.assertTrue(env["TZ"])
|
||||
|
||||
def test_persona_env_empty_for_hardened(self) -> None:
|
||||
from proxy_chain_manager.browser_profile import FirefoxHardening, persona_env
|
||||
self.assertEqual(persona_env(FirefoxHardening(persona_key="hardened")), {})
|
||||
|
||||
|
||||
class TestPrivacyLan(unittest.TestCase):
|
||||
def test_snapshot_round_trip(self) -> None:
|
||||
from proxy_chain_manager.privacy_lan import (
|
||||
|
||||
Reference in New Issue
Block a user