> For the complete documentation index, see [llms.txt](https://cookiez.gitbook.io/red-team/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cookiez.gitbook.io/red-team/cloud/aws/discovery/storage.md).

# Storage

{% @github-files/github-code-block url="<https://github.com/mxm0z/awesome-sec-s3>" %}

AWS Supports:&#x20;

− S3 (Simple Storage Service, object storage)&#x20;

− EBS (Elastic Block Storage, disk storage)&#x20;

− EFS (Elastic File Storage, shares similar to NFS)&#x20;

− High-Performance Storage (A NetApp "Filer" SAN with iSCSI Support)

Tools to enumerate S3 buckets include:&#x20;

− Gobuster: Use the S3 API to validate whether buckets exist or not, will attempt to list files of open buckets.&#x20;

− CloudStorageFinder: Toolset by DigiNinja that can scan for S3, DigitalOcean Spaces, and GCP Buckets.

## Grep Files For S3 Bucket Names

```
grep -rEo 's3://[a-zA-Z0-9.-]+|([a-zA-Z0-9.-]+)\.s3[a-zA-Z0-9.-]*\.amazonaws\.com|arn:aws:s3:::[a-zA-Z0-9.-]+' /path/to/search |
sed -E 's#(s3://|https?://|\.s3[a-zA-Z0-9.-]*\.amazonaws\.com|arn:aws:s3:::)##g' |
awk -F: '{print $NF}' |
sort -u > s3_bucketsuniquename.txt
```

* **`s3://[a-zA-Z0-9.-]+`** → Matches URLs like `s3://my-bucket-name`
* **`([a-zA-Z0-9.-]+)\.s3[a-zA-Z0-9.-]*\.amazonaws\.com`** → Matches `my-bucket.s3.amazonaws.com`
* **`arn:aws:s3:::[a-zA-Z0-9.-]+`** → Matches AWS ARNs like `arn:aws:s3:::my-bucket-name`
* Names are then stripped of surrounding fluff
