Cloud Ring - Exploitation via AWS CLI Walkthrough

Flex some more advanced AWS CLI skills to escalate privileges after completing Trufflehog Search Challenge! Help Gerty Snowburrow in the Cloud Ring to get hints for this challenge.

After referencing the AWS command reference we were able to identify the following command that lists the iam attached user policies for user haug

>> aws iam list-attached-user-policies --user-name haug 

Next Question in Terminal 

>> aws iam get-policy --policy-arn arn:aws:iam::602123424321:policy/TIER1_READONLY_POLICY

This command allows us to view the TIE1_READONLY_POLICY in detail which was attached to the user identity we stole from the commit 

Next question in terminal 

Now we will have to view the default version of the TIER1_READONLY_POLICY by suing the –version-id switch and to support terminal navigation have pipped the command through more

>> aws iam get-policy-version --policy-arn arn:aws:iam::602123424321:policy/TIER1_READONLY_POLICY --version-id v1 | more

Next question in terminal:

Now we are being asked to list any inline policies attached to the user identiy or resource. Which can be listed by list-user-policies with switch specifying the username in question

>> aws iam list-user-policies --user-name haug

We can see a policy name S3Perms being attached to the user as an inline policy

Next question on terminal

To deepdive on a inline user policy via AWS CLI, we use the get-user-policy command and specifying the policy name

>> aws iam get-user-policy --user-name haug --policy-name S3Perms

Where we can see a access to S3 bucket name “smogmachine3” attached to this policy 

Next question on Terminal

To list S3api objects, we will have to use the list-objects command with switch –bucket pointing to the S3 resource

>> aws s3api list-objects --bucket smogmachines3 

Next question in terminal 

>> aws lamda list-functions


Next question in Terminal

Get-function-url-config command retrieves the configuration containing public url if any using the aws lamda function

>> aws lambda get-function-url-config --function-name smogmachine_lambda


Function URLfrom above screenshot: https://rxgnav37qmvqxtaksslw5vwwjm0suhwc.lambda-url.us-east-1.on.aws/

Full map


Cloud Ring Unlocked !



Comments

Popular posts from this blog

SANS Kringlecon 2022 Introduction

Tolkien Ring - Wireshark Practice walkthrough

Elfen Ring - Prison Escape Walkthrough