Metadata-Version: 2.5
Name: s3mbura
Version: 0.2.1
Summary: S3mbura - a focused security auditor for Amazon S3 buckets.
Project-URL: Homepage, https://github.com/0xs3n4/s3mbura
Project-URL: Repository, https://github.com/0xs3n4/s3mbura
Project-URL: Issues, https://github.com/0xs3n4/s3mbura/issues
Project-URL: Changelog, https://github.com/0xs3n4/s3mbura/releases
Author: 0xs3n4
License: MIT
License-File: LICENSE
Keywords: audit,aws,bucket,cloud-security,misconfiguration,pentest,s3,sarif,security
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Security
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.11
Requires-Dist: boto3>=1.34
Requires-Dist: botocore>=1.34
Provides-Extra: dev
Requires-Dist: moto[s3]>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Provides-Extra: publish
Requires-Dist: build>=1.2; extra == 'publish'
Requires-Dist: twine>=5.0; extra == 'publish'
Description-Content-Type: text/markdown

# 🦀 S3mburá

> *Everything the bucket holds, in one basket.*

**s3mbura** is a focused security auditor for **Amazon S3**. The *samburá* is the
basket a mangrove catcher carries to hold everything pulled from the mud — and
that is exactly what this tool does to a bucket: it reaches in and brings back
everything knowable about it, in one place.

One tool that combines the three things the ecosystem spreads across separate
projects:

| Layer | What it does |
|-------|--------------|
| **Permissions** | public ACL, policy status, Public Access Block, effective access |
| **Configuration sweep** | every readable bucket sub-resource (CORS, encryption, logging, website, versioning, ...) |
| **Listing** | condition-aware listing that adapts to restrictive bucket policies |
| **Content** | verified secret / PII scanning of reachable objects |

S3-only by design: no multi-cloud, no bloat. See [`ROADMAP.md`](ROADMAP.md) for the
full design and build plan.

### The four differentiators, in mangue terms

| Differentiator | Mangue metaphor |
|----------------|-----------------|
| Full sub-resource sweep | **Bracear** — reach your whole arm into the burrow, checking every sub-resource |
| Versioned-object recovery | **Lama** — what was "deleted" sank into the mud, but it's still down there |
| Condition-aware listing | **Siri** — the crab walks sideways, sending the request shape the policy already accepts |
| Verified secrets | **Samburá** — only the real crabs go in the basket; no false positives |

> **Status:** all 8 roadmap phases implemented — existence/region, full
> sub-resource sweep, effective-access probes, condition-aware listing,
> versioned-object recovery, verified-secret content scanning, JSON/SARIF
> output, and concurrency + namespace discovery. See [`ROADMAP.md`](ROADMAP.md).

## Install

Requires **Python 3.11+**.

### Via pip

s3mbura is published on [PyPI](https://pypi.org/project/s3mbura/):

```bash
pip install s3mbura
```

Upgrade to the latest release with `pip install -U s3mbura`. Prefer an isolated
CLI install? `pipx install s3mbura` works too.

To try unreleased changes from `main`, install straight from the repository:

```bash
pip install git+https://github.com/0xs3n4/s3mbura.git
```

### Via git clone (for development)

Clone and install in editable mode, so your changes take effect without reinstalling:

```bash
git clone https://github.com/0xs3n4/s3mbura.git
cd s3mbura

python -m venv .venv
source .venv/bin/activate        # Windows PowerShell:  .venv\Scripts\Activate.ps1

pip install -e ".[dev]"          # editable install + test/lint tooling
```

Either way you get the `s3mbura` command on your `PATH`. Verify with:

```bash
s3mbura --help
```

## Usage

```bash
# Audit a single bucket (passive, anonymous by default)
s3mbura dev.huge-logistics.com -v

# Any S3 addressing style works
s3mbura https://s3.amazonaws.com/dev.huge-logistics.com

# Authenticated (SigV4) audit with a named profile
s3mbura my-bucket --signed --profile prod

# Reports
s3mbura my-bucket --json report.json        # full JSON
s3mbura my-bucket --sarif report.sarif       # SARIF 2.1.0 (GitHub code scanning)
s3mbura my-bucket --json-stdout              # JSON to stdout

# Intrusive, opt-in (authorised targets only)
s3mbura my-bucket --scan                     # fetch + scan object content for secrets (in memory)
s3mbura my-bucket --active                   # write-probe (canary PutObject, never deletes)

# Download a specific object you found while auditing
s3mbura my-bucket --get shared/report.zip                 # save to the current directory
s3mbura my-bucket --get shared/report.zip --get index.html --out loot/
s3mbura my-bucket --get secret/backup.sql --signed --profile prod  # authenticated

# Namespace discovery: enumerate likely bucket names from a keyword
s3mbura acme --discover

# Recover the owner AWS account ID (noisy; needs your creds + a role to assume)
s3mbura my-bucket --signed --account-id --account-id-role arn:aws:iam::<you>:role/probe
```

Accepts every S3 addressing style: bare name, virtual-hosted URL, path-style URL,
and website endpoint. Exit code is non-zero when a finding of MEDIUM severity or
higher is reported.

### Docker

```bash
docker build -t s3mbura .
docker run --rm s3mbura dev.huge-logistics.com -v
```

> Planned to also ship as a module of **manguescan** (`manguescan s3`), keeping
> *S3mburá* as the module's identity in the banner and docs.

## Authorised use only

This is an offensive-security tool. Use it **only** against buckets you own or are
explicitly authorised to test (your own labs, CTFs, or in-scope engagements).

- **Passive by default.** Metadata and permission checks are read-only.
- `--scan` is required before any object content is fetched (scanned in
  memory for secrets; nothing is written to disk).
- `--get KEY` downloads that exact object to disk (repeatable; `--out DIR` sets
  the destination, default the current directory). Naming the key is itself the
  authorisation, so it works anonymously or, with `--signed`, authenticated.
  Keys keep their folder structure and can never escape `--out`.
- `--active` is required before any write-probe, and the tool **never deletes**.

## Credits & inspiration

s3mbura stands on the shoulders of the tools and researchers below. It does not
reuse their code — every line here is original — but it openly borrows their
ideas and tries to unify the best of each into one S3-focused tool.

**Origin story.** This project started while solving the Pwned Labs lab
[*AWS S3 Enumeration Basics*](https://pwnedlabs.io/), where
[BucketLoot](https://github.com/redhuntlabs/BucketLoot) could not list a bucket
whose policy conditioned `s3:ListBucket` on `s3:delimiter`. Explaining *why*
(not a bug — the policy requires a request shape `aws s3 ls` happens to send)
became the seed of the condition-aware listing idea.

| Capability in s3mbura | Inspired by / idea from |
|---|---|
| Content & secret scanning (`--scan`) | [BucketLoot](https://github.com/redhuntlabs/BucketLoot) (RedHunt Labs) |
| Permission / ACL enumeration model | [S3Scanner](https://github.com/sa7mon/S3Scanner) (sa7mon) |
| Scope decision (S3-only, *not* multi-cloud) | [cloud_enum](https://github.com/initstring/cloud_enum) (initstring) — deliberately narrowed |
| Check-registry + streaming findings, CIS/FSBP mapping | [Prowler](https://github.com/prowler-cloud/prowler) and [ScoutSuite](https://github.com/nccgroup/ScoutSuite) |
| Condition-aware listing (`s3:delimiter`/`s3:prefix`) | [Pwned Labs](https://pwnedlabs.io/) lab + the way `aws s3 ls` defaults to `delimiter=/` |
| Owner account-ID enumeration (`--account-id`) | [s3-account-search](https://github.com/WeAreCloudar/s3-account-search) (Ben Bridts / Cloudar) and `bucky` (umair9747) |
| The `s3:ResourceAccount` condition-key technique | [Ben Bridts, 2021](https://hackingthe.cloud/aws/enumeration/enumerate_metadata_via_iam_condition_keys/); generalised by [Plerion — conditional-love](https://github.com/plerionhq/conditional-love) |
| Namespace / wordlist discovery (`--discover`) | S3Scanner and cloud_enum name-permutation approaches |
| SARIF 2.1.0 output | severities anchored to the [CIS AWS Foundations Benchmark](https://www.cisecurity.org/benchmark/amazon_web_services) and [AWS Foundational Security Best Practices](https://docs.aws.amazon.com/securityhub/latest/userguide/fsbp-standard.html) |

**Further reading** on the account-ID technique:
[Plerion](https://www.plerion.com/blog/conditional-love-for-aws-metadata-enumeration),
[Tracebit](https://tracebit.com/blog/how-to-find-the-aws-account-id-of-any-s3-bucket),
[HackTricks Cloud](https://cloud.hacktricks.wiki/en/pentesting-cloud/aws-security/aws-unauthenticated-enum-access/aws-s3-unauthenticated-enum/index.html).

Thanks to all of the above authors and maintainers.

## License

MIT © 0xs3n4
