js-analyze
Skill0 starsChanged 3 months agoMITView on GitHub
Deep JavaScript attack-surface analysis for web apps - crawl every script (external, inline, lazy-loaded), recover exposed source maps, and extract endpoints, parameters, APIs, secrets, dangerous sinks and tech stack into a ranked report with runnable curl commands. TRIGGER: user wants to analyse a site's JavaScript, hunt endpoints/secrets/APIs in JS bundles, find hidden routes or shadow APIs, check for exposed sourcemaps, map a SPA's client-side attack surface, or says 'js recon' / 'analyse the JS' / 'what's in this bundle'.
In this repository15 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- templates/CLAUDE.mdCLAUDE.md
- ffuf-web-fuzzingSkill
- hunt-aiSkill
- hunt-atoSkill
- hunt-bxssSkill
- hunt-idorSkill
- hunt-rbacSkill
- hunt-rceSkill
- hunt-reconSkill
- hunt-ssrfSkill
- hunt-vibecodedSkill
- hunt-xssSkill
- triage-findingSkill
- write-reportSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 3 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 61
Read the program policy. Note the automation rules and the exclusion list — a confirmed bug can still be out of scope, and finding that out …
- Very specific: line 64
If the program forbids automated scanning/crawling, do not run jsx_collect.py.
- Very specific: line 127
No maps exposed? Fall back to webcrack (see references/deobfuscation.md) to split one bundle into per-module files, which is what makes …
- Very specific: line 166
Write REPORT.md using the structure in references/output.md.
- Very specific: line 177
Every half-chain gets recorded as a lead with its named missing link (feedback_always-chain-vulns), not dropped.
- Distinctive: line 183
Never run the browser harvest and a big grep pass simultaneously.
- Very specific: line 184
Run directories on real disk, not /tmp.
- Distinctive: line 195
Never report a path as vulnerable because it appears in a bundle.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
js-analyze — JavaScript Attack-Surface Analysis
You are assisting an authorized bug bounty hunter working under a program's published policy. This skill turns a target's client-side JavaScript into a ranked, evidence-backed attack surface.
The goal, stated precisely
Not "read the JavaScript". The deliverable is six answers, each backed by a file on disk and, where it matters, a curl command that reproduces it:
| Lane | The question it answers |
| Endpoints | What paths exist — live, historical, and which respond with no credentials? |
| Params | What inputs does the client send, and which names are statistically vuln-prone? |
| APIs | What is the API surface: REST bases, GraphQL operations, auth model, mutating calls? |
| Secrets | What credentials shipped to the browser, and is any of it actually exploitable? |
| Sinks | Which dangerous functions exist, and can user input reach them? |
| Tech | What framework, libraries, versions, feature flags and client-side gates? |
A finding that is not backed by a file in the run directory does not exist.
Why this is split into phases
A modern bundle is 5–40 MB of minified code. Reading it is not an option: it
blows the 1 MB context rule in ~/.claude/CLAUDE.md and OOMs this 5.7 GB VM.
So the pipeline shrinks before it reads. Collection and extraction happen on
disk via tools; only the small, pre-filtered lane outputs are ever read into
context. You should never open a file from raw/. Use jsx_ctx.py to look
at a bounded window around a specific offset instead.
Run layout
Everything lands in one run directory. Keep it on real disk — never /tmp,
which is a 2.9 GB tmpfs shared with Chrome on this box.
~/js-runs/<target>-<date>/
raw/ harvested scripts, content-addressed <- NEVER read directly
sources/ original files recovered from source maps <- DO read these
state/ dom/ __NEXT_DATA__, hydration globals, rendered HTML
inventory.jsonl one line per unique script (url, hash, bytes, seen_on)
network.jsonl every response the browser saw
chunks.txt chunk URLs incl. ones the crawl never loaded
routes.jsonl client-side routes from framework manifests
tech.json framework/library evidence with hit counts
sourcemaps.jsonl every exposed map found
lanes/ the six small slices — this is what you read
probe.jsonl anon vs authenticated results per path
curl_commands.sh reproducible evidence
REPORT.md the deliverablePhase 0 — Scope and rules (never skip)
- Read the program policy. Note the automation rules and the exclusion list — a confirmed bug can still be out of scope, and finding that out after building a PoC wastes the whole effort.
- If the program forbids automated scanning/crawling, do not run
jsx_collect.py. Use the Caido path in Phase 1c instead: it sends zero extra packets. - Confirm in-scope hosts. Everything below runs only against those.
Phase 1 — Collect (the part most tools get wrong)
Getting "the JavaScript" means more than downloading .js files. Run whichever
of these apply; they are complementary, not alternatives.
1a. Browser harvest — the primary source.
python3 scripts/jsx_collect.py --seeds seeds.txt --out $RUN --max-pages 25Drives real Chromium and captures every script V8 parses via
Debugger.scriptParsed — external bundles, inline <script> blocks,
lazily-imported chunks, runtime-injected scripts, eval'd code. A URL-fetching
crawler structurally cannot see most of that. It also scrolls each page to fire
lazy loading, spiders same-scope links, and snapshots __NEXT_DATA__-style
payloads that live in non-executable script tags.
Useful flags: --proxy http://127.0.0.1:8080 (route through Caido so the traffic
is captured too), --headed (some bot checks pass a visible browser when they
block headless), --profile ~/.jsx-profiles/target (reuse a logged-in session —
authenticated JS is usually where the interesting code is), --delay (be
polite).
1b. Framework manifest expansion — the highest-yield step.
python3 scripts/jsx_expand.py --run $RUN --base https://target.com --fetchBundlers ship a manifest naming every chunk and route, including admin areas
the crawl never reached. This reads Next.js _buildManifest.js, webpack runtime
id→hash tables, and Vite manifests, then fetches chunks the crawl never loaded.
Routes found here that are not linked anywhere are exactly the ones to probe.
1c. Caido harvest — for no-automation programs and authenticated flows.
python3 scripts/jsx_caido.py --run $RUN --host target.comPulls JS bodies out of the Caido project DB (read-only) from traffic you
already generated by browsing manually. ROE-safe, authenticated, zero extra
requests. See the caido-setup memory.
1d. Historical.
bash scripts/jsx_hist.sh $RUN target.com --fetchOld bundles are a separate surface: endpoints removed from the UI but live on the server, params that still work, keys "rotated" by deleting the file. Also yields a free target-specific parameter wordlist.
Phase 2 — Make it readable
python3 scripts/jsx_maps.py --run $RUNDo this before any analysis. An exposed .map turns a minified bundle back
into the original TypeScript/JSX tree — comments, internal paths, dead code and
all. It is both a massive analysis shortcut and often a reportable finding on its
own. Checks the sourceMappingURL comment, inline data: maps, and the .map
convention. Recovered files land in sources/ — those you may read normally.
No maps exposed? Fall back to webcrack (see references/deobfuscation.md) to
split one bundle into per-module files, which is what makes per-module review
possible at all.
Phase 3 — Extract the six lanes
bash scripts/jsx_lanes.sh $RUNProduces small files in lanes/. This is the step that makes the work
bite-sized: a 40 MB corpus becomes a few hundred lines per lane.
Phase 4 — Analyse, one lane at a time
Now read. One lane per unit of work. Each lane is small enough to review
completely, which is the whole point — do not try to hold the app in your head.
Delegation contracts for each lane are in references/lanes.md; use them
verbatim if spawning subagents, and only when the user has asked for subagents.
Inspect any specific hit with a bounded window, never by opening the bundle:
python3 scripts/jsx_ctx.py --from-lanes $RUN/lanes/sinks_xss.txt --max 30Phase 5 — Prove it
python3 scripts/jsx_probe.py --run $RUN --base https://target.com \
--auth headers.txt --canary https://target.com/api/meProbes each interesting path anonymously and (optionally) authenticated, diffs
the results, and writes curl_commands.sh.
The canary is mandatory with --auth and the script enforces it. A dead
session returns 401 exactly like correctly-enforced authz, and reading that as
"properly protected" has produced wrong conclusions here before.
Phase 6 — Report and hand off
Write REPORT.md using the structure in references/output.md. Then route:
- Something worth reporting →
triage-finding, thenwrite-report. - Secrets → confirm exploitability without exercising the credential against
real data (
feedback_leaked-creds-roe). Report the exposure; stop there. - Sinks with reachable input →
hunt-xss,hunt-bxss. - Unauth 200s and role-shaped params →
hunt-idor,hunt-rbac. - URL-taking params →
hunt-ssrf. Auth endpoints →hunt-ato. - Firebase/Supabase/exposed keys →
hunt-vibecoded. - Continuous monitoring of the JS layer →
jsmon.
Every half-chain gets recorded as a lead with its named missing link
(feedback_always-chain-vulns), not dropped.
Resource discipline (this VM will fall over otherwise)
- One Chromium at a time.
jsx_collect.pyalready caps V8 at 768 MB. - Never run the browser harvest and a big grep pass simultaneously.
- Run directories on real disk, not
/tmp. jsluiceruns file-at-a-time with-P 2; do not raise it.- Skip files >12 MB in lanes; handle those individually via
jsx_ctx.py. rgis a shell function on this box, not a binary — scripts here use GNU grep deliberately. Do not "fix" them to use ripgrep.
Honesty rules
- Secret candidates are candidates. Most are public keys (
pk_live_, Firebase web config, Sentry DSNs) that are supposed to ship. Classify before claiming (references/lanes.md§Secrets). - Never report a path as vulnerable because it appears in a bundle. Probe it.
- Quote what the tool actually output (
feedback_verify-claims-against-raw-output). - A read-back is not proof of causation — run a positive control
(
feedback_prove-causation-not-correlation).
References
references/collection.md— crawling, lazy loading, auth, anti-automationreferences/deobfuscation.md— source maps, webcrack, module splittingreferences/lanes.md— the six lanes in depth + subagent contractsreferences/frameworks.md— Next/Nuxt/Vite/Angular/webpack goldminesreferences/output.md— report structure and curl conventions
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

