GCP - Storage Unauthenticated Enum

支持HackTricks

存储

有关存储的更多信息,请查看:

GCP - Storage Enum

公开存储桶暴力破解

访问存储桶的URL格式为https://storage.googleapis.com/<bucket-name>

以下工具可用于生成给定名称的变体并搜索具有该名称的配置错误的存储桶:

还可以使用以下工具:

GCP - Unauthenticated Enum & Access

如果发现可以访问存储桶,可能可以进一步升级权限,请查看:

GCP - Public Buckets Privilege Escalation

在当前账户中搜索开放存储桶

使用以下脚本从这里获取可以找到所有开放的存储桶:

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

Last updated