GCP - Storage Post Exploitation

Support HackTricks

Cloud Storage

Cloud Storage에 대한 자세한 정보는 이 페이지를 확인하세요:

Give Public Access

외부 사용자(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>에 접근하세요.

HackTricks 지원하기

Last updated