# AWS - EC2 Unauthenticated Enum {{#include ../../../banners/hacktricks-training.md}} ## EC2 & संबंधित सेवाएँ इस पृष्ठ पर इसके बारे में अधिक जानकारी देखें: {{#ref}} ../aws-services/aws-ec2-ebs-elb-ssm-vpc-and-vpn-enum/ {{#endref}} ### सार्वजनिक पोर्ट यह **वर्चुअल मशीनों के किसी भी पोर्ट को इंटरनेट पर एक्सपोज़** करना संभव है। **जो चल रहा है** उस पर निर्भर करते हुए, एक हमलावर इसका दुरुपयोग कर सकता है। #### SSRF {{#ref}} https://book.hacktricks.wiki/en/pentesting-web/ssrf-server-side-request-forgery/cloud-ssrf.html {{#endref}} ### सार्वजनिक AMIs & EBS स्नैपशॉट्स AWS **किसी को भी AMIs और स्नैपशॉट्स डाउनलोड करने की अनुमति देता है**। आप अपने खाते से इन संसाधनों को बहुत आसानी से सूचीबद्ध कर सकते हैं: ```bash # 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")' ``` यदि आप एक स्नैपशॉट पाते हैं जिसे कोई भी पुनर्स्थापित कर सकता है, तो सुनिश्चित करें कि आप [AWS - EBS Snapshot Dump](https://cloud.hacktricks.wiki/en/pentesting-cloud/aws-security/aws-post-exploitation/aws-ec2-ebs-ssm-and-vpc-post-exploitation/index.html#ebs-snapshot-dump) पर डाउनलोड करने और स्नैपशॉट लूटने के लिए निर्देशों की जांच करें। #### सार्वजनिक यूआरएल टेम्पलेट ```bash # 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 ``` ### सार्वजनिक IP के साथ EC2 उदाहरणों की गणना करें ```bash aws ec2 describe-instances --query "Reservations[].Instances[?PublicIpAddress!=null].PublicIpAddress" --output text ``` {{#include ../../../banners/hacktricks-training.md}}