Security Cipher
Home Blog About Us
Resources β–Ό
πŸ—ΊοΈ Penetration Testing Roadmap 🌐 Web Application Security Checklist πŸ€– OWASP Top 10 for LLM Applications 🧠 LLM AI Security Checklist πŸ› οΈ Security Tools 🎯 Penetration Testing Tricks πŸ“„ Secure Code Explain πŸ“– Vulnerability Explain ☁️ AWS Cloud Security Checklist
My Resume
Contact Us
← Security Tools View on GitHub

getJS

A tool to fastly get all javascript sources/files

JavaScript Extraction CLI & Package

This is a powerful tool for extracting JavaScript sources from URLs and web pages / 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.

Table of Contents

  • Installation
  • CLI Usage
    • Options
    • Examples
  • Package Usage
    • Importing the Extractor
    • Example
  • Version Information
  • Contributing
  • License

Installation

To install getJS, use the following command:

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

CLI Usage

Options

getJS provides several command-line options to customize its behavior:

  • -url string: The URL from which JavaScript sources should be extracted.
  • -input string: Optional URLs input files. Each URL should be on a new line in plain text format. Can be used multiple times.
  • -output string: Optional output file where results are written to. Can be used multiple times.
  • -complete: Complete/Autofill relative URLs by adding the current origin.
  • -resolve: Resolve the JavaScript files. Can only be used in combination with --complete.
  • -threads int: The number of processing threads to spawn (default: 2).
  • -verbose: Print verbose runtime information and errors.
  • -method string: The request method used to fetch remote contents (default: "GET").
  • -header string: Optional request headers to add to the requests. Can be used multiple times.
  • -timeout duration: The request timeout while fetching remote contents (default: 5s).

Examples

Extracting JavaScript from a Single URL

getJS -url https://destroy.ai

or

curl https://destroy.ai | getJS

Using Custom Request Options

getJS -url "http://example.com" -header "User-Agent: foo bar" -method POST --timeout=15s

Processing Multiple URLs from a File

getJS -input foo.txt -input bar.txt

Saving Results to an Output File

getJS -url "http://example.com" -output results.txt

Package Usage

Importing the Extractor

To use getJS as a package, you need to import the extractor package and utilize its functions directly.

Example

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())
    }
}

Version Information

This is the v2 version of getJS. The original version can be found under the tag v1.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any bugs, feature requests, or improvements.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Press Escape to close the search panel.

Donate

Buy me a Coffee

Penetration Testing Services - Fiverr

Buy me a Coffee

Penetration Testing Services

penetration Testing Services

Web Application Security Quiz

Web Application Security Quiz

Daily Bug Bounty Writeups - Twitter

Daily Bug Bounty Writeups

Download our Latest Android Application

Guide for Penetration Testing

Daily Bug Bounty Writeups - Telegram

Daily Bug Bounty Writeups

Author

Piyush
Senior Product Security Engineer

Ethical Hacker || Penetration Tester || Gamer || Blogger || Application Security Engineer

READ ARTICLE

Donate

Buy me a Coffee

Recent Posts

  • AI Pentest Tools in 2026: What Actually Works (T3MP3ST, PentestGPT, Caido and More)
    AI Pentest Tools in 2026: What Actually Works (T3MP3ST, PentestGPT, Caido and More)
    July 16, 2026/
    0 Comments
  • LLM Red Teaming in 2026: A Practical garak + PyRIT Workflow
    LLM Red Teaming in 2026: A Practical garak + PyRIT Workflow
    July 15, 2026/
    0 Comments
  • Indirect Prompt Injection in 2026: Hacking AI Through the Content It Reads
    Indirect Prompt Injection in 2026: Hacking AI Through the Content It Reads
    July 14, 2026/
    0 Comments

Follow Us

SecurityCipher

Practical security guides, vulnerability deep-dives, and hands-on resources for bug bounty hunters and penetration testers.

Useful Links

  • Blogs
  • About
  • Contact

Recent Post

  • AI Pentest Tools in 2026: What Actually Works (T3MP3ST, PentestGPT, Caido and More)
  • LLM Red Teaming in 2026: A Practical garak + PyRIT Workflow
  • Indirect Prompt Injection in 2026: Hacking AI Through the Content It Reads
Β© 2026 SecurityCipher. All rights reserved. Privacy Policies Β· Terms & Conditions