다음 코드를 사용하여 여기에서 가져옴 미인증된 호출을 허용하는 클라우드 함수를 찾을 수 있습니다.
#!/bin/bash############################# Run this tool to find Cloud Functions that permit unauthenticated invocations# anywhere in your GCP organization.# Enjoy!############################for proj in$(gcloudprojectslist--format="get(projectId)"); doecho"[*] scraping project $proj"enabled=$(gcloudserviceslist--project "$proj" |grep "Cloud Functions API")if [ -z"$enabled" ]; thencontinuefifor func_region in$(gcloudfunctionslist--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="$(gcloudfunctionsget-iam-policy "$func" --project "$proj" --region "$region")"all_users="$(echo "$ACL" |grepallUsers)"all_auth="$(echo "$ACL" |grepallAuthenticatedUsers)"if [ -z"$all_users" ]then:elseecho"[!] Open to all users: $proj: $func"fiif [ -z"$all_auth" ]then:elseecho"[!] Open to all authenticated users: $proj: $func"fidonedone
htARTE (HackTricks AWS Red Team Expert)와 함께 AWS 해킹을 처음부터 전문가까지 배우세요!
다른 방법으로 HackTricks를 지원하는 방법:
회사를 HackTricks에서 광고하거나 HackTricks를 PDF로 다운로드하고 싶다면 구독 요금제를 확인하세요!