You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Open Cloud Shell and ensure that the current project is the new created one.
Download Terraform script and setup a vulnerable to SSRF Cloud Function:
git clone https://github.com/Horlad/signBlob_PrivEsc_PoC.git
cd signBlob_PrivEsc_PoC/terraform
terraform init -upgrade
terraform apply
Exploitation
In Terraform output you can locate a URL to the vulnerable Cloud Function. Exploit SSRF to obtain a temporary token of an attached service account which use iam.serviceAccounts.signBlob permission to sign URLs.
The Terraform output you can also find App Engine and Compute Engine default service accounts which were created automatically during the Cloud Function creation without explicit instructions. You can use them to escalate to Editor role via the Rhinosecurity exploit.
To ensure that you obtained the priviliged service account, generate new service account key via next gcloud command:
gcloud iam service-accounts keys create service_account_key.json \
--iam-account=[DEFAULT_SERVICE_ACCOUNT_EMAIL] --access-token-file=[FILE_WITH_TOKEN]