GCP - Storage Post Exploitation

unga mkono HackTricks

Uhifadhi wa Buluu

Kwa habari zaidi kuhusu Uhifadhi wa Buluu angalia ukurasa huu:

GCP - Storage Enum

Toa Upatikanaji wa Umma

Inawezekana kumpa watumiaji wa nje (walioingia kwenye GCP au la) upatikanaji wa yaliyomo kwenye vijitengo. Hata hivyo, kwa chaguo-msingi, kibeti kitakuwa kimewezesha chaguo la kufunua hadharani kibeti:

# Disable public prevention
gcloud storage buckets update gs://BUCKET_NAME --no-public-access-prevention

# Make all objects in a bucket public
gcloud storage buckets add-iam-policy-binding gs://BUCKET_NAME --member=allUsers --role=roles/storage.objectViewer
## I don't think you can make specific objects public just with IAM

# Make a bucket or object public (via ACL)
gcloud storage buckets update gs://BUCKET_NAME --add-acl-grant=entity=AllUsers,role=READER
gcloud storage objects update gs://BUCKET_NAME/OBJECT_NAME --add-acl-grant=entity=AllUsers,role=READER

If you try to give ACLs to a bucket with disabled ACLs you will find this error: ERROR: HTTPError 400: Cannot use ACL API to update bucket policy when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access

To access open buckets via browser, access the URL https://<bucket_name>.storage.googleapis.com/ or https://<bucket_name>.storage.googleapis.com/<object_name>

Support HackTricks

Last updated