
Scan JavaScript bundles for environment variables, API endpoints, and classified hostnames
_ _ _
| |___ _ ___ ___ (_)___ _ _| |__
| / / ' \/ -_) -_)| / -_) '_| / /
|_\_\_||_\___\___|/ \___|_| |_\_\
|__/
Fast Env Var, API Endpoint & Hostname Extraction from JavaScript Bundles for Pentesters & Red Teamers
Kneejerk is a pentesting command line tool that scans a website's JavaScript bundles, and the source maps they reference, for hostnames, environment variables and API endpoints. Hostnames are classified against the target domain, flagging its own subdomains (internal APIs, staging, admin) and cloud storage buckets. Use -cookie to scan sites that sit behind a browser session or a Cloudflare challenge.
.js/.mjs under /static/, /_next/static/, /assets/, /_app/immutable/ or /_astro/), which covers React (CRA), Next.js, Vite/Remix, SvelteKit and Astro builds.NODE_, REACT_APP_, NEXT_PUBLIC_, VITE_, EXPO_PUBLIC_ and AWS_ prefixes) and rates them by severity.fetch, jQuery ajax, XMLHttpRequest and "METHOD", "/path" style calls).sourceMappingURL comments and scans the source map's embedded sources too.-cookie header only to the scanned origin, so scans can run behind a browser session or Cloudflare challenge without leaking it to third-party hosts.brew install mattmillerai/tap/kneejerk
Linux and macOS archives (amd64 and arm64) are published on the latest GitHub release, along with checksums.txt. There is no Windows build.
# Download the archive for your OS/arch and checksums.txt from the releases page,
# then (Linux amd64 shown; also darwin_amd64, darwin_arm64, linux_arm64):
tar xzf kneejerk_*_linux_amd64.tar.gz
sha256sum -c checksums.txt --ignore-missing # macOS: shasum -a 256 -c checksums.txt --ignore-missing
sudo install -m 755 kneejerk /usr/local/bin/
kneejerk -version
Release archives are stamped with the version. Builds from Homebrew or go install currently report dev for kneejerk -version.
go install -v github.com/mattmillerai/kneejerk/cmd/kneejerk@latest
Versions <= v0.3.1 were published under the module path
github.com/MillerMedia/kneejerk.go install .../kneejerk@latestwill reject that old path with a module path mismatch error — switch togithub.com/mattmillerai/kneejerkas shown above.
kneejerk -u https://www.example.com -o output.txt
kneejerk -l urls.txt
urls.txt holds one bare URL per line.
# Bare URLs, one per line (for example, from httpx)
httpx -silent -l urls.txt | kneejerk
# or
kneejerk < urls.txt
# Send a cookie (e.g. cf_clearance from a browser session) to the scanned site
kneejerk -u https://www.example.com -cookie 'cf_clearance=...'
# Skip TLS certificate verification (insecure); proxy settings from the environment are still honored
kneejerk -u https://internal.example.com -k
The cookie is only sent to the same origin (scheme, host and port) as the URL being scanned, never to third-party scripts or source maps, and is dropped on cross-origin redirects.
kneejerk -version
# Nuclei-style lines, where the URL is the fourth space-separated field
nuclei -u https://www.example.com | kneejerk
subfinder -d example.com | httpx | nuclei | kneejerk
The lines below are uncolored findings written by -o from a local demo page whose JavaScript bundle (and its source map) contained these values, scanned with -domain example.com. Console output is colorized; the line format is the same against a live site.
[kneejerk] [env-var] [info] http://127.0.0.1:8765/static/js/main.js [NODE_ENV: "production"]
[kneejerk] [env-var] [low] http://127.0.0.1:8765/static/js/main.js [REACT_APP_API_HOST: "https://api.example.com"]
[kneejerk] [env-var] [high] http://127.0.0.1:8765/static/js/main.js [REACT_APP_SECRET: "s3cr3t"]
[kneejerk] [env-var] [info] http://127.0.0.1:8765/static/js/main.js [NEXT_PUBLIC_REGION: "us-east-2"]
[kneejerk] [env-var] [info] http://127.0.0.1:8765/static/js/main.js [VITE_BUCKET: "client-bucket"]
[kneejerk] [api] [info] http://127.0.0.1:8765/static/js/main.js ["GET", "/api/v1/users"]
[kneejerk] [api] [info] http://127.0.0.1:8765/static/js/main.js ["POST", "/api/v1/login"]
[kneejerk] [domain] [high] http://127.0.0.1:8765/static/js/main.js [api.example.com]
[kneejerk] [domain] [high] http://127.0.0.1:8765/static/js/main.js [staging-api.example.com]
[kneejerk] [bucket] [medium] http://127.0.0.1:8765/static/js/main.js [example-uploads.s3.amazonaws.com]
[kneejerk] [domain] [info] http://127.0.0.1:8765/static/js/main.js [js.stripe.com]
[kneejerk] [api] [info] http://127.0.0.1:8765/static/js/main.js.map ["DELETE", "/api/v1/admin/users"]
[kneejerk] [domain] [high] http://127.0.0.1:8765/static/js/main.js.map [admin.example.com]
Reading from stdin expects nuclei-style output lines, where the URL is the fourth space-separated field ([template] [type] [severity] URL). Each input line is echoed before its findings. Bare URLs also work on stdin (e.g. httpx -silent | kneejerk or kneejerk < urls.txt): a non-blank line with fewer than four fields is scanned as a plain URL, while nuclei-style lines remain supported. Blank lines are skipped. -l is for bare URLs only, one per line, and does not parse nuclei output.