clientscan is an open source Go CLI that scans web application JavaScript assets and extracts client-side intelligence.
- Discovers JavaScript URLs from HTML
<script src="...">tags. - Downloads JS files into
out/{domain}/response/*.js. - Extracts:
- endpoints
- URL categories:
third_party_urls,api_urls,internal_urls ip_disclosures(public/non-localhost IP-based URLs)- environment variable names
- potential exposed secrets
- sourcemap URLs
- npm package references
- GraphQL endpoints
- Fetches sourcemaps and rebuilds source files into
out/{domain}/rebuilt/whensourcesContentexists. - Runs an in-house JS-focused regex detector powered by rules from
db/secrets.yamlanddb/pii.yaml. - Generates default visual graph reports (PNG):
- critical exposure graph (
internal host + (secret or sourcemap)and IP disclosures) - third-party + npm trust graph
- client exposure graph
- critical exposure graph (
- Writes scan artifacts:
out/{domain}/jsinventory.jsonout/{domain}/metadata.jsonout/{domain}/reports/report.graph.jsonout/{domain}/reports/report-graph-critical.pngout/{domain}/reports/report-graph-thirdparty.pngout/{domain}/reports/report-graph-client-exposure.png
- Provides a live scan progress view that auto-clears on completion, followed by a styled final summary table.
cd clientscan
./setup.sh
./bin/clientscan --help
go run ./cmd/clientscan -url https://example.comclientscan --help
clientscan -url https://example.com [flags]
clientscan scan -url https://example.com [flags]
clientscan versionScan flags:
-urltarget webapp URL (required)-outoutput root directory (default:out)-timeoutHTTP timeout seconds (default:20)-verboseenable debug logs-quietprint only errors (default:true)-mask-secretsmask detected secret/PII values in JSON output (default:false)
out/
example.com/
response/
001_abcd1234ef56.js
...
rebuilt/
src/... (reconstructed from sourcemaps)
reports/
report.graph.json
report-graph-critical.png
report-graph-thirdparty.png
report-graph-client-exposure.png
jsinventory.json
metadata.json
- Required paths:
db/secrets.yamldb/pii.yaml
- Rule files must be raw YAML. If HTML content is detected, loading is rejected to prevent silent false scans.
dotfrom Graphviz is required for PNG graph rendering../setup.shinstalls and validates this by default.
cmd/clientscan/ # CLI entrypoint and flag parsing
internal/app/ # application orchestration and summary presentation
internal/logging/ # structured logging setup
internal/model/ # core types and config models
internal/output/ # artifact writers
internal/scan/ # discovery, download, analysis, sourcemap rebuild
internal/ui/ # Bubble Tea progress UI
internal/util/ # shared helpers