GCP - Cloud SQL Persistence
Reading time: 2 minutes
tip
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
Support HackTricks
- Check the subscription plans!
- Join the 💬 Discord group or the telegram group or follow us on Twitter 🐦 @hacktricks_live.
- Share hacking tricks by submitting PRs to the HackTricks and HackTricks Cloud github repos.
Cloud SQL
For more information about Cloud SQL check:
Expose the database and whitelist your IP address
A database only accessible from an internal VPC can be exposed externally and your IP address can be whitelisted so you can access it.
For more information check the technique in:
GCP - Cloud SQL Post Exploitation
Create a new user / Update users password / Get password of a user
To connect to a database you just need access to the port exposed by the database and a username and password. With enough privileges you could create a new user or update an existing user password.
Another option would be to brute force the password of an user by trying several password or by accessing the hashed password of the user inside the database (if possible) and cracking it.
Remember that it's possible to list the users of a database using GCP API.
note
You can create/update users using GCP API or from inside the databae if you have enough permissions.
For more information check the technique in:
GCP - Cloud SQL Post Exploitation
tip
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
Support HackTricks
- Check the subscription plans!
- Join the 💬 Discord group or the telegram group or follow us on Twitter 🐦 @hacktricks_live.
- Share hacking tricks by submitting PRs to the HackTricks and HackTricks Cloud github repos.