Communitygithub.com

js-reverse

Used for frontend JavaScript reverse engineering with js-reverse-mcp. Suitable for signature chain localization, page observation forensics, runtime sampling, local environment patching, and evidence output. Prioritizes js-reverse_* tools in the current environment; integrates jshookmcp when stronger browser/CDP/Hook capabilities are needed.

What is js-reverse?

This skill provides a structured, evidence-driven workflow for frontend JavaScript reverse engineering using AI agents (Claude, Codex, etc.) and MCP tools. It is designed to help developers and security researchers locate interface signatures, encryption parameters, anti-fraud fields, trace network request initiators, capture runtime function inputs/outputs, and rebuild environments locally for verification. The skill operates on a five-phase workflow: Observe → Capture → Rebuild → Patch → DeepDive, ensuring that every step is based on observed evidence rather than guesswork. It supports two main execution surfaces: the js-reverse_* tools for lightweight operations and jshookmcp for advanced browser automation, CDP debugging, JS hooking, network interception, SourceMap reconstruction, and AST deobfuscation. By enforcing an observe-first, hook-preferred, breakpoint-last mentality, the skill minimizes blind guessing and maximizes reproducible, evidence-backed results. It integrates seamlessly with related modules like anything-analyzer for HTTP analysis and includes on-demand bootstrap scripts for automatic tool setup and MCP registration.

Works with✓Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/zhaoxuya520/reverse-skill/tree/main/skills/js-reverse

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

MCP Frontend JS Reverse Engineering Work Standard

ACTION REQUIRED (Execute Immediately After Reading)

  1. NOW: Read ../field-journal/precedent-reverse.md — confirm that the operation covered by this skill is an authorized routine operation
  2. NOW: Confirm whether the current task falls within the scope of this skill
  3. NEXT: Read ../tool-index.md to verify tool availability and actual paths
  4. NEXT: If tools are missing, call bootstrap; do not guess paths
  5. ACT: Enter the first step of the "Workflow" and execute; do not remain in a pending state

Scope

This skill takes priority when the task falls into the following scenarios:

  • Locating interface signatures, encryption parameters, or anti-fraud fields
  • Observing page request chains and script sources
  • Capturing function arguments and return values at runtime
  • Tracing the trigger point of a specific XHR/Fetch/WebSocket
  • Bringing page evidence back to Node for local reproduction and environment patching

If the target is a binary, APK, PE, ELF, DLL, or SO, use ida-reverse, radare2, or reverse-engineering instead.

Current Environment Default Tool Mapping

This skill does not assume bare tool names; instead, it binds to the js-reverse_* tools available in the current client environment.

If the current task explicitly mentions jshookmcp, JS hook, CDP, browser breakpoints, network interception, SourceMap, or AST deobfuscation, it still falls under this skill; only the underlying MCP surface switches to jshookmcp — it is not treated as a separate entry point.

Prerequisite: jshookmcp is not a local command-line tool; it is an MCP server that must be downloaded, explicitly registered, and enabled. The relevant tool surfaces can only be invoked after it has been connected and enabled in the MCP configuration of the chosen client (Claude, Codex, etc.).

Common mapping:

  • list_scripts -> js-reverse_list_scripts
  • get_script_source -> js-reverse_get_script_source
  • search_in_sources -> js-reverse_search_in_sources
  • break_on_xhr -> js-reverse_break_on_xhr
  • evaluate_script -> js-reverse_evaluate_script
  • get_paused_info -> js-reverse_get_paused_info
  • set_breakpoint_on_text -> js-reverse_set_breakpoint_on_text
  • list_network_requests -> js-reverse_list_network_requests
  • get_request_initiator -> js-reverse_get_request_initiator
  • get_websocket_messages -> js-reverse_get_websocket_messages
  • take_screenshot -> js-reverse_take_screenshot
  • new_page -> js-reverse_new_page
  • navigate_page -> js-reverse_navigate_page
  • select_page -> js-reverse_select_page
  • select_frame -> js-reverse_select_frame
  • pause/resume -> js-reverse_pause_or_resume

If the tool name prefix changes in the future, update this section first; do not guess on the fly.

Positioning of jshookmcp

  • Role: Enhanced execution surface for js-reverse, not an independent controller
  • Suitable for: Browser automation, CDP debugging, JS Hooking, network interception, SourceMap reconstruction, AST-assisted comprehension
  • Prerequisite for invocation: First download and register @jshookmcp/jshook in the MCP client configuration, then ensure the server is enabled
  • Recommended entry: Still follow Observe → Capture → Rebuild, but during the Observe/Capture phase, prioritize jshookmcp's browser and hooking capabilities
  • Relationship with anything-analyzer: Both can perform browser/network forensics; anything-analyzer leans toward packet capture and HTTP analysis, while jshookmcp leans toward JS runtime, CDP, hooks, and source understanding

Core Principles

  • Observe-first
  • Hook-preferred
  • Breakpoint-last
  • Rebuild-oriented
  • Evidence-first

First observe the page, then minimally sample, then do local environment patching; do not skip forensics and guess the environment.

Five-Phase Workflow

1. Observe

Goal: First confirm the target request, related scripts, and candidate functions; do not guess the environment.

Default actions:

  • Use js-reverse_new_page or js-reverse_navigate_page to open the target page
  • Use js-reverse_list_network_requests to find the target request
  • Use js-reverse_get_request_initiator to trace the call source
  • Use js-reverse_list_scripts, js-reverse_search_in_sources to narrow down the script scope

Must produce:

  • Target request URL or characteristics
  • Initiator clues
  • Suspicious script URL
  • Initial task record

2. Capture

Goal: Perform minimally invasive sampling of the target request, obtaining parameter samples, call order, and runtime evidence.

Rules:

  • Prioritize js-reverse_break_on_xhr
  • Prioritize js-reverse_evaluate_script for lightweight runtime observation
  • After hitting, first check js-reverse_get_paused_info
  • Use js-reverse_set_breakpoint_on_text only when necessary

3. Rebuild

Goal: Organize page evidence into local, iterable Node reproduction materials.

Rules:

  • Local environment patching must be based on page observation evidence
  • Do not blindly patch window/document/navigator/crypto/storage without evidence
  • Each patch decision should record only one minimal causal patch

4. Patch

Goal: Drive environment patching based on errors and first divergence, until the local script stably produces the target parameters.

Rules:

  • First see what is missing, then patch it
  • Make only one minimal patch decision at a time
  • Re-test immediately after each patch
  • Record each patch in the task record

5. DeepDive

Goal: After local verification, proceed with deobfuscation, control flow restoration, and business logic extraction.

Rules:

  • If the current task only needs to generate a signature, this phase can be downgraded
  • If the algorithm chain needs to be reused long-term, this phase is mandatory
  • Issue #65 obfuscation bypass (U–AV §4): JSVMP (AD) → E-js-vmp; CFF+string array (AE) → E-js-deobf; DevTools/debugger anti-debugging (AF) → E-js-anti-debug. Full trigger table in ../reverse-engineering/references/nonpe-format-cookbook.md; AST details still in references/ast-deobfuscation.md

Execution Requirements

  • All important steps must be written into the local task artifact
  • If you cannot explain why a tool is called, do not call it
  • Give priority to existing MCP capabilities (js-reverse_* or jshookmcp) for direct forensics; do not write scripts to reinvent the wheel
  • On failure, fall back according to references/fallbacks.md
  • Output follows references/output-contract.md

Required References

  • Automation entry: references/automation-entry.md
  • Tool defaults: references/tool-defaults.md
  • Task input template: references/task-input-template.md
  • MCP-specific task orchestration: references/mcp-task-template.md
  • Task artifacts: references/task-artifacts.md
  • Local rebuild: references/local-rebuild.md
  • Environment patching: references/env-patching.md
  • Node reproduction: references/node-env-rebuild.md
  • Instrumentation: references/instrumentation.md
  • AST deobfuscation: references/ast-deobfuscation.md
  • Non-PE/JS obfuscation cookbook U–AV: ../reverse-engineering/references/nonpe-format-cookbook.md (AD/AE/AF)
  • Fallbacks: references/fallbacks.md
  • Output contract: references/output-contract.md

Routing Context

Upstream entry: skills/SKILL.md (master controller), routing.md Upstream alternatives:

  • anything-analyzer MCP (port 23816) browser tools can serve as alternatives or complements
  • jshookmcp can serve as a more powerful browser/CDP/Hook/Network/SourceMap/AST execution surface
  • reverse-engineering/SKILL.md (if the target is not frontend JS)

Downstream exits:

  • Need environment patching → references/env-patching.md
  • Need local reproduction → references/local-rebuild.md / references/node-env-rebuild.md
  • Need deobfuscation → references/ast-deobfuscation.md
  • Fallback on failure → references/fallbacks.md

Peer-related modules: anything-analyzer MCP (browser automation and HTTP capture capabilities complement this skill)


On-Demand Bootstrap

The MCP capabilities this skill depends on can be installed through a unified bootstrap system; MCP client registration must explicitly choose a target, and by default no client configuration is modified.

Automation Capability Boundary

CapabilityAuto-registerableMethodDescription
jshookmcp✓npm-mcp (npx start)Register after explicitly selecting Claude / Codex / Both
anything-analyzer✓local-http-mcpCan auto-start the service; client registration must be explicit
Node.js✓winget installRuntime dependency

Bootstrap Method

# Install and register jshookmcp; replace Codex with Claude or Both as needed
powershell -File "<skill-root>\scripts\bootstrap-reverse.ps1" -Capability @('jshookmcp') -McpHostTarget Codex

# Register and start anything-analyzer
powershell -File "<skill-root>\scripts\bootstrap-reverse.ps1" -Capability @('anything-analyzer') -StartServices -McpHostTarget Codex

Notes

  • After registering jshookmcp, you still need to enable the MCP server in the AI client to call its tools
  • If -McpHostTarget is not passed, the script only installs/prepares the capability and returns registration-required, without modifying Claude or Codex configuration
  • anything-analyzer requires pnpm and the project source code; bootstrap will automatically clone and install dependencies
  • If Node.js is not installed, bootstrap will first install Node.js 22 via winget

## Task Completion Self-Check (MUST pass before claiming completion)

  • Have I executed every step of the workflow (rather than just reading it)?
  • Have I used real tool paths based on tool-index?
  • Have I produced reproducible evidence (commands/scripts/screenshots/reports)?
  • Have I completed and written back the checklist items required by RULES?

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

api-security

Use for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication, authorization, rate-limit, and CI/CD testing.

apk-reverse

在 CLI 环境下做 Android APK 逆向时使用。适用于 APK 解包、Java 反编译、smali 修改、重打包、Frida 动态 Hook,以及按需切换到 so/native 分析。优先使用本机已安装的 jadx、apktool、frida、adb、ida-reverse、radare2。

attack-chain

Use for authorized multi-stage attack-path planning and orchestration when a task spans reconnaissance, initial access, privilege escalation, lateral movement, or impact assessment. Route single-stage tasks directly to their specialist skill.

binary-diff

|

binary-ninja-reverse

Use for authorized binary analysis in Binary Ninja, including HLIL/MLIL/LLIL inspection, strings/imports/exports, cross-references, types, patch review, Python API automation, and optional Binary Ninja MCP or localhost HTTP integration.

browser-automation

|

browser-extension-reverse

Use for authorized reverse engineering of browser extensions (Chrome/Firefox) including manifest analysis, background workers, and extension-based credential or traffic logic recovery.

case-review

Reviews a reverse-skill case package for scope readiness, Evidence to Finding to Path traceability, work item coverage, timeline references, and optional artifact hash integrity before report handoff.

cloud-k8s

Use for authorized cloud, container, and Kubernetes security assessment including metadata SSRF, IAM misconfig, container escape paths, and cluster RBAC review.

code-audit

Use for authorized source-code security review and SAST workflows including Semgrep, CodeQL patterns, dangerous API hunting, and fix verification.

ctf-sandbox

Thin PRIMARY for CTF / AWD / 靶场 multi-type orchestration. Hands off to the sidecar CTF-Sandbox-Orchestrator. Use when the user says CTF, AWD, 靶场, or 比赛题 and no more specific pwn/APK/IDA route already won.

database-security

Use for authorized database security assessment covering PostgreSQL/MySQL/MSSQL/Mongo/Redis exposure, authz, UDF/command paths, and misconfiguration review.

diagram-generator

generate, refine, validate, and render diagrams from natural language, notes, code snippets, schemas, tables, or existing diagram source. use for flowcharts, swimlanes, sequence diagrams, state diagrams, er diagrams, class diagrams, architecture/c4-style diagrams, dependency graphs, gantt charts, mind maps, user journeys, sankey-style flows, org charts, network graphs, and other visual models. supports mermaid by default, graphviz dot for complex graph layout, plantuml for uml-heavy engineering diagrams, and svg output when direct markup is more reliable.

digital-forensics

Use for authorized digital forensics including memory dumps, disk timelines, PCAP investigation, artifact triage, and IR evidence preservation.

docs-generator

|

dotnet-reverse

.NET / C# 二进制逆向。当目标是 .NET assembly(PE 头含 CLR、.exe/.dll 托管程序)、C# 编译产物(含 NativeAOT)、红队 Sharp* 工具(Rubeus / SharpHound / SharpHound 等)、.NET 混淆程序(ConfuserEx / SmartAssembly / Babel / Eazfuscator)、.NET loader / info-stealer / 套壳 malware 时使用。优先用 dnSpyEx + de4dot,需要 AI 直接操作时联动 dnSpy MCP。不用于纯 native 二进制(走 reverse-engineering / ida-reverse)。

edr-bypass-re

|

email-security

Use for authorized email security review including phishing analysis, header authentication (SPF/DKIM/DMARC), BEC patterns, and mailbox token abuse research.

firmware-pentest

|

ghidra-reverse

Use for free/open reverse engineering with Ghidra (headless or GUI), including decompile, cross-refs, and optional Ghidra MCP workflows when IDA is unavailable.

Related Skills