pentest-cloud
Skill8 starsChanged 3 months agoMITView on GitHub
Cloud security pentest — AWS/Azure/GCP IAM analysis, lateral path, container escape pattern, serverless abuse advisory. Triggers on cloud pentest, AWS, Azure, GCP, IAM, S3 misconfig, EC2 metadata, Azure AD, GCP IAM, Pacu, ScoutSuite, Prowler, CloudGoat.
In this repository63 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- ai-automationSkill
- consultingSkill
- contentSkill
- customer-successSkill
- data-analyticsSkill
- designSkill
- design-tokensSkill
- developmentSkill
- devopsSkill
- ecommerceSkill
- emailSkill
- expo-app-configSkill
- expo-config-pluginSkill
- expo-dev-clientSkill
- expo-eas-buildSkill
- expo-eas-submitSkill
- expo-eas-updateSkill
- expo-modulesSkill
- expo-notificationsSkill
- expo-orchestratorSkill
- expo-prebuildSkill
- expo-routerSkill
- expo-troubleshootingSkill
- financeSkill
- frontend-tasteSkill
- marketingSkill
- market-researchSkill
- mobileSkill
- pentest-adSkill
- pentest-apiSkill
- pentest-bizlogicSkill
- pentest-bugbountySkill
- pentest-cicdSkill
- pentest-credentialsSkill
- pentest-ctfSkill
- pentest-detectionSkill
- pentest-engagementSkill
- pentest-exploit-chainSkill
- pentest-forensicsSkill
- pentest-llmSkill
- pentest-malwareSkill
- pentest-mobileSkill
- pentest-opsec-evidenceSkill
- pentest-orchestratorSkill
- pentest-privescSkill
- pentest-reconSkill
- pentest-reportSkill
- pentest-socialSkill
- pentest-stigSkill
- pentest-threat-modelSkill
- pentest-webSkill
- pentest-wirelessSkill
- productivitySkill
- productSkill
- salesSkill
- security-checkSkill
- securitySkill
- seo-crawl-budgetSkill
- seoSkill
- The first 60 shown.
The file
Files
pentest-cloud
AWS / Azure / GCP pentest methodology. IAM lateral path, public asset enum, container escape pattern.
Triggers
- "AWS pentest"
- "Azure AD test"
- "GCP IAM enum"
- "S3 public bucket"
- "EC2 metadata abuse"
- "IMDSv2 bypass"
- "Pacu / ScoutSuite / Prowler usage"
Cloud-Provider Specific
AWS
| Attack Surface | Test |
| S3 public read/write | aws s3 ls s3://<bucket> --no-sign-request |
| EC2 IMDSv1 | curl http://169.254.169.254/latest/meta-data/iam/security-credentials/ |
| Lambda env leak | Lambda invoke + env var dump |
| IAM privilege esc | iam:CreateAccessKey, iam:AttachUserPolicy, sts:AssumeRole |
| CloudTrail bypass | sts:GetSessionToken (logged as user, not source) |
| Misconfigured IAM | * action on * resource |
| Cross-account roles | external Principal "arn:aws:iam::OTHER:root" |
| Resource policy | S3 bucket policy with "Principal": "*" |
| SSM RunCommand | EC2 to OS via SSM session manager |
Azure
| Attack Surface | Test |
| Anonymous storage container | https://<acc>.blob.core.windows.net/<container>?restype=container&comp=list |
| Azure AD enumeration | UserList API anonymous |
| Service Principal abuse | Excessive RBAC role assignment |
| Managed Identity | VM -> token endpoint -> assume role |
| Azure DevOps PAT | Repo scan for PAT in code |
| Key Vault | RBAC misconfig, public access |
GCP
| Attack Surface | Test |
| GCS public bucket | gsutil ls gs://<bucket> (no auth) |
| Compute metadata | curl http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token -H "Metadata-Flavor: Google" |
| IAM lateral | iam.serviceAccounts.actAs, iam.roles.update |
| GKE container | RBAC misconfig + IMDS reach |
Recommended Commands
# QUIET — AWS misconfig audit (read-only IAM)
prowler aws --profile <profile> --severity high,critical
# QUIET — ScoutSuite multi-cloud audit
scout aws --profile <profile> --report-dir ./scout-report
# MODERATE — Pacu enumeration (Pacu CLI)
# Pacu is tied to its db; --modules for specific recon
# MODERATE — Azure recon
roadtools roadrecon auth --device-code
roadtools roadrecon gather
# MODERATE — GCP enum (enumerates the whole project, careful)
gcloud projects list
gcloud iam service-accounts list --project=<project>IAM Privilege Escalation Patterns
AWS PrivEsc (common 25):
1. iam:CreateAccessKey on another user
2. iam:CreateLoginProfile on another user
3. iam:UpdateLoginProfile on another user
4. iam:AttachUserPolicy + ManagedPolicy AdministratorAccess
5. iam:AttachGroupPolicy
6. iam:AttachRolePolicy
7. iam:PutUserPolicy (inline policy)
8. iam:PutGroupPolicy
9. iam:PutRolePolicy
10. iam:AddUserToGroup
11. iam:UpdateAssumeRolePolicy
12. iam:PassRole + service action (lambda, ec2)
13. sts:AssumeRole (broad principal)
14. lambda:UpdateFunctionCode + lambda:InvokeFunction
15. lambda:CreateFunction + iam:PassRole
... (automated with Pacu modules)Container Escape (K8s)
# QUIET — pod RBAC check (kubectl in pod)
kubectl auth can-i --list
# Pod escape signal:
# - hostPID: true
# - hostNetwork: true
# - privileged: true
# - hostPath mount /
# - Capabilities: SYS_ADMIN, SYS_PTRACE
# Service account token
cat /var/run/secrets/kubernetes.io/serviceaccount/token
# IMDSv1 reach from pod
curl http://169.254.169.254/latest/meta-data/iam/security-credentials/Output Template
## Cloud Pentest — <account>
### IAM Path
- User: dev-readonly
- Excessive: iam:UpdateAssumeRolePolicy on role "prod-admin"
- Path: dev-readonly -> update trust policy -> sts:AssumeRole prod-admin -> *
- Time-to-DA: 2 minutes
### Public Asset
- S3 bucket "company-backups" — anonymous list + read (1.2TB exposure)
- 3 prod EC2 instances IMDSv1 only -> SSRF chain risk
### Defensive Recommendations
- IAM policy review: iam:* actions only for the break-glass account
- S3 bucket policy: Principal "*" forbidden (block public access at account level)
- EC2 metadata: IMDSv2 required (hop limit 1)Out-of-Scope
- Deleting / writing production data
- Creating resources (careful not to incur cost — engagement cost limit)
- 3rd party services (Stripe, SendGrid) — out-of-scope by default
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

