AWS - RDS Unauthenticated Enum

Wspieraj HackTricks

RDS

Więcej informacji znajdziesz tutaj:

AWS - Relational Database (RDS) Enum

Publiczny Port

Możliwe jest udzielenie publicznego dostępu do bazy danych z internetu. Atakujący nadal będzie musiał znać nazwę użytkownika i hasło, mieć dostęp IAM lub wykorzystać exploit, aby wejść do bazy danych.

Publiczne Snapshots RDS

AWS umożliwia dostęp do pobierania snapshotów RDS dla każdego. Możesz bardzo łatwo wymienić te publiczne snapshoty RDS ze swojego konta:

# 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

Public URL template

https://rds.amazonaws.com/<version>/?Action=DescribeDBInstances

Opis

W tym przykładzie użyjemy DescribeDBInstances do wyliczenia instancji RDS. Możemy to zrobić bez uwierzytelnienia, jeśli polityka IAM pozwala na dostęp publiczny.

Przykład

curl "https://rds.amazonaws.com/latest/?Action=DescribeDBInstances"

Wynik

Jeśli dostęp jest dozwolony, otrzymasz listę instancji RDS w formacie XML.

mysql://{user_provided}.{random_id}.{region}.rds.amazonaws.com:3306
postgres://{user_provided}.{random_id}.{region}.rds.amazonaws.com:5432
Wspieraj HackTricks

Last updated