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.
Unfortunately, we have no permission to view our IAM policies, meaning we have no idea what we can and cannot do with this account.
aws--profileflawsiamlist-user-policies--user-namebackupAnerroroccurred (AccessDenied) when calling the ListUserPolicies operation: User: arn:aws:iam::975426262029:user/backup is not authorized to perform: iam:ListUserPolicies on resource: user backup because no identity-based policy allows the iam:ListUserPolicies action
aws--profileflawsiamlist-attached-user-policies--user-namebackupAnerroroccurred (AccessDenied) when calling the ListAttachedUserPolicies operation: User: arn:aws:iam::975426262029:user/backup is not authorized to perform: iam:ListAttachedUserPolicies on resource: user backup because no identity-based policy allows the iam:ListAttachedUserPolicies action
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.
cloudfoxaws-pflawsall-checks
All of the findings are here (at least on MacOS) where flaws is the name of the profile you used.
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.