Cloud & Identity Attack Paths
Attackers rarely break in with one big exploit — they chain small misconfigurations. See the moves, and you can break the chain at any link.
Legal & ethical use
This lesson demonstrates offensive techniques for educational purposes and authorized security testing only. Using them against systems you do not own or lack explicit written permission to test is illegal under computer-misuse laws worldwide, including Turkey’s Penal Code (Law No. 5237, arts. 243-245). The authors and PrimeThreat accept no liability for any misuse of or damage arising from this material.
SSRF → metadata → cloud takeover
A single server-side request forgery reaches the instance metadata service and walks out with cloud credentials.
Exploit public app (SSRF)
A URL parameter the app fetches lets the attacker point it inward.
Hit metadata (169.254.169.254)
IMDSv1 answers without authentication and returns role credentials.
Use the stolen role creds
The instance role’s access key, secret, and session token now act as a valid cloud account.
Over-privileged role reads data
The role can list and read storage it never needed — exfil the buckets.
Enforce IMDSv2 (session-token required), scope instance roles to least privilege, block egress to 169.254.169.254 from app code, and validate/allow-list outbound URLs.
Capital One (2019) — SSRF + IMDSv1 + over-broad role exposed 100M+ records.
Leaked key → IAM privilege escalation
One long-lived access key in a repo or log becomes admin through a permissive IAM policy.
Find a leaked credential
Committed to git, baked into an image, or printed in a log.
Enumerate permissions
List roles, policies, and what this identity can touch.
Abuse a privesc primitive
iam:PassRole + launch, or CreatePolicyVersion to grant itself more.
Persist with a new key
Mint a fresh access key or backdoor a role to survive rotation.
Kill long-lived keys — use SSO and short-lived credentials. Secret-scan every commit and build, enforce least privilege, deny iam:PassRole broadly, and alert on new key / policy-version creation.
Uber (2016) — keys in a private repo led to 57M records.
Phishing → MFA fatigue → session theft
Weak MFA is bypassed by exhausting the user, then the live session is stolen outright.
Get the password
Phish a credential or spray a reused one.
Push-bomb the MFA prompt
Spam approval prompts until the tired user just taps “Approve”.
Steal the session token
Lift the session cookie/token so MFA never matters again.
Pivot to SaaS & cloud
Reuse the session across the IdP’s connected apps and consoles.
Use phishing-resistant MFA (FIDO2/passkeys) or number-matching, enforce conditional access (device + location), shorten session lifetimes, and alert on impossible-travel and new-device sign-ins.
Uber (2022) & 0ktapus — MFA fatigue and session theft across many orgs.
Exposed Kubernetes → cluster takeover
A reachable dashboard or vulnerable pod yields a service-account token with far too much power.
Reach an exposed surface
Public dashboard, unauthenticated kubelet, or an RCE in a pod.
Read the mounted SA token
Default-mounted token sits at a known path inside the container.
Use over-broad RBAC
The token can list secrets or even acts as cluster-admin.
Loot the cluster
Dump every secret, deploy workloads, reach the cloud control plane.
Tight RBAC (no default cluster-admin), set automountServiceAccountToken: false, enforce NetworkPolicy and Pod Security, never expose the dashboard/API publicly, and segment the control plane.
Tesla (2018) — exposed K8s dashboard led to cloud cryptomining.
Cloud IAM privilege-escalation primitives
The “abuse a primitive” step, named. A read-only foothold becomes admin through one of these.
iam:PassRole + compute
Pass a more-privileged role to a Lambda/EC2 you launch, then run as it.
CreatePolicyVersion
Attach a new default version of a policy you can edit — grant yourself *.
AssumeRole chaining
Hop role → role through trust policies until one is admin.
Attach managed policy
iam:AttachUserPolicy lets a weak user bolt on AdministratorAccess.
The controls that cut every chain
A few high-leverage defenses appear in every breaker above. Invest here first.
Least privilege, always
Most chains end because a role could do something it never needed.
Short-lived credentials
SSO + temporary tokens beat long-lived keys that leak and persist.
Phishing-resistant MFA
FIDO2/passkeys remove push-fatigue and most credential phishing.
Segmentation & egress control
Default-deny outbound stops SSRF→metadata and data exfil paths.
Detect the pivot
Alert on new keys, policy changes, impossible travel, metadata calls.
Assume breach, limit blast radius
Design so one compromised identity can’t reach the whole estate.
See the full attacker lifecycle
These chains are slices of a bigger pattern. Next: the end-to-end attack lifecycle and the defender/IR cycles that answer it.