Perfect Storage
Last updated
Last updated
The intern is exploring S3 buckets to host internal documents. He insists that he has scoped the IAM policy correctly to restrict access solely to the admin. Prove the intern wrong by escalating your user privileges and access the secret document!
Attached File: user.txt
Since the challenge description mentioned IAM, lets attempt to perform IAM enumeration on the user.
Doing standard enumeration, we noticed the user have the policy hackerman101 attached. Lets attempt to enumerate the policy now.
In the iam policy, we noticed that the user thisisauselessuserfortesting
has the get bucket permission for perfect-storage-7815696ecbf1c96
However, when attempting to access the s3 bucket, we are met with an explicit deny in an identity based policy.
Lets attempt to get the bucket policy to see if theres any policy that is explicitly denying our permission.
I have attached the prettified
Here we can see the bucket policy allow all principal (ie any user) to perform list bucket and get object. However, there is a condition where the user principal arn is arn:aws:iam::666666666666:user/admin
The ForAllValues
is overtly permissive according to aws documentation.
So if we are able to pass the PrincipalArn as empty, we are able to bypass this policy.
Comparing the output between both s3 list object, we can see the second one with the --no-sign-request
is able to bypass the policy.