CloudGoat Lab Demonstrates AWS Credential Theft Through EC2 SSRF

· Original article ↗

Summary

A CloudGoat walkthrough shows how SSRF in an EC2-hosted application can expose IMDS credentials and enable privilege escalation through Lambda, EC2 and S3. It recommends enforcing IMDSv2, restricting requests and using least-privilege IAM.

Key points

  • The intentionally vulnerable CloudGoat ec2_ssrf scenario models an EC2-hosted application that can be abused to access the Instance Metadata Service.
  • The walkthrough demonstrates retrieving IAM role credentials through SSRF and using them to enumerate AWS resources.
  • Credentials discovered in Lambda environment variables and S3 are used in the lab to pivot identities and escalate privileges.
  • The article recommends requiring IMDSv2, restricting metadata access and outbound requests, and applying least-privilege IAM roles.
  • The author advises destroying the lab environment after testing to avoid ongoing AWS charges.

Article Details

Topic
CloudGoat ec2_ssrf lab demonstrating SSRF-based access to EC2 instance metadata, IAM credential exposure, credential pivoting, and privilege escalation in AWS.

MITRE ATT&CK

Vendors

Products

Tools

Related Articles