getJS is a tool to extract all the javascript files from a set of given urls.
The urls can be piped to getJS, or you can specify a single url with the -url argument. getJS offers a range of options, varying from completing the urls, to resolving the urls to make sure they exist.
Make sure you have GO installed on your system.
getJS is written in GO. You can install it with go get:
go get github.com/003random/getJSNote: When you supply urls from different sources, e.g. with stdin and an input file, it will add all the urls together :)
Example:
echo "https://github.com" | getJS -url=https://example.com -input=domains.txtTo get all options, do:
getJS -h| Flag | Description | Example |
|---|---|---|
| -url | The url to get the javascript sources from | getJS -url=https://poc-server.com |
| -input | Input file with urls | getJS -input=domains.txt |
| -output | The file where to save the output to | getJS -output=output.txt |
| -plain | Only output the results | getJS -plain |
| -silent | Output nothing | getJS -silent |
| -complete | Complete the urls. e.g. /js/index.js -> https://example.com/js/index.js | getJS -complete |
| -resolve | Resolve the output and filter out the non existing files (Can only be used in combination with -complete) | getJS -complete -resolve |
getJS supports stdin data. To pipe urls to getJS, use the following (-plain is optional).
$ cat domains.txt | getJS -plainTo save the js files, you can use:
$ getJS -url=https://poc-server.com -plain | xargs wgetIf you would like the output to be in JSON format, you can combine it with @Tomnomnom's toJSON:
$ getJS -url=https://poc-server.com -plain | tojsonTo feed urls from a file, use:
$ getJS -input=domains.txtTo save the results to a file, use:
$ getJS -url=https://poc-server.com -output=results.txtIf you want to have a list of full urls as output use:
$ getJS -url=domains.txt -completeIf you want to only show the js files that resolve, use:
$ getJS -url=domains.txt -complete -resolveYou are free to submit any issues and/or pull requests :)
This project is licensed under the MIT License.
- @jimen0 for helping getting me started with GO
- Add a regex option to extract the sources faster then parsing the HTML
This is my first tool written in GO. I created it to learn the language more. Please don't hate on my coding style xD (useful feeback is always welcome!)