performing-gcp-penetration-testing-with-gcpbucketbrute skill (Anthropic-Cybersecurity-Skills)

From Public Agent Wiki

What it does. Performs authorized GCP security testing using GCPBucketBrute to enumerate Part of mukul975/Anthropic-Cybersecurity-Skills (817 security skills) (mukul975/Anthropic-Cybersecurity-Skills).

Upstream mukul975/Anthropic-Cybersecurity-Skills
Skill file skills/performing-gcp-penetration-testing-with-gcpbucketbrute/SKILL.md
License Apache-2.0 (skill folder LICENSE)
Author mukul975
Fetched 2026-09-10

Install

  • npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill performing-gcp-penetration-testing-with-gcpbucketbrute, or copy the skill folder into ~/.claude/skills/performing-gcp-penetration-testing-with-gcpbucketbrute/.
  • Raw file: curl -sL https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/HEAD/skills/performing-gcp-penetration-testing-with-gcpbucketbrute/SKILL.md

SKILL.md (verbatim)

name: performing-gcp-penetration-testing-with-gcpbucketbrute
description: Performs authorized GCP security testing using GCPBucketBrute to enumerate
  publicly accessible storage buckets, combined with gcloud CLI IAM enumeration to
  find privilege escalation paths and audit service account permissions. Use when
  penetration testing a GCP project for exposed buckets, overly permissive IAM bindings,
  or service account key exposure.
domain: cybersecurity
subdomain: cloud-security
tags:
- gcp
- cloud-pentesting
- bucket-enumeration
- iam-audit
- privilege-escalation
- gcpbucketbrute
version: '1.0'
author: mahipal
license: Apache-2.0
nist_ai_rmf:
- MEASURE-2.7
- MAP-5.1
- MANAGE-2.4
atlas_techniques:
- AML.T0070
- AML.T0066
- AML.T0082
nist_csf:
- PR.IR-01
- ID.AM-08
- GV.SC-06
- DE.CM-01
mitre_attack:
- T1078.004
- T1530
- T1537
- T1580
- T1068

Performing GCP Penetration Testing with GCPBucketBrute

Overview

This skill covers Google Cloud Platform security testing using GCPBucketBrute for storage bucket enumeration and access permission testing, combined with gcloud CLI IAM enumeration to identify privilege escalation paths. The approach tests for publicly accessible buckets, overly permissive IAM bindings, and service account key exposure.

When to Use

  • When conducting security assessments that involve performing gcp penetration testing with gcpbucketbrute
  • When following incident response procedures for related security events
  • When performing scheduled security testing or auditing activities
  • When validating security controls through hands-on testing

Prerequisites

  • Python 3.8+ with google-cloud-storage library
  • GCPBucketBrute installed from RhinoSecurityLabs GitHub
  • gcloud CLI authenticated with test credentials
  • Authorized penetration testing scope for target GCP project
  • google-api-python-client and google-auth libraries

Steps

  1. Enumerate Storage Buckets — Use GCPBucketBrute with keyword permutations to discover accessible GCP storage buckets
  2. Test Bucket Permissions — Call TestIamPermissions API on each discovered bucket to determine read/write/admin access levels
  3. Audit IAM Bindings — Enumerate project-level IAM policies to identify overly permissive role bindings
  4. Check Service Account Keys — Identify service accounts with user-managed keys and test for privilege escalation via impersonation
  5. Test Privilege Escalation Paths — Check for iam.serviceAccounts.actAs, setIamPolicy, and other privilege escalation vectors
  6. Generate Findings Report — Produce a structured security assessment with risk severity ratings

Expected Output

  • JSON report of discovered buckets with permission levels
  • IAM privilege escalation path analysis
  • Service account security assessment
  • Risk-scored findings with remediation recommendations

Other files in this skill

references/api-reference.md (verbatim)

GCP Penetration Testing API Reference

GCPBucketBrute — Bucket Enumeration

# Install
git clone https://github.com/RhinoSecurityLabs/GCPBucketBrute.git
cd GCPBucketBrute
pip install -r requirements.txt

# Unauthenticated scan
python3 gcpbucketbrute.py -k company-name -u

# Authenticated with service account
python3 gcpbucketbrute.py -k company-name -f /path/to/service-account-key.json

# Authenticated with user account (uses default gcloud credentials)
python3 gcpbucketbrute.py -k company-name

# Custom subprocesses for speed
python3 gcpbucketbrute.py -k company-name -s 10

Output columns: Bucket name | Exists | Public | Authenticated Access | Permissions

gcloud IAM Enumeration

# List all IAM bindings for a project
gcloud projects get-iam-policy PROJECT_ID --format=json

# List service accounts
gcloud iam service-accounts list --project PROJECT_ID --format=json

# List user-managed keys for a service account
gcloud iam service-accounts keys list \
  --iam-account SA_EMAIL --managed-by=user --format=json

# Describe a role to see its permissions
gcloud iam roles describe roles/editor --format=json

# Test IAM permissions on a resource
gcloud asset search-all-iam-policies --scope=projects/PROJECT_ID \
  --query="policy:allUsers OR policy:allAuthenticatedUsers"

gsutil Bucket Permission Testing

# Check if bucket is listable
gsutil ls gs://target-bucket/

# Check bucket IAM policy
gcloud storage buckets get-iam-policy gs://target-bucket --format=json

# Test specific permissions
gsutil acl get gs://target-bucket/

Privilege Escalation Permissions

Dangerous IAM permissions that enable privilege escalation:

Permission Risk
iam.serviceAccounts.actAs Impersonate any SA
iam.serviceAccountKeys.create Create keys for any SA
resourcemanager.projects.setIamPolicy Grant yourself any role
deploymentmanager.deployments.create Deploy as project SA
cloudfunctions.functions.create Execute as function SA
compute.instances.create Launch VM as any SA

Google Cloud Storage Python Client

from google.cloud import storage

client = storage.Client()
bucket = client.bucket("target-bucket")
# Test permissions via testIamPermissions
permissions = bucket.test_iam_permissions(["storage.objects.list", "storage.objects.get"])

Back to mukul975/Anthropic-Cybersecurity-Skills (817 security skills) or Agent skills.