Skip to main content

A tool to discover S3 buckets from subdomains by analyzing JavaScript files.

Project description

JSBucket: S3 Bucket Discovery Tool From JavaScript Files

JSBucket is a Python-based tool designed to analyze subdomains for Amazon S3 bucket references in JavaScript files. It extracts S3 bucket names and URLs from subdomains and outputs them in a structured JSON format. The tool supports multi-threading, progress tracking, and silent mode for seamless integration with other tools like jq, s3scanner, etc. This tool is specifically designed for Bug Bounty Hunters and Pentesters.


Features ⚙️

usage: jsbucket [-h] [-u SUBDOMAIN] -d DOMAIN [-l LIST] [-t THREADS] [-timeout TIMEOUT] [-o OUTPUT] [-silent]

Analyze JavaScript files from given subdomain(s) for S3 buckets.

options:
  -h, --help            Show this help message and exit
  -u SUBDOMAIN, --subdomain SUBDOMAIN
                        Analyze a single subdomain (e.g., `sub.example.com`)
  -d DOMAIN, --domain DOMAIN
                        Base/root domain (mandatory)
  -l LIST, --list LIST  File containing a list of subdomains (one per line)
  -t THREADS, --threads THREADS
                        Number of threads for concurrent analysis (default: 10)
  -timeout TIMEOUT      Timeout for HTTP requests (default: 10 seconds)
  -o OUTPUT, --output OUTPUT
                        Save results to a JSON file (e.g., `output.json`)
  -silent               Suppress all output except raw JSON (useful for piping into tools like `jq` or `grep`)

Installation 🚀

Prerequisites

  1. Python 3.6+: Ensure Python is installed on your system.
  2. Dependencies: Install the required libraries using pip.

Steps

git clone https://github.com/saeed0xf/jsbucket.git
cd jsbucket
pip install -r requirements.txt

Alternatively, you can install the tool directly from PyPI:

pip install jsbucket

Usage 📝

Run the script with the desired flags:

jsbucket [FLAGS]

Flags

Flag Description
-u SUBDOMAIN Analyze a single subdomain (e.g., sub.example.com).
-d DOMAIN Base/root domain (mandatory).
-l FILE File containing a list of subdomains (one per line).
-t THREADS Number of threads for concurrent analysis (default: 10).
-timeout SECS Timeout for HTTP requests (default: 10 seconds).
-o OUTPUT Save results to a JSON file (e.g., output.json).
-silent Suppress all output except raw JSON (useful for piping into tools like jq or grep).

Examples 🕵️‍♀️

1. Analyze a Single Subdomain

jsbucket -u sub.example.com -d example.com

2. Analyze a List of Subdomains

jsbucket -l subdomains.txt -d example.com

3. Save Results to a JSON File

jsbucket -l subdomains.txt -d example.com -o results.json

4. Use Silent Mode for Piping

jsbucket -l subdomains.txt -d example.com -silent | jq '.[].s3_buckets[].bucket_name'

5. Customize Threads and Timeout

jsbucket -l subdomains.txt -d example.com -t 20 -timeout 30

Output Format

Terminal Output (Non-Silent Mode)

Alert: S3 Bucket(s) found on subdomain https://sub.example.com!
{
  subdomain: https://sub.example.com,
  s3_buckets: [
    {
      bucket_name: my-bucket,
      bucket_url: https://my-bucket.s3.amazonaws.com
    }
  ]
}

✅ Analysis complete!

JSON Output (Silent Mode)

[
  {
    "subdomain": "https://sub.example.com",
    "s3_buckets": [
      {
        "bucket_name": "my-bucket",
        "bucket_url": "https://my-bucket.s3.amazonaws.com"
      }
    ]
  }
]

Notes 📌

  1. Silent Mode: Use the -silent flag when integrating with tools like jq or s3scanner. This ensures only raw JSON is printed to stdout.
  2. Timeout: Adjust the -timeout value if subdomains take longer to respond.
  3. Threads: Increase the -t value for faster analysis, but be cautious with high thread counts to avoid overwhelming the network or server.

Contributing 🤝

Contributions are welcome! If you find any issues or have suggestions for improvements, feel free to:

  • Open an issue.
  • Submit a pull request.

License 📜

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


Contact 💻

For questions, suggestions, or feedback, feel free to reach out:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jsbucket-1.0.1.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jsbucket-1.0.1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file jsbucket-1.0.1.tar.gz.

File metadata

  • Download URL: jsbucket-1.0.1.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for jsbucket-1.0.1.tar.gz
Algorithm Hash digest
SHA256 2f37c15e4e0f6b79605eb971ca5c0a66c217e423ee84adc8d31e963a640d4cfb
MD5 a728824a7147eb7b8748c59cf0398111
BLAKE2b-256 60d0c62d0ab2f66962ac45fcfb36c504118b8dd4a2dc93fc83ad2e33da664596

See more details on using hashes here.

File details

Details for the file jsbucket-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: jsbucket-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for jsbucket-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 18941b8d2402a9d7d4af1ff9df8397092aa7d26b3a460b6b1e5b0f9ec84f008d
MD5 ed53825df597908f3e3a5590a501b828
BLAKE2b-256 9be20ec33d34d179279950ee55331e4d08746e831088d06f7c7c045006e5dc1c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page