GCP - Storage Unauthenticated Enum

Support HackTricks

Storage

Kwa maelezo zaidi kuhusu Storage angalia:

GCP - Storage Enum

Public Bucket Brute Force

muundo wa URL wa kufikia bucket ni https://storage.googleapis.com/<bucket-name>.

Zana zifuatazo zinaweza kutumika kuunda tofauti za jina lililotolewa na kutafuta buckets zisizo na usahihi kwa majina hayo:

Pia zana zilizoelezwa katika:

GCP - Unauthenticated Enum & Access

Ikiwa unapata kwamba unaweza kufikia bucket unaweza kuwa na uwezo wa kuinua hata zaidi, angalia:

GCP - Public Buckets Privilege Escalation

Search Open Buckets in Current Account

Kwa script ifuatayo iliyokusanywa kutoka hapa unaweza kupata buckets zote zilizo wazi:

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

Last updated