GCP - Storage Unauthenticated Enum

Support HackTricks

Storage

Pour plus d'informations sur le stockage, consultez :

GCP - Storage Enum

Public Bucket Brute Force

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

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 :

Aussi 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 faire une escalade encore plus loin, consultez :

GCP - Public Buckets Privilege Escalation

Search Open Buckets in Current Account

Avec le script suivant rassemblé 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
Soutenir HackTricks

Last updated