# Bugbounty JS API Recon

> Use when reconnaissance has collected JavaScript files and you need to extract API endpoints, parameters, and hidden functionality from them instead of guessing routes. Covers fetching in-scope JavaScript safely, extracting URLs and API paths with grep and LinkFinder-style patterns, mapping endpoints to HTTP methods and parameters, finding versioned and deprecated APIs, detecting secrets and debug routes, and feeding confirmed endpoints into Burp Suite testing with OWASP and CVSS scoring. Authorized targets only, only test assets the program explicitly lists in scope.

- Skill: `mizazhaider-ceh/bugbounty-js-api-recon` (Agent Skill)
- Install (CLI): `npx get-skill add mizazhaider-ceh/bugbounty-js-api-recon`
- Raw SKILL.md: https://api.skillmd.com/api/skills/mizazhaider-ceh/bugbounty-js-api-recon/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security
- Author: mizazhaider-ceh (https://skillmd.com/u/mizazhaider-ceh)
- Updated: 2026-11-22
- Page: https://skillmd.com/skills/mizazhaider-ceh/bugbounty-js-api-recon

---


JavaScript files are a map of the application that the developers published, usually by accident. Bundled scripts list API routes, parameter names, admin paths, and old endpoints that no link on the site points to anymore. This sub-skill turns a pile of JavaScript files, collected by the parent skill bugbounty-recon-automation, into a tested API inventory. It covers extraction, mapping, and handoff to manual testing, and it stops before exploitation. Only test assets the program explicitly lists in scope, and only use your own test account for authenticated endpoints.

## Quick Workflow

1. Take the JavaScript file list from the parent pipeline, and confirm every file host is in scope.
2. Download the files into a dated folder, keeping the source URL with each file.
3. Extract string literals, URLs, and API paths, and deduplicate them into an endpoint list.
4. Separate endpoints by version, by method hints, and by authentication hints found in the code.
5. Probe each endpoint politely with httpx to confirm it exists, and record status and response type.
6. Map parameters per endpoint from the code, including IDs, filters, and pagination fields.
7. Flag secrets, debug routes, and deprecated endpoints for careful, minimal handling.
8. Hand the confirmed endpoint inventory to Burp Suite for manual testing, with OWASP mapping per endpoint group.

## 1. Fetching JavaScript files with provenance

Keep the source URL with every file. Without provenance you cannot tell whether an endpoint came from the target app, a third-party library, or a CDN bundle that is out of scope.

```bash
mkdir -p js-2026-10-27
cd js-2026-10-27
# js-files.txt comes from the parent pipeline, in-scope hosts only
i=0
while read -r url; do
  i=$((i + 1))
  curl -s -o "file-$i.js" "$url"
  echo "$url -> file-$i.js" >> provenance.txt
done < ../recon-2026-10-27/urls/js-files.txt
wc -l provenance.txt
ls -lh | head -n 20
```

If a JavaScript file fails to download, log it and move on. A missing bundle is a note, not a reason to hammer the host with retries.

## 2. Extracting endpoints and API paths

Start with simple pattern extraction, then refine. The goal is a clean endpoint list, not a dump of every string in the bundle.

```bash
# Extract quoted paths, API routes, and full URLs from all downloaded files
grep -rhoE '"/[a-zA-Z0-9/_.\-]+"' *.js | tr -d '"' | sort -u > endpoints-raw.txt
grep -rhoE '/api/v[0-9]+/[a-zA-Z0-9/_.\-]+' *.js | sort -u > api-paths.txt
grep -rhoE 'https?://[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}/[a-zA-Z0-9/_.\-?=&%]+' *.js \
  | grep -E 'example\.com' | sort -u > full-urls.txt
# Merge, keep only in-scope hosts, and count by API version
cat endpoints-raw.txt api-paths.txt > endpoints-all.txt
grep -E '^/api/v[0-9]+/' endpoints-all.txt | sed -E 's|^(/api/v[0-9]+)/.*|\1|' \
  | sort | uniq -c | sort -nr > api-versions.txt
wc -l endpoints-raw.txt api-paths.txt full-urls.txt
cat api-versions.txt
```

Example output shape:

```text
412 endpoints-raw.txt
138 api-paths.txt
57 full-urls.txt
  96 /api/v2
  42 /api/v1
```

Two API versions in one bundle is a finding in itself. The older version often has weaker checks, and it is often the version nobody on the program team still tests.

## 3. Mapping methods, parameters, and authentication hints

Endpoints alone are not enough. Pull the surrounding code context to learn which method each route expects, which parameters it takes, and whether it sends an authorization header.

```python
# map_endpoints.py - map endpoints to nearby method and parameter hints
import re
from pathlib import Path

method_re = re.compile(r"(GET|POST|PUT|PATCH|DELETE)")
param_re = re.compile(r"[?&]([a-zA-Z_][a-zA-Z0-9_]*)=|params:\s*\{([^}]*)\}")
endpoint_re = re.compile(r"/api/v[0-9]+/[a-zA-Z0-9/_.\-]+")

for js_file in sorted(Path(".").glob("file-*.js")):
    text = js_file.read_text(errors="ignore")
    for endpoint in sorted(set(endpoint_re.findall(text))):
        idx = text.find(endpoint)
        window = text[max(0, idx - 200):idx + 200]
        methods = sorted(set(method_re.findall(window)))
        params = sorted(set(param_re.findall(window)))
        print(f"{endpoint} | methods={methods} | params={params}")
```

Example output shape:

```text
/api/v2/orders | methods=['GET', 'POST'] | params=['page', 'limit']
/api/v2/orders/{id} | methods=['GET', 'PUT', 'DELETE'] | params=[]
/api/v1/users/{id} | methods=['GET'] | params=[]
```

Treat the method and parameter hints as leads, not facts. Confirm each one with a real request in Burp Suite before writing it into a report, because minified code context can mislead.

## 4. Probing endpoints politely and recording results

Probe the merged endpoint list against the live in-scope host, one base URL at a time, and record status codes. A 404 is a closed door, a 401 or 403 is a door with a lock worth noting, and a 200 on an undocumented endpoint is a priority for manual testing.

```bash
# Build full URLs from the endpoint list and one known in-scope base
BASE="https://app.example.com"
while read -r path; do echo "${BASE}${path}"; done < api-paths.txt | sort -u > probe-urls.txt
httpx -l probe-urls.txt -silent -status-code -title -o probe-results.txt
# Split results by status for the testing queue
awk '$2 ~ /200/' probe-results.txt > probe-200.txt
awk '$2 ~ /401|403/' probe-results.txt > probe-auth.txt
awk '$2 ~ /404/' probe-results.txt > probe-404.txt
wc -l probe-urls.txt probe-results.txt probe-200.txt probe-auth.txt probe-404.txt
head -n 20 probe-200.txt
```

Never probe an endpoint with another user ID, token, or session. Probe with your own test account only, and treat any data returned about other users as a finding to report, not as data to explore further.

## 5. Flagging secrets, debug routes, and deprecated endpoints

JavaScript sometimes contains things that should never have shipped. Handle these flags with care, and never use a found secret beyond proving it exists.

```bash
# Flag patterns for careful manual review, not for automated exploitation
grep -rhoE '(api[_-]?key|secret|token|password)[^,;}" ]{0,40}' *.js \
  | sort -u > flags-secrets.txt
grep -rhoE '/(debug|test|staging|internal|admin)/[a-zA-Z0-9/_.\-]+' *.js \
  | sort -u > flags-debug-routes.txt
grep -rhoE '/api/v1/[a-zA-Z0-9/_.\-]+' *.js | sort -u > flags-v1-deprecated.txt
wc -l flags-secrets.txt flags-debug-routes.txt flags-v1-deprecated.txt
cat flags-debug-routes.txt
```

If a secret looks real, stop, do not test it against production systems, and report it through the program channel with the file and line context redacted to the minimum needed. If a debug route exists, test it only within scope and only with your own account.

## 6. Handoff to Burp Suite manual testing

The endpoint inventory becomes a Burp Suite testing queue. Import the live endpoints, group them by feature, and assign an OWASP class hypothesis to each group before testing starts.

```bash
cat > burp-handoff.md <<'EOF'
BURP SUITE HANDOFF, JS API INVENTORY
  SOURCE: js-2026-10-27, provenance.txt attached
  LIVE 200 ENDPOINTS: probe-200.txt
  AUTH-GATED ENDPOINTS: probe-auth.txt, test with own account only
  DEPRECATED V1 ENDPOINTS: flags-v1-deprecated.txt, priority queue
  DEBUG ROUTES: flags-debug-routes.txt, scope-check before testing
  GROUPING:
    - Orders API, test Broken Access Control and IDOR first
    - Users API, test Broken Access Control and data exposure first
    - Search and filter API, test Injection and parameter handling first
    - Upload API, test file handling and access control first
  SCORING: Every confirmed finding gets an OWASP class and a CVSS
  vector before it leaves the testing queue.
EOF
cat burp-handoff.md
```

## Edge cases

- Minified and bundled code. One bundle can mix first-party code with third-party libraries. Filter library paths out before counting endpoints, or the inventory will be full of library routes that are not the target app.
- Source maps present. A source map can reveal original file names and code structure. Use it only within scope, and treat original source paths as leads, not as proof of a vulnerability.
- JavaScript loaded from a CDN or third-party host. An endpoint in a third-party script is not automatically in scope. Check the host against the program scope before probing it.
- Authenticated JavaScript behind a login wall. Fetch it only with your own test account session, never with a session belonging to another user.
- Endpoints that return 200 for everything. Some APIs return 200 with an error body. Check response bodies, not just status codes, before marking an endpoint live.
- Parameter names that look like IDs but are not. Confirm whether a parameter is an object reference, a filter, or a display field before testing it for access control issues.
- Large bundles over several megabytes. Split extraction by file and deduplicate at the end, instead of loading everything into one pass that hides which file an endpoint came from.
- Secrets that turn out to be test keys or placeholders. Verify the key format and, only through the program channel, whether it is live. Never use a live-looking key to access real data.

## Key references

- OWASP API Security Top 10, for mapping API endpoint groups to the right testing priorities.
- OWASP Top 10, for the broader vulnerability classes behind each API finding.
- CVSS specification, for scoring confirmed API findings consistently.
- Burp Suite documentation, for importing endpoint lists and testing them manually.
- bugbounty-recon-automation, the parent skill, for the pipeline that collects the JavaScript files this sub-skill analyzes.
- bugbounty-scope-recon, for confirming every JavaScript host and endpoint is in scope before probing.
- bugbounty-methodology, for the testing phases that follow the endpoint handoff.
- bugbounty-duplicate-avoidance, for checking API findings against known duplicates before reporting.

