SCARLETEEL — 8 Minutes to Admin
Attacker found credentials in a public S3 bucket, injected code into a Lambda function, created access keys for an admin user, and moved laterally across 19 principals in 2 hours.
Attack chain
- 1. Credentials found in public S3 bucket (RAG data)
- 2. lambda:UpdateFunctionCode to inject code into existing Lambda
- 3. iam:CreateAccessKey for an admin user
- 4. Lateral movement across 19 principals (5 users, 6 roles, 14 sessions)
- 5. Cross-account OrganizationAccountAccessRole assumption
- 6. Backdoor admin user created
"The attacker needed 8 minutes. Whocan would have shown the full attack path before there was an attacker."
What Whocan detects
Who can modify Lambda code?
The initial escalation vector — a known attack path.
who-can(
action: "lambda:UpdateFunctionCode"
resource: lambdas
)Who can create access keys for other users?
Every principal that can mint new credentials.
who-can(
action: "iam:CreateAccessKey"
resource: users
)Full privilege escalation chains
The Lambda + execution role chain flagged as a critical sequence.
users where self.Entitlements.Abilities includes "iam-privilege-escalation"
map { Name, Arn, Sequences: self.Entitlements.Sequences }| Attack step | Detected? | How |
|---|---|---|
| User with Lambda write access | Yes | who-can(action: "lambda:UpdateFunctionCode") |
| Lambda → admin escalation chain | Yes | Critical sequence detection |
| CreateAccessKey for other users | Yes | credentials-access entitlement |
| Cross-account role assumption | Yes | Transitive assume-role graph |
| Backdoor admin user created | Yes | Admin population drift monitor |