inject_hook_preset
Inject pre-built hooks to monitor network requests, capture encryption I/O, or bypass anti-debugging traps for JavaScript reverse engineering.
Instructions
Inject a pre-built hook template for common reverse engineering tasks.
Hooks are injected with Object.defineProperty protection to prevent page scripts from overriding them. By default, hooks are persistent across navigations.
Available presets: - "xhr": Hook XMLHttpRequest to log all XHR requests (URL, method, headers, body, stack). - "fetch": Hook window.fetch to log all fetch requests. - "crypto": Hook btoa/atob/JSON.stringify to capture encryption I/O. - "websocket": Hook WebSocket to log all WS messages. - "debugger_bypass": Bypass anti-debugging traps (infinite debugger loops, Function constructor checks, setInterval checks).
Args: preset: One of "xhr", "fetch", "crypto", "websocket", "debugger_bypass". persistent: If True (default), inject at context level so hooks survive page navigation and reload automatically.
Returns: dict with status and the preset name.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| preset | Yes | ||
| persistent | No |