Az - PostgreSQL Post Exploitation

Reading time: 5 minutes

tip

Impara e pratica il hacking AWS:HackTricks Training AWS Red Team Expert (ARTE)
Impara e pratica il hacking GCP: HackTricks Training GCP Red Team Expert (GRTE) Impara e pratica il hacking Azure: HackTricks Training Azure Red Team Expert (AzRTE)

Supporta HackTricks

PostgreSQL Database Post Exploitation

Per ulteriori informazioni su PostgreSQL Database controlla:

Az - PostgreSQL

Microsoft.DBforPostgreSQL/flexibleServers/databases/write && Microsoft.DBforPostgreSQL/flexibleServers/databases/read

Con questo permesso, puoi creare nuovi database all'interno di un'istanza di Postgres Flexible Server su Azure. Anche se questa azione di per sé non modifica le risorse esistenti, la creazione eccessiva o non autorizzata di database potrebbe portare a un consumo di risorse o a un potenziale uso improprio del server.

bash
az postgres flexible-server db create \
--server-name <server_name> \
--resource-group <resource_group_name> \
--database-name <database_name>

Microsoft.DBforPostgreSQL/flexibleServers/backups/write

Con questo permesso, puoi avviare la creazione di backup per un'istanza di Postgres Flexible Server su Azure. Questo consente agli utenti di generare backup su richiesta, che possono essere utili per preservare i dati in momenti specifici.

bash
az postgres flexible-server backup create \
--name <server_name> \
--resource-group <resource_group_name>
--backup-name <backup_name>

Microsoft.DBforPostgreSQL/flexibleServers/advancedThreatProtectionSettings/write && Microsoft.DBforPostgreSQL/flexibleServers/advancedThreatProtectionSettings/read

Con questo permesso, puoi configurare o aggiornare le impostazioni di Advanced Threat Protection (ATP) per un'istanza di Postgres Flexible Server su Azure. Questo consente di abilitare o disabilitare le funzionalità di sicurezza progettate per rilevare e rispondere ad attività anomale e potenziali minacce.

bash
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

Con questo permesso, puoi creare o modificare le regole del firewall per un'istanza di Postgres Flexible Server su Azure. Questo consente di controllare quali indirizzi IP o intervalli possono accedere al server. L'uso non autorizzato o improprio di questo permesso potrebbe esporre il server a accessi indesiderati o malevoli.

bash
# 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

Con questo permesso, puoi aggiornare le impostazioni di configurazione di un'istanza di Postgres Flexible Server su Azure. Questo consente la personalizzazione dei parametri del server come l'ottimizzazione delle prestazioni, le configurazioni di sicurezza o le impostazioni operative.

bash
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

Con questo permesso, puoi fermare un'istanza di PostgreSQL Flexible Server su Azure. Fermare un server può portare a un'interruzione temporanea del servizio, influenzando le applicazioni e gli utenti dipendenti dal database.

bash
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.

bash
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.

bash
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

Impara e pratica il hacking AWS:HackTricks Training AWS Red Team Expert (ARTE)
Impara e pratica il hacking GCP: HackTricks Training GCP Red Team Expert (GRTE) Impara e pratica il hacking Azure: HackTricks Training Azure Red Team Expert (AzRTE)

Supporta HackTricks