All hands-on labs

Free Hands-on labbeginnerred teamAWS

Discover AWS Account ID via S3 Bucket

Learn how to enumerate AWS account IDs with very limited access to S3 buckets. This lab simulates compromised credentials and makes use of a clever automated tool to reduce guesses from 1 trillion possible combinations down to only 120.

  • 7 guided tasks
  • Capture the flag
  • Video walkthrough

Scenario

In this scenario, we're conducting a basic penetration test for a client who has provided IAM User credentials via an access key. This simulates stolen long-term credentials, a common source of AWS breaches. After completing basic enumeration from prior labs in this course, you successfully discovered an IAM Role that appears to have access to an Amazon S3 bucket, but the S3 bucket seems to be in a different AWS account. You want to identify which AWS account it belongs to.

What you will learn

  • Configure the AWS CLI with the IAM user credentials the lab gives you.
  • Enumerate an IAM role and read its policy to find the S3 bucket it can reach.
  • Assume the role and run s3-account-search to find the account ID that owns the bucket.
  • Explain how the s3:ResourceAccount condition key makes this technique work.
  • Describe why the tool needs at most 120 attempts instead of 1 trillion.
Hands-on lab

Discover AWS Account ID via S3 Bucket

Free with a Cybr account.