GCP - Cloud Functions Unauthenticated Enum

Erfahren Sie AWS-Hacking von Null auf Held mit htARTE (HackTricks AWS Red Team Expert)!

Andere Möglichkeiten, HackTricks zu unterstützen:

Cloud Functions

Weitere Informationen zu Cloud Functions finden Sie unter:

pageGCP - Cloud Functions Enum

Brute Force-URLs

Brute-Force des URL-Formats:

  • https://<region>-<project-gcp-name>.cloudfunctions.net/<func_name>

Es ist einfacher, wenn Sie die Projektnamen kennen.

Überprüfen Sie diese Seite auf einige Tools, um dieses Brute-Force durchzuführen:

pageGCP - Unauthenticated Enum & Access

Offene Cloud Functions auflisten

Mit dem folgenden Code von hier übernommen können Sie Cloud Functions finden, die unauthentifizierte Aufrufe zulassen.

#!/bin/bash

############################
# Run this tool to find Cloud Functions that permit unauthenticated invocations
# anywhere in your GCP organization.
# Enjoy!
############################

for proj in $(gcloud projects list --format="get(projectId)"); do
echo "[*] scraping project $proj"

enabled=$(gcloud services list --project "$proj" | grep "Cloud Functions API")

if [ -z "$enabled" ]; then
continue
fi


for func_region in $(gcloud functions list --quiet --project "$proj" --format="value[separator=','](NAME,REGION)"); do
# drop substring from first occurence of "," to end of string.
func="${func_region%%,*}"
# drop substring from start of string up to last occurence of ","
region="${func_region##*,}"
ACL="$(gcloud functions get-iam-policy "$func" --project "$proj" --region "$region")"

all_users="$(echo "$ACL" | grep allUsers)"
all_auth="$(echo "$ACL" | grep allAuthenticatedUsers)"

if [ -z "$all_users" ]
then
:
else
echo "[!] Open to all users: $proj: $func"
fi

if [ -z "$all_auth" ]
then
:
else
echo "[!] Open to all authenticated users: $proj: $func"
fi
done
done
Erlernen Sie AWS-Hacking von Null auf Held mit htARTE (HackTricks AWS Red Team Expert)!

Andere Möglichkeiten, HackTricks zu unterstützen:

Last updated