GCP - Storage Post Exploitation

Reading time: 3 minutes

tip

Impara e pratica il hacking AWS:HackTricks Training AWS Red Team Expert (ARTE)
Impara e pratica il hacking GCP: HackTricks Training GCP Red Team Expert (GRTE) Impara e pratica il hacking Azure: HackTricks Training Azure Red Team Expert (AzRTE)

Supporta HackTricks

Cloud Storage

Per ulteriori informazioni su Cloud Storage, controlla questa pagina:

GCP - Storage Enum

Dare Accesso Pubblico

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

bash
# 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 ai bucket aperti tramite browser, accedi all'URL https://<bucket_name>.storage.googleapis.com/ o https://<bucket_name>.storage.googleapis.com/<object_name>

tip

Impara e pratica il hacking AWS:HackTricks Training AWS Red Team Expert (ARTE)
Impara e pratica il hacking GCP: HackTricks Training GCP Red Team Expert (GRTE) Impara e pratica il hacking Azure: HackTricks Training Azure Red Team Expert (AzRTE)

Supporta HackTricks