GCP - Storage Unauthenticated Enum

Soutenez HackTricks

Stockage

Pour plus d'informations sur le Stockage, consultez :

GCP - Storage Enum

Brute Force de Bucket Public

Le format d'une URL pour accéder à un bucket est https://storage.googleapis.com/<nom-du-bucket>.

Les outils suivants peuvent être utilisés pour générer des variations du nom donné et rechercher des buckets mal configurés avec ces noms :

Également les outils mentionnés dans :

GCP - Unauthenticated Enum & Access

Si vous constatez que vous pouvez accéder à un bucket, vous pourriez être en mesure de escalader encore plus, vérifiez :

GCP - Public Buckets Privilege Escalation

Rechercher des Buckets Ouverts dans le Compte Actuel

Avec le script suivant rassemblé à partir d'ici, vous pouvez trouver tous les buckets ouverts :

#!/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
Soutenez HackTricks

Last updated