GCP - Storage Unauthenticated Enum

Supporta HackTricks

Storage

Per ulteriori informazioni su Storage controlla:

GCP - Storage Enum

Forza Bruta su Bucket Pubblici

Il formato di un URL per accedere a un bucket è https://storage.googleapis.com/<nome-bucket>.

Gli strumenti seguenti possono essere utilizzati per generare variazioni del nome fornito e cercare bucket mal configurati con quei nomi:

Anche gli strumenti menzionati in:

GCP - Unauthenticated Enum & Access

Se scopri che puoi accedere a un bucket potresti essere in grado di scalare ulteriormente, controlla:

GCP - Public Buckets Privilege Escalation

Cerca Bucket Aperti nel Conto Corrente

Con lo script seguente raccolto da qui puoi trovare tutti i bucket aperti:

#!/bin/bash

############################
# Run this tool to find buckets that are open to the public anywhere
# in your GCP organization.
#
# Enjoy!
############################

for proj in $(gcloud projects list --format="get(projectId)"); do
echo "[*] scraping project $proj"
for bucket in $(gsutil ls -p $proj); do
echo "    $bucket"
ACL="$(gsutil iam get $bucket)"

all_users="$(echo $ACL | grep allUsers)"
all_auth="$(echo $ACL | grep allAuthenticatedUsers)"

if [ -z "$all_users" ]
then
:
else
echo "[!] Open to all users: $bucket"
fi

if [ -z "$all_auth" ]
then
:
else
echo "[!] Open to all authenticated users: $bucket"
fi
done
done
Sostieni HackTricks

Last updated