AWS - RDS Unauthenticated Enum

HackTricksをサポートする

RDS

詳細については以下を参照してください:

AWS - Relational Database (RDS) Enum

Public Port

インターネットからデータベースにパブリックアクセスを許可することが可能です。攻撃者はユーザー名とパスワード、IAMアクセス、またはエクスプロイトを知っている必要があります。

Public RDS Snapshots

AWSは誰でもRDSスナップショットをダウンロードできるアクセスを許可しています。自分のアカウントからこれらのパブリックRDSスナップショットを非常に簡単にリストすることができます:

# 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

公開URLテンプレート

https://rds.amazonaws.com/

Unauthenticated Enumeration

認証なし列挙

https://rds.amazonaws.com/?Action=DescribeDBInstances

Response

応答

<DescribeDBInstancesResponse xmlns="http://rds.amazonaws.com/doc/2014-10-31/">
  <DescribeDBInstancesResult>
    <DBInstances>
      <DBInstance>
        <DBInstanceIdentifier>mydbinstance</DBInstanceIdentifier>
        <DBInstanceClass>db.t2.micro</DBInstanceClass>
        <Engine>mysql</Engine>
        <DBInstanceStatus>available</DBInstanceStatus>
        <MasterUsername>admin</MasterUsername>
        <Endpoint>
          <Address>mydbinstance.123456789012.us-east-1.rds.amazonaws.com</Address>
          <Port>3306</Port>
        </Endpoint>
        <AllocatedStorage>20</AllocatedStorage>
        <InstanceCreateTime>2021-01-01T12:00:00Z</InstanceCreateTime>
        <PreferredBackupWindow>07:00-09:00</PreferredBackupWindow>
        <BackupRetentionPeriod>7</BackupRetentionPeriod>
      </DBInstance>
    </DBInstances>
  </DescribeDBInstancesResult>
  <ResponseMetadata>
    <RequestId>12345678-1234-1234-1234-123456789012</RequestId>
  </ResponseMetadata>
</DescribeDBInstancesResponse>
mysql://{user_provided}.{random_id}.{region}.rds.amazonaws.com:3306
postgres://{user_provided}.{random_id}.{region}.rds.amazonaws.com:5432
HackTricksをサポートする

Last updated