GCP - Storage Post Exploitation

HackTricksのサポート

クラウドストレージ

CLoud Storageの詳細については、このページを参照してください:

GCP - Storage Enum

パブリックアクセスの付与

外部ユーザー(GCPにログインしているかどうかに関わらず)にバケットのコンテンツへのアクセスを許可することが可能です。ただし、デフォルトではバケットは公開オプションを無効にしています:

# 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

もし無効なACLを持つバケットにACLを設定しようとすると、次のエラーが表示されます: 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

ブラウザを介してオープンなバケットにアクセスするには、次のURLにアクセスしてください: https://<bucket_name>.storage.googleapis.com/ または https://<bucket_name>.storage.googleapis.com/<object_name>

Last updated