feat(stealth): harden CDP debugger detection countermeasures#644
Merged
feat(stealth): harden CDP debugger detection countermeasures#644
Conversation
Add 6 new anti-detection patches to stealth.ts and CDP-level debugger statement neutralization to reduce risk of bot detection on platforms like Xiaohongshu. New patches: - Shared toString disguise via WeakMap (undetectable by anti-bot scripts) - Anti-debugger statement trap (Function/eval patching + CDP Debugger.setBreakpointsActive) - Console method fingerprinting defense (re-wrap CDP-bound console methods) - Window dimension detection defense (outerWidth/outerHeight normalization) - Performance API entry filtering (remove debugger/devtools entries) - document.$cdc_ property cleanup (backup for window-level cleanup) - Iframe contentWindow.chrome consistency
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
stealth.tsto hide CDP debugger fingerprintsDebugger.setBreakpointsActive(false)in extension to neutralizedebugger;statement trapsNew Stealth Patches
Function.prototype.toStringdisguise viaWeakMapFunction.hasOwnProperty('toString'),Function.prototype.toString.call(fn)bypassdebugger;timing side-channel (JS-levelFunction/evalpatching + CDPDebugger.setBreakpointsActive)Runtime.enablereplaces console methods with bound functions that have differenttoString()outerWidth - innerWidth/outerHeight - innerHeightdelta detectionperformance.getEntries()leaking debugger/devtools entriesdocument(backup for existingwindowcleanup)window.chromeconsistency checkTest plan