Level 3
A CTF walkthrough for level 3 of Flaws.Cloud

Enumerating the Domain
In the previous level, we identified the entry point for Level 3 as level3-9afd3927f195e10225021a578e6f78df.flaws.cloud.
Again, we can look up the DNS records and identify this is also an S3 bucket hosting a website.
Enumerating the S3 Bucket
After listing the bucket contents as an unauthenticated user, we discover something interesting, a .git directory!
Let's scan it with Trufflehog and see if it catches any credentials.
Nice! It looks like there are some AWS access keys for the backup user in this bucket.
Let's download the bucket contents and get 'em.
Enumerating .git
We can view the git logs.
Based on the commit comment, "Oops, accidentally added something I shouldn't have" it would seem we should investigate the original commit.
We can view what exactly was changed in the commit with this command.
It looks like the author mistakenly uploaded AWS credentials in the first commit, and then deleted them in the second.
We can continue now that we have the access keys but alternatively, we can check out the commit and view all the files in case there's additional stuff of importance.
Using Access Keys and Enumerating Permissions
We now have AWS access keys! Let's verify who we are.
Unfortunately, we have no permission to view our IAM policies, meaning we have no idea what we can and cannot do with this account.
Short of manually trying hundreds of AWS commands, we can use a tool like cloudfox to help automate the work.
Automated Enumeration with cloudfox
Cloudfox won't find everything but it'll enumerate a ton. Refer to their documentation to see what AWS checks it does.
We'll go ahead and run all AWS checks using the profile flaws I set up for the user backup.
All of the findings are here (at least on MacOS) where flaws is the name of the profile you used.
As you can see there's a ton of data to sift through.
If we start with the buckets, we'll discover the one for Level 4.
Navigating to this website, level4-1156739cfb264ced6de514971a4bef68.flaws.cloud shows us the entry point for Level 4!

Wrap-Up
In Level 3, we enumerate the domain we found in Level 2. After which we discover it's also a static website hosted on AWS S3. As an unauthenticated user, we could list and download the bucket contents. Within these contents was a .git repository containing AWS access keys in one of the commits. We used these access keys to enumerate our permissions with the help of cloudfox since we could not view our permissions.
Unfortunately, in this scenario, hard-coded secrets were found in a publically accessible S3 bucket. Since this bucket is hosting a website, nothing else should be stored here i.e., the .git directory. Additionally, the admins should be scanning their code for secrets to prevent credentials from leaking in the first place.
Last updated
Was this helpful?