Az - PostgreSQL Post Exploitation
Tip
Ucz się & ćwicz AWS Hacking:
HackTricks Training AWS Red Team Expert (ARTE)
Ucz się & ćwicz GCP Hacking:HackTricks Training GCP Red Team Expert (GRTE)
Ucz się & ćwicz Az Hacking:HackTricks Training Azure Red Team Expert (AzRTE)
Wspieraj HackTricks
- Sprawdź subscription plans!
- Dołącz do 💬 Discord group lub telegram group lub śledź nas na Twitterze 🐦 @hacktricks_live.
- Podziel się hacking tricks, zgłaszając PRy do HackTricks i HackTricks Cloud github repos.
PostgreSQL Database Post Exploitation
Aby uzyskać więcej informacji na temat bazy danych PostgreSQL, sprawdź:
Użyj rozszerzenia pg_azure_storage, aby uzyskać dostęp do kont Storage
Możliwe jest użycie rozszerzenia pg_azure_storage do uzyskania dostępu do kont Azure Storage z serwera PostgreSQL. Będzie to wykorzystywać uprawnienia zarządzanej tożsamości przypisanej do serwera, aby uzyskać dostęp do konta storage.
Aby uzyskać więcej informacji, sprawdź tę technikę opisaną w sekcji eskalacji uprawnień:
Microsoft.DBforPostgreSQL/flexibleServers/databases/write && Microsoft.DBforPostgreSQL/flexibleServers/databases/read
Dzięki temu uprawnieniu możesz tworzyć nowe bazy danych w instancji Postgres Flexible Server na Azure. Chociaż sama ta akcja nie modyfikuje istniejących zasobów, nadmierne lub nieautoryzowane tworzenie baz danych może prowadzić do zużycia zasobów lub potencjalnego nadużycia serwera.
az postgres flexible-server db create \
--server-name <server_name> \
--resource-group <resource_group_name> \
--database-name <database_name>
Microsoft.DBforPostgreSQL/flexibleServers/advancedThreatProtectionSettings/write && Microsoft.DBforPostgreSQL/flexibleServers/advancedThreatProtectionSettings/read
Dzięki temu uprawnieniu możesz skonfigurować lub zaktualizować ustawienia Advanced Threat Protection (ATP) dla instancji Postgres Flexible Server w Azure. Umożliwia to włączanie lub wyłączanie funkcji zabezpieczeń zaprojektowanych w celu wykrywania i reagowania na anomalne działania oraz potencjalne zagrożenia.
az postgres flexible-server threat-protection-policy update \
--name <server_name> \
--resource-group <resource_group_name> \
--state <Enabled|Disabled>
Microsoft.DBforPostgreSQL/flexibleServers/firewallRules/write, Microsoft.DBforPostgreSQL/flexibleServers/read && Microsoft.DBforPostgreSQL/flexibleServers/firewallRules/read
Dzięki temu uprawnieniu możesz tworzyć lub modyfikować reguły zapory dla instancji Postgres Flexible Server na Azure. Umożliwia to kontrolowanie, które adresy IP lub zakresy mogą uzyskać dostęp do serwera. Nieautoryzowane lub niewłaściwe użycie tego uprawnienia może narazić serwer na niepożądany lub złośliwy dostęp.
# Create Rule
az postgres flexible-server firewall-rule create \
--name <server_name> \
--resource-group <resource_group_name> \
--rule-name <rule_name> \
--start-ip-address <start_ip> \
--end-ip-address <end_ip>
# Update Rule
az postgres flexible-server firewall-rule update \
--name <server_name> \
--resource-group <resource_group_name> \
--rule-name <rule_name> \
--start-ip-address <start_ip> \
--end-ip-address <end_ip>
Microsoft.DBforPostgreSQL/flexibleServers/configurations/write && Microsoft.DBforPostgreSQL/flexibleServers/configurations/read
Dzięki temu uprawnieniu możesz zaktualizować ustawienia konfiguracyjne instancji Postgres Flexible Server na Azure. Umożliwia to dostosowanie parametrów serwera, takich jak optymalizacja wydajności, konfiguracje zabezpieczeń lub ustawienia operacyjne.
az postgres flexible-server parameter set \
--resource-group <resource_group_name> \
--server-name <server_name> \
--name <parameter_name> \
--value <parameter_value>
Microsoft.DBforPostgreSQL/flexibleServers/stop/action
Dzięki temu uprawnieniu możesz zatrzymać instancję PostgreSQL Flexible Server na Azure. Zatrzymanie serwera może prowadzić do tymczasowych zakłóceń w działaniu usług, wpływając na aplikacje i użytkowników zależnych od bazy danych.
az postgres flexible-server stop \
--name <server_name> \
--resource-group <resource_group_name>
Microsoft.DBforPostgreSQL/flexibleServers/start/action
With this permission, you can start a stopped PostgreSQL Flexible Server instance on Azure. Starting a server restores its availability, enabling applications and users to reconnect and access the database.
az postgres flexible-server start \
--name <server_name> \
--resource-group <resource_group_name>
Microsoft.DBforPostgreSQL/flexibleServers/read, Microsoft.DBforPostgreSQL/flexibleServers/write && Microsoft.ManagedIdentity/userAssignedIdentities/assign/action
With this permission, you can assign a user-assigned managed identity to postgres flexible servers.
az postgres flexible-server identity assign \
--resource-group <ResourceGroupName> \
--server-name <ServerName> \
--identity <IdentityName>
*/delete
With this permissions you can delete resources related to postgres server in Azure such as server, firewalls, managed identities or configurations
Tip
Ucz się & ćwicz AWS Hacking:
HackTricks Training AWS Red Team Expert (ARTE)
Ucz się & ćwicz GCP Hacking:HackTricks Training GCP Red Team Expert (GRTE)
Ucz się & ćwicz Az Hacking:HackTricks Training Azure Red Team Expert (AzRTE)
Wspieraj HackTricks
- Sprawdź subscription plans!
- Dołącz do 💬 Discord group lub telegram group lub śledź nas na Twitterze 🐦 @hacktricks_live.
- Podziel się hacking tricks, zgłaszając PRy do HackTricks i HackTricks Cloud github repos.
HackTricks Cloud

