skip to main content
hacking.communityplay in the sandbox.

AWS IAM PrivEsc: iam:PassRole → Lambda Escalation

cloud · hard · +130 XP

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:

  1. Enumerate roles you may pass and find the admin-capable role that trusts lambda.amazonaws.com.
  2. Pass that role to a new function with lambda:CreateFunction (authorised by iam:PassRole).
  3. lambda:InvokeFunction — the function now executes with the admin role's permissions.
  4. From inside that execution the function calls iam:AttachUserPolicy to attach AdministratorAccess to 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.

// graded hints — spend XP when stuck

Sign in to unlock escalating hints for this hard lab.

// IAM privilege-escalation simulator
identity: arn:aws:iam::1234:user/dev-ci
goal: Attach AdministratorAccess to your own user (dev-ci).
available actions — tap to add (5 correct steps)
your chain
tap actions above to build the escalation chain…
// submit flag
// no solves yet

// go deeper

// install app

Install hacking.community for fast access, offline reading, and push notifications. No app store needed.