GhostJS
GhostJS is an open-source Burp Suite extension by TrinetLayer that passively scans JavaScript, HTML, and JSON responses flowing through Burp for hardcoded secrets (AWS/GCP/Azure keys, Stripe/PayPal/GitHub tokens, JWTs, private keys, etc.) and hidden API endpoints, surfacing findings in a dedicated tab with severity, confidence scoring, remediation guidance, and Markdown export. It also actively fetches referenced <script> bundles using the tester's live session cookies and applies a false-positive filter to suppress doc-sample and placeholder keys, making it a practical recon aid during authorized web app pentests and bug bounty work.
What it is
GhostJS is a Java Burp Suite extension (Montoya API) from TrinetLayer that passively finds hardcoded secrets and hidden endpoints in JS/HTML/JSON. The summary covers detection breadth; what it can't carry is how you install/verify it, how it routes traffic internally, and how the author says findings must be interpreted.
How it works
Every HTTP response is inspected passively. The path branches on body type and size, and HTML responses trigger an active fetch of referenced scripts (replaying your live session cookies):
flowchart TD
R[HTTP response] --> T{JS/HTML/JSON?}
T -->|small body| I[scan inline → highlight proxy row]
T -->|large body| B[background scan pool — browsing never blocks]
T -->|HTML| S["extract <script src>/*.js"] --> AF[active-fetch + scan with cookies]
I --> F[GhostJS tab + Proxy highlight]
B --> F
AF --> FEach scan is exception-isolated and time-bounded, so one pathological file can't hang or crash Burp. The findings table never prints a full secret (masked, e.g. sk_l…MNOP); the detail pane shows full value, surrounding code, impact, and numbered remediation. Proxy history is coloured by worst severity: red=critical/high, orange=medium, yellow=low, gray=info.
Preconditions
- Burp Suite Community or Professional (works on the free edition).
- JDK 17+ only if building from source (Temurin works); the prebuilt jar needs no JDK.
- Authorized targets only — your own apps or in-scope pentest/bug-bounty engagements.
What to do
Prebuilt: grab ghostjs.jar from Releases, then Burp → Extensions ▸ Installed ▸ Add → Java → select the jar.
Build from source:
git clone https://github.com/trinetlayer/Ghost-Js-Burp-Extension.git
cd Ghost-Js-Burp-Extension
./build.sh # downloads Montoya API, compiles, packages dist/ghostjs.jargradle jar also works. Regenerate detection patterns from export-patterns.mjs → GeneratedPatterns.java. Deep-dive in docs/TECHNICAL.md.
Verify against the bundled test target (fake, format-valid secrets):
./test-site/serve.sh # serves http://localhost:8000Load the jar, open Burp's browser, visit http://localhost:8000/ → ~18 findings across every severity, with js/placeholders.js samples correctly ignored (proving the false-positive filter).
Caveats
- Findings are hints, not confirmations — always verify a secret is live and in scope before reporting. Live validation lives in the web app /
validator.trinetlayer.com, not the extension. - Discovery rows (endpoints, S3 URLs, source-maps) are references extracted from JS, not probed — a 404 on a plain GET does not make them false positives.
- Secrets inside code comments are reported by design, not filtered.
- Domain-wide crawling, continuous monitoring, and PDF/JSON reports require the separate
app.trinetlayer.complatform.
Organisations named here
- TrinetLayer
Technologies named here
- GhostJS
- Burp Suite
- Montoya API
- app.trinetlayer.com
- validator
- build.sh
- gradle jar
- export-patterns.mjs
- JavaScript
- Java
Techniques named here
- Passive JavaScript/HTML/JSON secret scanning
- Active fetch of referenced JS bundles
- Hidden API endpoint / attack surface discovery
- Domain-wide deep scan
- Secret validation / liveness checking
- False-positive suppression
- Secrets-in-comments detection
Related in AppSec
Flowise MCP Security Bypass Enables RCE
Inside an Oracle Database SQL Injection Attack | Huntress
OASIS
