Files
hacktricks-cloud/src/pentesting-cloud/gcp-security/gcp-post-exploitation/gcp-storage-post-exploitation.md

1.6 KiB

GCP - Storage Post Exploitation

{{#include ../../../banners/hacktricks-training.md}}

Cloud Storage

Für weitere Informationen zu Cloud Storage siehe diese Seite:

{{#ref}} ../gcp-services/gcp-storage-enum.md {{#endref}}

Öffentliches Zugriffsrecht gewähren

Es ist möglich, externen Benutzern (ob in GCP angemeldet oder nicht) Zugriff auf den Inhalt von Buckets zu gewähren. Standardmäßig ist jedoch die Option, einen Bucket öffentlich zugänglich zu machen, deaktiviert:

# 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

Wenn Sie versuchen, ACLs für einen Bucket mit deaktivierten ACLs zu vergeben, erhalten Sie diesen Fehler: 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

Um auf offene Buckets über den Browser zuzugreifen, verwenden Sie die URL https://<bucket_name>.storage.googleapis.com/ oder https://<bucket_name>.storage.googleapis.com/<object_name>

{{#include ../../../banners/hacktricks-training.md}}