GCP - Cloud Functions Unauthenticated Enum
Tip
Ucz się & ćwicz AWS Hacking:
HackTricks Training AWS Red Team Expert (ARTE)
Ucz się & ćwicz GCP Hacking:HackTricks Training GCP Red Team Expert (GRTE)
Ucz się & ćwicz Az Hacking:HackTricks Training Azure Red Team Expert (AzRTE)
Wspieraj HackTricks
- Sprawdź subscription plans!
- Dołącz do 💬 Discord group lub telegram group lub śledź nas na Twitterze 🐦 @hacktricks_live.
- Podziel się hacking tricks, zgłaszając PRy do HackTricks i HackTricks Cloud github repos.
Cloud Functions
Więcej informacji na temat Cloud Functions można znaleźć w:
Brute Force URls
Brute Force formatu URL:
https://<region>-<project-gcp-name>.cloudfunctions.net/<func_name>
Łatwiej jest, jeśli znasz nazwy projektów.
Sprawdź tę stronę, aby uzyskać narzędzia do przeprowadzenia tego brute force:
GCP - Unauthenticated Enum & Access
Enumerate Open Cloud Functions
Za pomocą poniższego kodu wziętego stąd możesz znaleźć Cloud Functions, które pozwalają na nieautoryzowane wywołania.
#!/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
Tip
Ucz się & ćwicz AWS Hacking:
HackTricks Training AWS Red Team Expert (ARTE)
Ucz się & ćwicz GCP Hacking:HackTricks Training GCP Red Team Expert (GRTE)
Ucz się & ćwicz Az Hacking:HackTricks Training Azure Red Team Expert (AzRTE)
Wspieraj HackTricks
- Sprawdź subscription plans!
- Dołącz do 💬 Discord group lub telegram group lub śledź nas na Twitterze 🐦 @hacktricks_live.
- Podziel się hacking tricks, zgłaszając PRy do HackTricks i HackTricks Cloud github repos.
HackTricks Cloud

