GCP - Storage Post Exploitation

Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE) Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)

Support HackTricks

Cloud Storage

Per ulteriori informazioni su Cloud Storage, controlla questa pagina:

GCP - Storage Enum

Dare Accesso Pubblico

È possibile dare agli utenti esterni (connessi a GCP o meno) accesso al contenuto dei bucket. Tuttavia, per impostazione predefinita, il bucket avrà disabilitata l'opzione per esporre pubblicamente un bucket:

# 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

Se provi a dare ACL a un bucket con ACL disabilitati troverai questo errore: 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

Per accedere a bucket aperti tramite browser, accedi all'URL https://<bucket_name>.storage.googleapis.com/ o https://<bucket_name>.storage.googleapis.com/<object_name>

Impara e pratica AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE) Impara e pratica GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)

Supporta HackTricks

Last updated