GCP - Cloud Functions Unauthenticated Enum
Reading time: 3 minutes
tip
Impara e pratica il hacking AWS:HackTricks Training AWS Red Team Expert (ARTE)
Impara e pratica il hacking GCP: HackTricks Training GCP Red Team Expert (GRTE)
Impara e pratica il hacking Azure:
HackTricks Training Azure Red Team Expert (AzRTE)
Supporta HackTricks
- Controlla i piani di abbonamento!
- Unisciti al 💬 gruppo Discord o al gruppo telegram o seguici su Twitter 🐦 @hacktricks_live.
- Condividi trucchi di hacking inviando PR ai HackTricks e HackTricks Cloud repos su github.
Cloud Functions
Maggiore informazione sulle Cloud Functions può essere trovata in:
Brute Force URls
Brute Force il formato dell'URL:
https://<region>-<project-gcp-name>.cloudfunctions.net/<func_name>
È più facile se conosci i nomi dei progetti.
Controlla questa pagina per alcuni strumenti per eseguire questo brute force:
GCP - Unauthenticated Enum & Access
Enumerare le Cloud Functions Aperte
Con il seguente codice preso da qui puoi trovare le Cloud Functions che permettono invocazioni non autenticate.
#!/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
Impara e pratica il hacking AWS:HackTricks Training AWS Red Team Expert (ARTE)
Impara e pratica il hacking GCP: HackTricks Training GCP Red Team Expert (GRTE)
Impara e pratica il hacking Azure:
HackTricks Training Azure Red Team Expert (AzRTE)
Supporta HackTricks
- Controlla i piani di abbonamento!
- Unisciti al 💬 gruppo Discord o al gruppo telegram o seguici su Twitter 🐦 @hacktricks_live.
- Condividi trucchi di hacking inviando PR ai HackTricks e HackTricks Cloud repos su github.