GCP - Storage Unauthenticated Enum

Support HackTricks

Storage

Per ulteriori informazioni su Storage controlla:

GCP - Storage Enum

Public Bucket Brute Force

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

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

Inoltre, gli strumenti menzionati in:

Se scopri di poter accedere a un bucket potresti essere in grado di escalare ulteriormente, controlla:

Search Open Buckets in Current Account

Con il seguente script 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
Supporta HackTricks

Last updated