Files
hacktricks-cloud/src/pentesting-cloud/aws-security/aws-unauthenticated-enum-access/aws-ec2-unauthenticated-enum.md

55 lines
2.1 KiB
Markdown

# AWS - EC2 Ongeauthentiseerde Enum
{{#include ../../../banners/hacktricks-training.md}}
## EC2 & Verwante Dienste
Kyk op hierdie bladsy vir meer inligting oor dit:
{{#ref}}
../aws-services/aws-ec2-ebs-elb-ssm-vpc-and-vpn-enum/
{{#endref}}
### Publieke Poorte
Dit is moontlik om die **enige poort van die virtuele masjiene aan die internet bloot te stel**. Afhangende van **wat loop** op die blootgestelde poort, kan 'n aanvaller dit misbruik.
#### SSRF
{{#ref}}
https://book.hacktricks.wiki/en/pentesting-web/ssrf-server-side-request-forgery/cloud-ssrf.html
{{#endref}}
### Publieke AMI's & EBS Snapshotte
AWS laat toe om **toegang aan enigiemand te gee om AMI's en Snapshotte af te laai**. Jy kan hierdie hulpbronne baie maklik vanaf jou eie rekening lys:
```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")'
```
As jy 'n snapshot vind wat deur enigiemand herstel kan word, maak seker om [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) na te gaan vir riglyne oor die aflaai en plunder van die snapshot.
#### Publieke URL-sjabloon
```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
```
### Enumereer EC2-instansies met openbare IP
```bash
aws ec2 describe-instances --query "Reservations[].Instances[?PublicIpAddress!=null].PublicIpAddress" --output text
```
{{#include ../../../banners/hacktricks-training.md}}