Discovery
List the JavaScript files a page loads
Extract JavaScript file URLs from a page or URL list.
overview
What getJS does
getJS takes --url or an --input file and lists every JavaScript source the page references. It returns file URLs, not the endpoints or secrets inside the bundles.
Turn on --complete to rewrite relative paths into absolute URLs. Pair it with --resolve to drop references that no longer load. Pass --header for authenticated hosts and --insecure for bad certificates.
Trickest provides getJS as a managed Discovery node after a crawler. Feed its FILE and FOLDER output to linkfinder, golinkfinder, or jsluice when you need routes and secrets from the bundles.
source github.com/003random/getJS
use cases
Where getJS fits
Harvest the JavaScript surface of a target
Point getJS at a URL or host list to list every referenced script file, the starting point for any source-level analysis of a web app.
Build absolute, fetchable JS URLs
Turn on complete to rewrite relative script paths into full URLs, so the next stage can download each bundle without resolving paths by hand.
Filter to JavaScript that loads
Combine complete with resolve to drop dead references and keep only live JS files, cutting noise before you spend time parsing them.
Feed an endpoint and secret extractor
Pass the JS file list to a parser such as linkfinder or jsluice to recover API routes, parameters, and hardcoded secrets from the bundles.
reference
getJS inputs and flags
| Name | Type | Flag | Description |
|---|---|---|---|
| url | STRING | --url | Target URL to extract JavaScript sources from. |
| input-url-file | FILE | --input | Input file of URLs to process, the usual pipeline input. |
| complete-urls | BOOLEAN | --complete | Rewrite relative script paths into absolute URLs. |
| filter-non-existing-files | BOOLEAN | --resolve | Drop references that no longer resolve (requires --complete). |
| custom-request-header | STRING | --header | Custom request header(s), e.g. an Authorization bearer token. |
| request-timeout | STRING | --timeout | Request timeout in seconds (default 10). |
| skip-ssl-verification | BOOLEAN | --insecure | Skip SSL certificate verification for invalid or expired certs. |
| no-color | BOOLEAN | --nocolors | Disable colored output. |
Showing key inputs. getJS exposes 8 inputs in total.
example
Run getJS
# extract JavaScript files from a list of URLs as absolute, live linksgetJS --input urls.txt --complete --resolve --timeout 15https://example.com/static/js/runtime.4f2a91.jshttps://example.com/static/js/vendor.8c1de0.jshttps://example.com/static/js/main.b7043a.jshttps://example.com/assets/analytics.jshttps://cdn.example.com/libs/chart.min.jshttps://cdn.example.com/libs/datepicker.jshttps://app.example.com/_next/static/chunks/framework.jshttps://app.example.com/_next/static/chunks/pages/_app.jsguidance
Choosing getJS
Use getJS when you need the list of JavaScript files a target loads, not the endpoints inside them. It finds and resolves script URLs; a parser such as linkfinder or jsluice then mines those files for routes and secrets.
golinkfinder
Extracts endpoints from HTML and JS. getJS lists the JS files; golinkfinder reads what is inside them.
linkfinder
Python parser for endpoints in JavaScript. Natural next stage after getJS resolves the file list.
jsluice
Pulls URLs, paths, and secrets from JavaScript. Run it on the bundles getJS collects.
faq
getJS questions
related
More Discovery tools
apkurlgrep
Extract URLs and endpoints from Android APK files.
cariddi
Crawl a domain list and scan responses for endpoints, secrets, tokens, and juicy files.
crawlergo
Browser-driven crawler that harvests requests for downstream scanners.
dirsearch
Web path scanner.
fallparams
Crawl pages, harvest potential parameters, write a custom wordlist.
feroxbuster
Recursive content discovery with smart defaults and rich response filters.
Run getJS yourself
A URL list feeds getJS, which extracts the JavaScript files each target loads and passes them to linkfinder, which mines the bundles for endpoints saved as a queryable output.
Facts on this page come from the live Trickest tool library.