Files
hacktricks-cloud/pentesting-cloud/azure-security/az-services/az-acr.md
2024-12-12 19:35:48 +01:00

3.9 KiB

Az - ACR

{% hint style="success" %} Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)

Support HackTricks
{% endhint %}

Basic Information

Azure Container Registry (ACR) is a managed service provided by Microsoft Azure for storing and managing Docker container images and other artifacts. It offers features such as integrated developer tools, geo-replication, security measures like role-based access control and image scanning, automated builds, webhooks and triggers, and network isolation. It works with popular tools like Docker CLI and Kubernetes, and integrates well with other Azure services.

Enumerate

To enumerate the service you could use the script Get-AzACR.ps1:

{% code overflow="wrap" %}

# List Docker images inside the registry
IEX (New-Object Net.Webclient).downloadstring("https://raw.githubusercontent.com/NetSPI/MicroBurst/master/Misc/Get-AzACR.ps1")

Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Internet Explorer\Main" -Name "DisableFirstRunCustomize" -Value 2

Get-AzACR -username <username> -password <password> -registry <corp-name>.azurecr.io

{% endcode %}

{% tabs %} {% tab title="az cli" %}

az acr list --output table
az acr show --name MyRegistry --resource-group MyResourceGroup

{% endtab %}

{% tab title="Az Powershell" %}

# List all ACRs in your subscription
Get-AzContainerRegistry

# Get a specific ACR
Get-AzContainerRegistry -ResourceGroupName "MyResourceGroup" -Name "MyRegistry"

{% endtab %} {% endtabs %}

Login & Pull from the registry

docker login <corp-name>.azurecr.io --username <username> --password <password>
docker pull <corp-name>.azurecr.io/<image>:<tag>

{% hint style="success" %} Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)

Support HackTricks
{% endhint %}