Premium Hands-on labintermediatered teamAWS
S3 Data Exfiltration via EC2 IMDSv1
This CTF has a misconfigured EC2 web proxy that allows you to access sensitive S3 data that you can exfiltrate. You've captured the flag once you've downloaded all 4 files. Note: If you curl the IP address and you get a timeout or you don't receive a response, it means the instance is still initializing. Give it a couple of minutes and try again.
- 7 guided tasks

Scenario
A company runs an EC2 instance behind a web proxy. The proxy is misconfigured and lets outside requests reach the instance metadata service. Your job is to reach that metadata service, steal the instance role's temporary credentials, and use them to download the sensitive cardholder data from the company's S3 bucket.
What you will learn
- Explain how EC2 instance metadata can expose an IAM role's credentials.
- Reach the instance metadata service through a misconfigured web proxy.
- Retrieve the instance role's temporary credentials from the metadata service.
- Configure the AWS CLI with the stolen credentials.
- Download sensitive data from an S3 bucket using the stolen role.