# AWS - RDS Unauthenticated Enum

{{#include ../../../../banners/hacktricks-training.md}}

## RDS

Vir meer inligting, sien:

{{#ref}}
../../aws-services/aws-relational-database-rds-enum.md
{{#endref}}

## Openbare Poort

Dit is moontlik om publieke toegang tot die **databasis vanaf die internet** te gee. Die aanvaller sal steeds **die gebruikersnaam en wagwoord** moet weet, oor IAM-toegang moet beskik, of 'n **exploit** moet hê om die databasis binne te dring.

## Openbare RDS Snapshots

AWS maak dit moontlik om **toegang aan enigiemand te gee om RDS snapshots af te laai**. Jy kan hierdie openbare RDS snapshots baie maklik vanaf jou eie rekening lys:
```bash
# Public RDS snapshots
aws rds describe-db-snapshots --include-public

## Search by account ID
aws rds describe-db-snapshots --include-public --query 'DBSnapshots[?contains(DBSnapshotIdentifier, `284546856933:`) == `true`]'
## To share a RDS snapshot with everybody the RDS DB cannot be encrypted (so the snapshot won't be encryted)
## To share a RDS encrypted snapshot you need to share the KMS key also with the account


# From the own account you can check if there is any public snapshot with:
aws rds describe-db-snapshots --snapshot-type public [--region us-west-2]
## Even if in the console appear as there are public snapshot it might be public
## snapshots from other accounts used by the current account
```
## Openbare RDS Cluster Snapshots

Net so kan jy na cluster snapshots soek
```bash
# Public RDS cluster snapshots
aws rds describe-db-cluster-snapshots --include-public

## Search by account ID
aws rds describe-db-cluster-snapshots --include-public --query 'DBClusterSnapshots[?contains(DBClusterSnapshotIdentifier, `284546856933:`) == `true`]'

# From the own account you can check if there is any public cluster snapshot with:
aws rds describe-db-cluster-snapshots --snapshot-type public [--region us-west-2]
```
### Publieke URL-sjabloon
```
mysql://{user_provided}.{random_id}.{region}.rds.amazonaws.com:3306
postgres://{user_provided}.{random_id}.{region}.rds.amazonaws.com:5432
```
{{#include ../../../../banners/hacktricks-training.md}}
