GCP Pentesting
Google Cloud Platform (GCP) assessments focus on IAM service accounts, Cloud Storage buckets, Compute Engine instances, and Cloud Functions.
Initial Access & Enumeration
GCloud CLI authentication.
gcloud auth login
gcloud auth activate-service-account --key-file=key.jsonCurrent configuration.
gcloud config list
gcloud auth listProject enumeration.
gcloud projects list
gcloud config set project PROJECT_IDIAM enumeration.
gcloud iam service-accounts list
gcloud projects get-iam-policy PROJECT_IDCompute instances.
gcloud compute instances list
gcloud compute instances describe INSTANCE_NAME --zone=ZONEStorage buckets.
gsutil ls
gsutil ls gs://bucket-name/
gsutil cat gs://bucket-name/file.txtCheck public buckets.
curl https://storage.googleapis.com/bucket-name/Cloud Functions.
gcloud functions list
gcloud functions describe FUNCTION_NAMESecrets.
gcloud secrets list
gcloud secrets versions access latest --secret="secret-name"GCP Metadata Service.
curl -H "Metadata-Flavor: Google" http://169.254.169.254/computeMetadata/v1/
curl -H "Metadata-Flavor: Google" http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/tokenGCP Tools
GCPBucketBrute
EnumerationA script to enumerate Google Storage buckets, determine what access you have to them, and determine if they can be privilege escalated.
Installation
python3 gcpbucketbrute.pygcp_enum
EnumerationBash script to enumerate GCP resources and export results.
Installation
./gcp_enum.shHayat
ExploitationA tool for identifying privilege escalation paths in GCP IAM.
Installation
go install github.com/DenizParlak/Hayat@latestgcloud CLI
ClientThe official command-line tool for Google Cloud. Essential for manual testing.
Installation
brew install --cask google-cloud-sdk