Code Monkey home page Code Monkey logo

getjs's Introduction

GetJS

License contributions welcome

getJS is a tool to extract all the javascript files from a set of given urls.

The urls can also be piped to getJS, or you can specify a singel url with the -url argument. getJS offers a range of options,

varying from completing the urls, to resolving the files.

Prerequisites

Make sure you have GO installed on your system.

Installing

getJS is written in GO. You can install it with go get:

go install github.com/003random/getJS@latest

Usage

Note: 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.txt

To get all options, do:

getJS -h
Flag Description Example
--url The url to get the javascript sources from getJS --url https://poc-server.com
--method The request method. e.g. POST or GET. Default: "GET" getJS --url https://poc-server.com --method POST
--timeout The request timeout. Default: 10 (secs) getJS --url https://poc-server.com --timeout 15
--insecure Skip SSL certificate verification. Use when the cert is expired or invalid getJS --url https://poc-server.com --insecure
--header Custom request header(s) getJS --url https://poc-server.com --header "Authorization: Bearer token"
--input Input file with urls getJS --input domains.txt
--output The file where to save the output to getJS --output output.txt
--verbose Display info of what is going on getJS --verbose
--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
--nocolors Don't color the output getJS --nocolors

Examples

screenshot

getJS supports stdin data. To pipe urls to getJS, use the following:

$ cat domains.txt | getJS

To save the js files, you can use:

$ getJS --complete --url https://poc-server.com | xargs wget

If you would like the output to be in JSON format, you can combine it with @Tomnomnom's toJSON:

$ getJS --url https://poc-server.com | tojson

To feed urls from a file use:

$ getJS --input domains.txt

To save the results to a file, and don't display anything, use:

$ getJS --url https://poc-server.com --output results.txt

If you want to have a list of full urls as output use:

$ getJS --url domains.txt -complete

If you want to only show the existing js files, use:

$ getJS --url domains.txt --complete --resolve

Built With

  • GO - GOlanguage
  • Goquery - HTML parser with syntaxes like jquery, in GO

Contributing

You are free to submit any issues and/or pull requests :)

License

This project is licensed under the MIT License.

Acknowledgments

  • @jimen0 for helping getting me started with GO

This is my first tool written in GO. I created it to learn the language more. (useful feeback is always welcome!)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.