AWS - EC2 Unauthenticated Enum

Impara l'hacking di AWS da zero a eroe con htARTE (Esperto Red Team di HackTricks AWS)!

Altri modi per supportare HackTricks:

EC2 e Servizi Correlati

Controlla in questa pagina maggiori informazioni a riguardo:

pageAWS - EC2, EBS, ELB, SSM, VPC & VPN Enum

Porte Pubbliche

È possibile esporre qualsiasi porta delle macchine virtuali su Internet. A seconda di cosa viene eseguito sulla porta esposta, un attaccante potrebbe sfruttarla.

SSRF

AMI Pubbliche e Snapshot di EBS

AWS permette di concedere accesso a chiunque per scaricare AMI e Snapshot. È possibile elencare facilmente queste risorse dal proprio account:

# Public AMIs
aws ec2 describe-images --executable-users all

## Search AMI by ownerID
aws ec2 describe-images --executable-users all --query 'Images[?contains(ImageLocation, `967541184254/`) == `true`]'

## Search AMI by substr ("shared" in the example)
aws ec2 describe-images --executable-users all --query 'Images[?contains(ImageLocation, `shared`) == `true`]'

# Public EBS snapshots (hard-drive copies)
aws ec2 describe-snapshots --restorable-by-user-ids all
aws ec2 describe-snapshots --restorable-by-user-ids all | jq '.Snapshots[] | select(.OwnerId == "099720109477")'

Se trovi uno snapshot ripristinabile da chiunque, assicurati di controllare AWS - EBS Snapshot Dump per istruzioni su come scaricare e saccheggiare lo snapshot.

Modello di URL pubblico

# EC2
ec2-{ip-seperated}.compute-1.amazonaws.com
# ELB
http://{user_provided}-{random_id}.{region}.elb.amazonaws.com:80/443
https://{user_provided}-{random_id}.{region}.elb.amazonaws.com

Enumerare le istanze EC2 con indirizzo IP pubblico

aws ec2 describe-instances --query "Reservations[].Instances[?PublicIpAddress!=null].PublicIpAddress" --output text
Impara l'hacking AWS da zero a eroe con htARTE (Esperto Red Team AWS di HackTricks)!

Altri modi per supportare HackTricks:

Last updated