| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This is a powerful tool for extracting JavaScript sources from URLs, web pages, and HTTP responses. It offers a command-line interface (CLI) for straightforward URL processing and a package interface for custom integrations, making it ideal for pentesters, bug bounty hunters, and developers needing to extract JS sources efficiently.
To install getJS, use the following command:
go install github.com/003random/getJS/v2@latest
Build the image from the repository root:
docker build -t getjs:local .Run getJS against a URL:
docker run --rm getjs:local -url https://example.comWhen piping a URL or HTTP response into the container, keep stdin open with --interactive:
curl https://example.com | docker run --rm --interactive getjs:localMount URL-list files read-only and refer to them by their container path:
docker run --rm --volume "${PWD}:/data:ro" getjs:local -input /data/urls.txtResults are written to stdout by default, so they can be saved on the host without granting the container write access:
docker run --rm getjs:local -url https://example.com > results.txtgetJS provides several command-line options to customize its behavior:
getJS -url https://destroy.ai
or
curl https://destroy.ai | getJS
getJS -url "http://example.com" -header "User-Agent: foo bar" -method POST --timeout=15s
getJS -input foo.txt -input bar.txt
getJS -url "http://example.com" -output results.txt
To use getJS as a package, you need to import the extractor package and utilize its functions directly.
package main
import (
"fmt"
"log"
"net/http"
"net/url"
"github.com/003random/getJS/extractor"
)
func main() {
baseURL, err := url.Parse("https://google.com")
if (err != nil) {
log.Fatalf("Error parsing base URL: %v", err)
}
resp, err := extractor.FetchResponse(baseURL.String(), "GET", http.Header{})
if (err != nil) {
log.Fatalf("Error fetching response: %v", err)
}
defer resp.Body.Close()
// Custom extraction points (optional).
extractionPoints := map[string][]string{
"script": {"src", "data-src"},
"a": {"href"},
}
sources, err := extractor.ExtractSources(resp.Body, extractionPoints)
if (err != nil) {
log.Fatalf("Error extracting sources: %v", err)
}
// Filtering and extending extracted sources.
filtered, err := extractor.Filter(sources, extractor.WithComplete(baseURL), extractor.WithResolve())
if (err != nil) {
log.Fatalf("Error filtering sources: %v", err)
}
for source := range filtered {
fmt.Println(source.String())
}
}This is the v2 version of getJS. The original version can be found under the tag v1.
Contributions are welcome! Please open an issue or submit a pull request for any bugs, feature requests, or improvements.
This project is licensed under the MIT License. See the LICENSE file for details.
| Back | FazBrowse Home | New Git URL |