EC2 - Elastic Compute Cloud
EC2 Enumeration and Exploitation
Amazon Elastic Compute Cloud (EC2) offers broad support for computing, with over 750 instance types and numerous types of available processors, storage, networking, and operating systems.
Enumeration
Describes the information about all instances
aws ec2 describe-instancesDescribes the information about specified instance
aws ec2 describe-instances --instance-ids [instace-id]Describes the information about UserData Attribute of the specified Instance
aws ec2 describe-instance-attribute --atribute userData --instance-id [instance-id]Describes the infroamtion about IAM instance profile associations
aws ec2 describe-iam-instance-profile-associationsExploitation
SSRF/RCE
SSRF / RCEAWS Metadata
IMDV1
IMDV2
AWS Userdata
IMDV1
IMDV2
EC2StepShell
Persistence
Generate SSH key pair
On EC2 instance, add private key to user ssh directory
Access EC2 using ssh backdoor key
Privilege Escalation
EC2 acting as a reverse-proxy
SSRF / RCE
Enumerating EC2s / EBS
Snapshots ?
Exploit snapshot
EBS - Elastic Block StoreSnapshot found
Launch a ec2 instance (create ssh key pair)
Attach the snapshot created to the ec2 instance

Connect to the instance and mount the snapshot

EC2 - Get Password
Templates

Interesting Book
Interesting BooksAdvanced Penetration Testing: Hacking AWS 2 This book delves deeper into analyzing the security of various AWS services and shows techniques and tactics used by an attacker to breach an AWS environment
Hands-On AWS Penetration Testing with Kali Linux Set up a virtual lab and pentest major AWS services, including EC2, S3, Lambda, and Cloud
Last updated