Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -557,22 +557,41 @@
- [Az - Azure IAM Privesc (Authorization)](pentesting-cloud/azure-security/az-privilege-escalation/az-authorization-privesc.md)
- [Az - AI Foundry Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-ai-foundry-privesc.md)
- [Az - API Management Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-api-management-privesc.md)
- [Az - App Configuration Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-app-configuration-privesc.md)
- [Az - App Services Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-app-services-privesc.md)
- [Az - ARM Deployment Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-arm-deployment-privesc.md)
- [Az - Automation Accounts Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-automation-accounts-privesc.md)
- [Az - Batch Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-batch-privesc.md)
- [Az - Bot Service Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-bot-service-privesc.md)
- [Az - Communication Services Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-communication-services-privesc.md)
- [Az - Container Registry Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-container-registry-privesc.md)
- [Az - Container Instances, Apps & Jobs Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-container-instances-apps-jobs-privesc.md)
- [Az - CosmosDB Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-cosmosDB-privesc.md)
- [Az - Data Factory Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-data-factory-privesc.md)
- [Az - EntraID Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-entraid-privesc/README.md)
- [Az - Conditional Access Policies & MFA Bypass](pentesting-cloud/azure-security/az-privilege-escalation/az-entraid-privesc/az-conditional-access-policies-mfa-bypass.md)
- [Az - Dynamic Groups Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-entraid-privesc/dynamic-groups.md)
- [Az - Event Hubs Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-event-hubs-privesc.md)
- [Az - Event Grid Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-event-grid-privesc.md)
- [Az - Fluid Relay Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-fluid-relay-privesc.md)
- [Az - Functions App Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-functions-app-privesc.md)
- [Az - IoT Hub Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-iot-hub-privesc.md)
- [Az - Key Vault Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-key-vault-privesc.md)
- [Az - Kubernetes Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-kubernetes-privesc.md)
- [Az - Log Analytics Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-log-analytics-privesc.md)
- [Az - Logic Apps Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-logic-apps-privesc.md)
- [Az - Maps Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-maps-privesc.md)
- [Az - Azure Monitor Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-monitor-privesc.md)
- [Az - MySQL Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-mysql-privesc.md)
- [Az - Notification Hubs Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-notification-hubs-privesc.md)
- [Az - PostgreSQL Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-postgresql-privesc.md)
- [Az - Purview Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-purview-privesc.md)
- [Az - Queue Storage Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-queue-privesc.md)
- [Az - Quantum Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-quantum-privesc.md)
- [Az - Azure Cache for Redis Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-redis-privesc.md)
- [Az - Azure Relay Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-relay-privesc.md)
- [Az - Service Bus Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-servicebus-privesc.md)
- [Az - SignalR and Web PubSub Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-signalr-web-pubsub-privesc.md)
- [Az - Static Web App Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-static-web-apps-privesc.md)
- [Az - Storage Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-storage-privesc.md)
- [Az - SQL Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-sql-privesc.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,41 @@ az rest --method POST \
--url "https://management.azure.com/subscriptions/<SUB>/resourceGroups/<RG>/providers/Microsoft.MachineLearningServices/workspaces/<WS>/connections/<CONNECTION>/listSecrets?api-version=2025-12-01"
```

In live validation, a workspace connection returned a Cognitive Services key that successfully called the connected Language endpoint. A datastore using an account key returned that key, which downloaded the exact seeded blob. If connection or datastore listing is denied, names recovered from job YAML, pipeline definitions, notebooks, source repositories, deployment outputs, or error messages can be used directly with the object-specific `listsecrets` endpoint.

## `Microsoft.MachineLearningServices/workspaces/listKeys/action` and `Microsoft.MachineLearningServices/workspaces/listStorageAccountKeys/action`

Both workspace-level operations exposed the key of the workspace's linked Storage account in a live test, and that key downloaded an otherwise protected canary blob. `listKeys` can additionally return linked Application Insights and Container Registry credentials when those resources are present, while `listStorageAccountKeys` is the narrower storage path.<sup>[[28]](#references)[[29]](#references)</sup>

```bash
az rest --method POST \
--url "https://management.azure.com/subscriptions/<SUB>/resourceGroups/<RG>/providers/Microsoft.MachineLearningServices/workspaces/<WS>/listKeys?api-version=2025-06-01"

az rest --method POST \
--url "https://management.azure.com/subscriptions/<SUB>/resourceGroups/<RG>/providers/Microsoft.MachineLearningServices/workspaces/<WS>/listStorageAccountKeys?api-version=2025-06-01"
```

The workspace name is often available without workspace-list permission in ML job configuration, endpoint URLs, Azure resource IDs embedded in notebooks, CI variables, or IaC. The returned Storage key is account-wide, so use the storage account endpoint from the workspace resource or known configuration and avoid printing it.

## `Microsoft.CognitiveServices/accounts/connections/listsecrets/action` and `Microsoft.CognitiveServices/accounts/projects/connections/listsecrets/action`

Foundry accounts and their projects can store reusable credentials in connection resources. Both scopes were validated separately: each returned an 84-character key stored in an `AIServices` connection, and each recovered key successfully called the connected Language service and returned the expected language result.<sup>[[13]](#references)[[30]](#references)</sup>

```bash
# Account-scoped connection
az rest --method POST \
--url "https://management.azure.com/subscriptions/<SUB>/resourceGroups/<RG>/providers/Microsoft.CognitiveServices/accounts/<ACCOUNT>/connections/<CONNECTION>/listsecrets?api-version=2025-06-01"

# Project-scoped connection
az rest --method POST \
--url "https://management.azure.com/subscriptions/<SUB>/resourceGroups/<RG>/providers/Microsoft.CognitiveServices/accounts/<ACCOUNT>/projects/<PROJECT>/connections/<CONNECTION>/listsecrets?api-version=2025-06-01"
```

The returned shape depends on the connection authentication type and may contain API keys, account keys, SAS tokens, service-principal secrets, passwords, or personal access tokens. If connection enumeration is denied, try exact names found in prompt-flow YAML, project source, deployment templates, SDK configuration, or failed-run logs. A successful response should be handled as credential material, not displayed in a general inventory.

## `Microsoft.CognitiveServices/accounts/listKeys/action` | `Microsoft.CognitiveServices/accounts/regenerateKey/action`

Having either of these permissions against an Azure OpenAI resource exposes an immediate credential or availability-impact path: `listKeys/action` returns account keys, while `regenerateKey/action` rotates one.<sup>[[13]](#references)[[14]](#references)[[15]](#references)</sup> To find candidate resources:
Having either permission against an Azure AI Services/Cognitive Services account exposes an immediate credential path: `listKeys/action` returns account keys, while `regenerateKey/action` rotates one and returns the replacement key set.<sup>[[13]](#references)[[14]](#references)[[15]](#references)</sup> The replacement key from the exact regeneration action was validated against a Free Language account and successfully completed a sentiment-analysis request (HTTP 200). To find candidate resources, including Azure OpenAI accounts:

```bash
az resource list --resource-type Microsoft.CognitiveServices/accounts \
Expand All @@ -385,8 +417,8 @@ az cognitiveservices account list --resource-group <RG> \
--query "[?kind=='OpenAI'].{name:name, location:location}" -o table
```

1. Extract the current API keys and invoke the OpenAI REST API against deployments to which the account is configured to provide access; usage and model availability still depend on the account and deployment configuration.<sup>[[13]](#references)[[14]](#references)[[17]](#references)[[18]](#references)</sup>
2. Rotate/regenerate keys to deny service to defenders or to ensure only the attacker knows the new key.<sup>[[15]](#references)[[16]](#references)</sup>
1. Extract the current API keys and invoke the account's data-plane APIs. For Azure OpenAI, usage and model availability still depend on the account and deployment configuration.<sup>[[13]](#references)[[14]](#references)[[17]](#references)[[18]](#references)</sup>
2. Rotate/regenerate a key to obtain a fresh credential and invalidate clients using the old value.<sup>[[15]](#references)[[16]](#references)</sup>

```bash
az cognitiveservices account keys list --name <AOAI> --resource-group <RG>
Expand Down Expand Up @@ -703,5 +735,8 @@ If a pipeline resolves `faq-clean@1` to the same mutable blob URI, it may ingest
- [25] [Create and manage data assets - Azure Machine Learning](https://learn.microsoft.com/en-us/azure/machine-learning/how-to-create-data-assets?view=azureml-api-2)
- [26] [Put Blob (REST API) - Azure Storage](https://learn.microsoft.com/en-us/rest/api/storageservices/put-blob)
- [27] [Quickstart: Create, download, and list blobs with Azure CLI](https://learn.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-cli)
- [28] [Workspaces - List Keys - REST API (Azure Machine Learning)](https://learn.microsoft.com/en-us/rest/api/azureml/workspaces/list-keys?view=rest-azureml-2025-12-01)
- [29] [Workspaces - List Storage Account Keys - REST API (Azure Machine Learning)](https://learn.microsoft.com/en-us/rest/api/azureml/workspaces/list-storage-account-keys?view=rest-azureml-2025-06-01)
- [30] [Microsoft.CognitiveServices accounts/connections ARM reference](https://learn.microsoft.com/en-us/azure/templates/microsoft.cognitiveservices/accounts/connections)

{{#include ../../../banners/hacktricks-training.md}}
Loading