Advent of Cyber 2025 - Day 23 - AWS Security - S3cret Santa
☁️ Day 23: Reclaiming the Cloud – An AWS IAM Adventure ๐ฐ๐
๐ Introduction
Deep inside the Kingdom of Wareville, one of TBFC’s stealthiest elves pulled off an incredible infiltration ๐ต️♂️. Hopping quietly into Sir Carrotbane’s office, the elf discovered a shocking sight — cloud credentials casually lying on the desktop like forgotten carrots ๐ฅ๐ป.
The mission was clear:
๐ Use these credentials
๐ Regain access to TBFC’s cloud network
๐ Uncover hidden secrets in the cloud ☁️
Let’s walk through how this cloud infiltration unfolded using AWS IAM and the AWS CLI ๐
๐ฏ Learning Objectives
By the end of this mission, we learned how to:
-
๐ง Understand AWS accounts & IAM
-
๐ Enumerate permissions from an attacker’s perspective
-
๐ป Use the AWS CLI
-
๐ญ Assume roles to escalate privileges
-
๐ฆ Access sensitive data from Amazon S3
๐ Lab Setup & AWS CLI Configuration
AWS allows programmatic access using:
-
Access Key ID
-
Secret Access Key
These credentials were already configured in:
To confirm if they worked, we used AWS STS:
✅ Result:
๐ The credentials were valid and belonged to:
The elf was delighted — cloud access restored! ๐☁️
๐งฉ IAM Explained (Users, Groups, Roles & Policies)
๐ค IAM Users
A user represents an individual identity with specific permissions.
➡️ Example: Sir Carrotbane
๐ฅ IAM Groups
Groups simplify permission management by assigning policies to multiple users at once.
➡️ Example: Carrotbane’s army
๐ญ IAM Roles
Roles provide temporary permissions that can be assumed when needed.
➡️ Sir Carrotbane switching roles based on the battle ⚔️๐ก️
๐ IAM Policies
Policies define:
-
✅ What actions are allowed
-
๐ Which resources
-
๐ Under what conditions
-
๐ค For whom
๐ก Correct Answer:
Policy is the IAM component that defines permissions.
๐ Enumerating Sir Carrotbane’s Permissions
๐ฅ Listing Users
๐ Checking Inline Policies
✔️ Found an inline policy!
๐ Attached Policies?
❌ None found.
๐ฅ Group Membership?
❌ Not part of any group.
๐ง Inspecting the Inline Policy
๐ The policy allowed:
-
Listing users, groups, roles
-
Reading IAM policies
-
Assuming roles using
sts:AssumeRole๐ฏ
๐ก Correct Answer:
SirCarrotbanePolicy
๐ญ Assuming Roles – The Turning Point
๐ Enumerating Roles
๐ Jackpot!
A role named bucketmaster could be assumed by sir.carrotbane.
๐ Checking Role Policies
๐ Permissions unlocked:
-
s3:ListAllMyBuckets -
s3:ListBucket -
s3:GetObject
๐ก Correct Answer:
ListAllMyBuckets
๐ Assuming the Bucketmaster Role
๐งพ Temporary credentials were generated:
-
AccessKeyId
-
SecretAccessKey
-
SessionToken
These were exported to the environment, officially upgrading our access ๐
๐ฆ Exploring Amazon S3
☁️ What is S3?
Amazon Simple Storage Service (S3) is cloud object storage used for:
-
๐ Documents
-
๐ผ️ Images
-
๐ฆ Backups
-
๐งพ Logs
Everything is stored inside Buckets ๐ชฃ
๐ Listing Buckets
๐ A suspicious bucket appeared:
๐ Listing Objects
๐ฏ A file stood out:
๐ฅ Downloading the Secret File
๐ Mission Complete – Secret Revealed ๐
๐ Contents of cloud_password.txt:
๐ก Correct Answer confirmed!
๐ง Final Thoughts
This lab perfectly demonstrates how misconfigured IAM permissions and role assumption can lead to serious cloud security breaches ☁️⚠️.
A single forgotten credential turned into:
-
IAM enumeration ๐
-
Role escalation ๐ญ
-
Sensitive data exfiltration ๐ฆ
๐ก️ Lesson learned:
Least privilege and proper IAM configuration are critical in cloud security.



Comments
Post a Comment