S3Scanner
Scan for misconfigured S3 buckets across S3-compatible APIs!
Install / Use
/learn @sa7mon/S3ScannerREADME
- AWS
- DigitalOcean
- DreamHost
- GCP
- Linode
- Scaleway
- Custom
Features
- ⚡️ Multi-threaded scanning
- 🔭 Supports many built-in S3 storage providers or custom
- 🕵️♀️ Scans all bucket permissions to find misconfigurations
- 💾 Save results to Postgres database
- 🐇 Connect to RabbitMQ for automated scanning at scale
- 🐳 Docker support
Used By
<p align="center"> <a href="https://github.com/six2dez/reconftw"><img src="https://github.com/six2dez/reconftw/blob/main/images/banner.png" alt="banner for six2dez/reconftw" width="50%"></a> <a href="https://github.com/yogeshojha/rengine"><img src="https://github.com/yogeshojha/rengine/blob/master/.github/screenshots/banner.gif" alt="banner for yogeshojha/rengine" width="50%"/></a> <a href="https://github.com/pry0cc/axiom"><img src="https://raw.githubusercontent.com/pry0cc/axiom/master/screenshots/axiom_banner.png" alt="banner for pry0cc/axiom - reads 'the dynamic infrastructure framework for everybody'" width="50%" /></a> </p>Usage
INPUT: (1 required)
-bucket string Name of bucket to check.
-bucket-file string File of bucket names to check.
-mq Connect to RabbitMQ to get buckets. Requires config file key "mq". Default: "false"
OUTPUT:
-db Save results to a Postgres database. Requires config file key "db.uri". Default: "false"
-json Print logs to stdout in JSON format instead of human-readable. Default: "false"
OPTIONS:
-enumerate Enumerate bucket objects (can be time-consuming). Default: "false"
-provider string Object storage provider: aws, custom, digitalocean, dreamhost, gcp, linode, scaleway - custom requires config file. Default: "aws"
-threads int Number of threads to scan with. Default: "4"
DEBUG:
-verbose Enable verbose logging. Default: "false"
-version Print version Default: "false"
If config file is required these locations will be searched for config.yml: "." "/etc/s3scanner/" "$HOME/.s3scanner/"
🚀 Support
If you've found this tool useful, please consider donating to support its development. You can find sponsor options on the side of this repo page or in FUNDING.yml
<div align="center"><a href="https://www.tines.com/?utm_source=oss&utm_medium=sponsorship&utm_campaign=s3scanner"><img src="https://user-images.githubusercontent.com/3712226/146481766-a331b010-29c4-4537-ac30-9a4b4aad06b3.png" height=50 width=140></a></div> <p align="center">Huge thank you to <a href="https://www.tines.com/?utm_source=oss&utm_medium=sponsorship&utm_campaign=s3scanner">tines</a> for being an ongoing sponsor of this project.</p>Quick Start
Scan AWS for bucket names listed in a file, enumerate all objects
$ s3scanner -bucket-file names.txt -enumerate
Scan a bucket in GCP, enumerate all objects, and save results to database
$ s3scanner -provider gcp -db -bucket my-bucket -enumerate
Installation
| Platform | Version | Steps |
|---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------|
| BlackArch | |
pacman -S s3scanner |
| Docker | |
docker run ghcr.io/sa7mon/s3scanner |
| Go | |
go install -v github.com/sa7mon/s3scanner@latest |
| Kali Linux | |
apt install s3scanner |
| MacOS | |
brew install s3scanner |
| Parrot OS | |
apt install s3scanner |
| Windows - winget | | winget install s3scanner |
| NixOS stable | |
nix-shell -p s3scanner |
| NixOS unstable | |
nix-shell -p s3scanner |
| Other - Build from source | |
git clone git@github.com:sa7mon/S3Scanner.git && cd S3Scanner && go build -o s3scanner . |
Using
Input
s3scanner requires exactly one type of input: -bucket, -bucket-file, or -mq.
INPUT: (1 required)
-bucket string Name of bucket to check.
-bucket-file string File of bucket names to check.
-mq Connect to RabbitMQ to get buckets. Requires config file key "mq". Default: "false"
-bucket
Scan a single bucket
s3scanner -bucket secret_uploads
-bucket-file
Scans every bucket name listed in file
s3scanner -bucket-file names.txt
where names.txt contains one bucket name per line
$ cat names.txt
bucket123
assets
image-uploads
Bucket names listed multiple times will only be scanned once.
-mq
Connects to a RabbitMQ server and consumes messages containing bucket names to scan.
s3scanner -mq
Messages should be JSON-encoded Bucket objects - refer to mqingest for a Golang publishing example.
-mq requires the mq.uri and mq.queue_name config file keys. See Config File section for example.
Output
OUTPUT:
-db Save results to a Postgres database. Requires config file key "db.uri". Default: "false"
-json Print logs to stdout in JSON format instead of human-readable. Default: "false"
-db
Saves all scan results to a PostgreSQL database
s3scanner -bucket images -db
- Requires the
db.uriconfig file key. See Config File section for example. - If using
-db, results will also be printed to the console if using-jsonor the default human-readable output mode. s3scannerruns Gorm's Auto Migration feature each time it connects two the database. If the schema already has tables with names Gorm expects, it may change these tables' structure. It is recommended to create a Postgres schema dedicated tos3scannerresults.
-json
Instead of outputting scan results to console in human-readable format, output machine-readable JSON.
s3scanner -bucket images -json
This will print one JSON object per line to the console, which can then be piped to jq or other tools that accept JSON input.
Example: Print bucket name and region for all buckets that exist
$ s3scanner -bucket-file names.txt -json | jq -r '. | select(.bucket.exists==1) | [.bucket.name, .bucket.region] | join(" - ")'
10000 - eu-west-1
10000.pizza - ap-southeast-1
images_sta
Related Skills
tmux
329.0kRemote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.
claude-opus-4-5-migration
81.1kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
blogwatcher
329.0kMonitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.
LibreChat
34.8kEnhanced ChatGPT Clone: Features Agents, MCP, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active.
