IAM AttachUserPolicy PrivEsc
Exploit iam:AttachUserPolicy to grant yourself higher privileges with AWS managed policies. Using your new privileges, gain access to a secret value stored in Secrets Manager that your IAM user should not have been able to access. Complete the lab by submitting the secret value as the flag.
- 8 guided tasks
- Capture the flag
- Terminal in the browser

Scenario
AWS provides managed policies that anyone with an AWS account can assign and use as long as they have iam:AttachUserPolicy permissions. There are over a thousand of these managed policies that vary from providing read-only access to full administrative access.
This lab has been misconfigured, so exploit it with iam:AttachUserPolicy to grant yourself Secrets Manager permissions.
You've successfully completed this lab once you've submitted the secret as the flag!
What you will learn
- Configure the AWS CLI with the keys the lab gives you
- Enumerate your IAM user, its inline policy, group, and permission boundary
- Use iam:AttachUserPolicy to attach an AWS managed policy to your own user
- Reach a Secrets Manager secret that you could not read before
- Submit the secret value to capture the flag