Serverless Walkthrough

Challenge Statement#

image

Solution#

Firstly, let’s configure our AWS CLI.

image

Now, we can check for any S3 buckets.

image

Trying to view the contents of the S3 bucket doesn’t work since we don’t have the permissions.
Let’s try to check the bucket policies.

image

We see that the bucket policy allows anyone to get objects from the bucket.
We can try to check the object versions in the bucket.

image

Now, we can view the object names and can check each version by using the get-object command.

image

Here, we have our first flag!

image

Viewing this page source code, we see this weird piece of code.

image

This performs a POST request to a Lambda function without any input validation. We can try to exploit this with some injection (SSRF).
Playing around with the directory, we are able to find the second flag.

image

We can then check for other files in the system. One interesting file is the \proc\self\environ.

image

Trying to use the new AWS keys to get access to the new user.

image

We now have access to the user - “redteamapp-lambda”. We can try to assume the dev role since we have permissions to do so.

image

image

Now, remember the website mentioned a DB. This could mean the DynamoDB.

image

We can check for the contents of the database and we get our third flag!

image


Adapted from harishkannan05/THM-HackfinityBattle-Writeup under MIT.

Find us elsewhere

Merch, stickers, and moreSupport the work at the Solvere Labs shop