Az - MySQL 数据库权限提升
Tip
学习并练习 AWS Hacking:
HackTricks Training AWS Red Team Expert (ARTE)
学习并练习 GCP Hacking:HackTricks Training GCP Red Team Expert (GRTE)
学习并练习 Az Hacking:HackTricks Training Azure Red Team Expert (AzRTE)
支持 HackTricks
- 查看 subscription plans!
- 加入 💬 Discord group 或者 telegram group 或 关注 我们的 Twitter 🐦 @hacktricks_live.
- 通过向 HackTricks 和 HackTricks Cloud github 仓库 提交 PRs 来分享 hacking tricks。
MySQL 数据库权限提升
有关 SQL 数据库的更多信息,请查看:
Microsoft.DBforMySQL/flexibleServers/read && Microsoft.DBforMySQL/flexibleServers/write
拥有此权限,您可以在 Azure 上创建、更新或删除 MySQL Flexible Server 实例。这包括配置新服务器、修改现有服务器配置或退役服务器。
az mysql flexible-server create \
--name <ServerName> \
--resource-group <ResourceGroupName> \
--location <Location> \
--admin-user <AdminUsername> \
--admin-password <AdminPassword> \
--sku-name <SkuName> \
--storage-size <StorageSizeInGB> \
--tier <PricingTier> \
--version <MySQLVersion>
例如,这些权限允许更改 MySQL 密码,当然在启用 MySQL 身份验证的情况下非常有用。
az mysql flexible-server update \
--resource-group <resource_group_name> \
--name <server_name> \
--admin-password <password_to_update>
此外,如果您想从非私有端点访问,则必须启用公共访问,启用方法:
az mysql flexible-server update --resource-group <resource_group_name> --server-name <server_name> --public-access Enabled
Microsoft.DBforMySQL/flexibleServers/read, Microsoft.DBforMySQL/flexibleServers/write, Microsoft.DBforMySQL/flexibleServers/backups/read, Microsoft.ManagedIdentity/userAssignedIdentities/assign/action
通过这些权限,您可以从备份中恢复 MySQL 服务器:
az mysql flexible-server restore \
--resource-group <resource_group_name> \
--name <restore_server_name> \
--source-server <server_name> \
--yes
Microsoft.DBforMySQL/flexibleServers/read, Microsoft.DBforMySQL/flexibleServers/write, Microsoft.ManagedIdentity/userAssignedIdentities/assign/action, Microsoft.DBforMySQL/flexibleServers/administrators/write && Microsoft.DBforMySQL/flexibleServers/administrators/read
通过此权限,您可以为 MySQL Flexible Server 配置 Azure Active Directory (AD) 管理员。可以通过将自己或其他帐户设置为 AD 管理员来利用此权限,从而获得对 MySQL 服务器的完全管理控制。重要的是,flexible-server 必须具有用户分配的托管身份以供使用。
az mysql flexible-server ad-admin create \
--resource-group <ResourceGroupName> \
--server-name <ServerName> \
--display-name <ADAdminDisplayName> \
--identity <IdentityNameOrID> \
--object-id <ObjectID>
Tip
学习并练习 AWS Hacking:
HackTricks Training AWS Red Team Expert (ARTE)
学习并练习 GCP Hacking:HackTricks Training GCP Red Team Expert (GRTE)
学习并练习 Az Hacking:HackTricks Training Azure Red Team Expert (AzRTE)
支持 HackTricks
- 查看 subscription plans!
- 加入 💬 Discord group 或者 telegram group 或 关注 我们的 Twitter 🐦 @hacktricks_live.
- 通过向 HackTricks 和 HackTricks Cloud github 仓库 提交 PRs 来分享 hacking tricks。
HackTricks Cloud

