AWS IAM PrivEsc: iam:PassRole → Lambda Escalation
Scenario
You hold low-privilege credentials (dev-ci) on a simulated AWS account. Their policy grants iam:PassRole together with lambda:CreateFunction and lambda:InvokeFunction — a classic privilege-escalation primitive, because Lambda runs as whatever execution role you pass to it.
Your task
This lab is a live IAM simulator — there is nothing to decode. Inspect the account, then submit the ordered chain of AWS/IAM actions that escalates you to admin:
- Enumerate roles you may pass and find the admin-capable role that trusts
lambda.amazonaws.com. - Pass that role to a new function with
lambda:CreateFunction(authorised byiam:PassRole). lambda:InvokeFunction— the function now executes with the admin role's permissions.- From inside that execution the function calls
iam:AttachUserPolicyto attachAdministratorAccessto your own user.
Get the sequence right and the simulator returns your hc{...} flag. Everything is simulated — no real AWS account, role or credential is touched.
Sign in to unlock escalating hints for this hard lab.
// go deeper
- Practice this in a legal lab: Box: AWS Lambda Privilege Escalation
- Practice this in a legal lab: Box: Cloud Misconfig (S3 + IAM + SSRF)
- Practice this in a legal lab: IAM Policy Audit
- Read the writeup: From SSRF to Cloud Admin: Chaining AWS Metadata Exposure in a Serverless App
- Read the writeup: SSRF in a PDF Generator Led Me to AWS Metadata and Full Cloud Compromise