GCP - Storage Unauthenticated Enum

Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)!

Other ways to support HackTricks:

Storage

For more information about Storage check:

pageGCP - Storage Enum

Public Bucket Brute Force

The format of an URL to access a bucket is https://storage.googleapis.com/<bucket-name>.

The following tools can be used to generate variations of the name given and search for miss-configured buckets with that names:

Also the tools mentioned in:

pageGCP - Unauthenticated Enum & Access

If you find that you can access a bucket you might be able to escalate even further, check:

pageGCP - Public Buckets Privilege Escalation

Search Open Buckets in Current Account

With the following script gathered from here you can find all the open buckets:

#!/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
Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)!

Other ways to support HackTricks:

Last updated