GCP - Storage Unauthenticated Enum

Reading time: 3 minutes

tip

Učite i vežbajte AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Učite i vežbajte GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE) Učite i vežbajte Azure Hacking: HackTricks Training Azure Red Team Expert (AzRTE)

Podržite HackTricks

Storage

Za više informacija o Storage, proverite:

GCP - Storage Enum

Public Bucket Brute Force

Format URL-a za pristup bucket-u je https://storage.googleapis.com/<bucket-name>.

Sledeći alati se mogu koristiti za generisanje varijacija imena i pretragu za pogrešno konfigurisanim bucket-ima sa tim imenima:

Takođe alati pomenuti u:

GCP - Unauthenticated Enum & Access

Ako otkrijete da možete pristupiti bucket-u, možda ćete moći da escalate još dalje, proverite:

GCP - Public Buckets Privilege Escalation

Search Open Buckets in Current Account

Sa sledećim skriptom prikupljenim odavde možete pronaći sve otvorene bucket-e:

bash
#!/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

tip

Učite i vežbajte AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Učite i vežbajte GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE) Učite i vežbajte Azure Hacking: HackTricks Training Azure Red Team Expert (AzRTE)

Podržite HackTricks