Public Snapshots
📌 Overview
In this lab, we’ll perform basic enumeration against an exposed AWS S3 bucket linked from a public-facing web service. We’ll extract the AWS Account ID that owns the bucket — a valuable piece of information for cloud pentesting, as it can be used to track down other public AWS resources like EBS and RDS snapshots. We’ll walk through:
Discovering a service and identifying an S3 bucket
Enumerating the AWS Account ID via role assumption
Identifying the S3 bucket’s region
Searching for publicly exposed snapshots owned by that account
👉 Think of EBS (Elastic Block Store) like a hard drive in the cloud. It provides storage volumes that can be attached to virtual machines (called EC2 instances) to store operating systems, applications, and data. These volumes can sometimes be made public by accident.
👉 RDS (Relational Database Service) is a managed cloud database service that lets you run databases like MySQL, PostgreSQL, or SQL Server without handling the underlying infrastructure. Just like with EBS, database snapshots (backups) can sometimes be made public unintentionally.
Publicly exposed EBS and RDS snapshots can unintentionally leak sensitive data or system configurations if not secured properly (e.g. Capital One breach).
🔍 Enumeration
We start by scanning the target IP for open ports:
$ sudo nmap -T4 -p- -open -Pn 54.204.171.32
<SNIP>
PORT STATE SERVICE
80/tcp open http
Nmap done: 1 IP address (1 host up) scanned in 280.46 second
Visiting the site's source code reveals some images being loaded from an AWS S3 bucket (Figure 2). By visiting https://mega-big-tech.s3.amazonaws.com, we can list the bucket’s contents if permissions allow it (Figure 3).


👉 An S3 bucket is AWS's object storage service. Buckets are globally unique and often exposed via URLs like https://.s3.amazonaws.com.
🔐 AWS CLI Credentials
We’re provided with AWS credentials to assume a role for this lab that will allow us to execute commands in a specific user context, in this case, have the s3:GetObject and s3:ListBucket permissions.
Assuming a role that's assigned one of these permissions is required for the
s3-account-searchscript to work.
👉 The AWS Account ID here (427648302155) belongs to the identity we're currently using — not the bucket owner we’re trying to find.
The s3-account-search script attempts to enumerate the AWS Account ID of the target S3 bucket by using our credentials and a role we control.
👉 An AWS Account ID is a globally unique 12-digit identifier for an AWS account. It’s useful for targeting public resources like snapshots, AMIs, etc.
This Python script is a cloud enumeration utility designed to brute-forces the AWS account ID of a target S3 bucket’s owner by:
Assuming a provided IAM role in your account.
Incrementally testing IAM policies that allow access only if the resource belongs to an account whose ID starts with specific digits.
Brute-forcing one digit at a time by checking whether access is allowed, using AWS’s
s3:ResourceAccountcondition key.Repeating this until the full 12-digit account ID is discovered.
We can use curl to check which region the bucket resides in. This is crucial because public snapshots are only visible in their home region.
👉 us-east-1 is the AWS region code for North Virginia — where we’ll hunt for other public resources.
🌐 Public Snapshots
Now log into your personal AWS account, and in the us-east-1 region (Figure 4.1). Once logged-in:
Go to EC2 → EBS Snapshots (Figure 4.2 & 4.3)
Select Public Snapshots (Figure 4.4)
In the search bar, type:
Owner = 107513503799(Figure 4.5)

👉 AWS allows creating public snapshots of EBS volumes and RDS databases, sometimes accidentally left open. If found, these can be mounted or restored to access data.
Once we have the owner's ID, after configuring the region, we can enumerate public snapshots via the CLI.
✅ Summary
In this lab you learned to:
Scan for open services
Identify S3 bucket references in web pages
Interact with AWS CLI and configure credentials
Use Security Token Service (STS) to verify the active identity
Enumerate a bucket owner’s AWS Account ID
Identify a bucket’s region using HTTP headers
Search for public AWS resources (like EBS snapshots) associated with that account
📌 Key AWS Concepts
S3 Bucket
Cloud-based object storage container
AWS Account ID
Unique 12-digit AWS account identifier
Role
Temporary credentials allowing users/services to assume permissions
Security Token Service
API to retrieve details about the current identity
Public Snapshot
An EBS/RDS snapshot marked public and accessible by anyone in its region
Last updated