cloud-pentest
What it does
This skill teaches an agent how to check the permissions of a cloud identity that a tester already holds. It covers listing what the identity can reach and finding privilege escalation paths, starting with read-only steps.
When to use it
- βWhen a tester has cloud access keys or a metadata token and needs to know what they allow.
- βWhen a tester needs to check whether a cloud identity can gain more permissions.
- βWhen a tester needs to show the real impact of cloud access without touching customer data.
Skill link
https://github.com/awarexone/Agentic-Bug-Hunter/blob/main/skills/cloud-pentest/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βI have an AWS access key that is in scope for this test. Help me see what this identity can do, read-only first.β
5 new skills a week. 1 minute to read.
How it works
The agent first identifies the identity with a read-only call, then lists its permissions. It checks known escalation paths and proves impact with a benign test object instead of customer data.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
CLOUD PENTEST β Post-Access Exploitation
Recon finds the door; this is what you do inside. A leaked
AKIA...key or a metadata token is not a finding on its own β the finding is what that identity can DO. Enumerate the identity, find the privesc path, prove real impact. Never touch data you're not authorized to.
AUTHORIZATION FIRST
[ ] Target cloud account/subscription is explicitly in scope
[ ] You have written authorization (program scope, engagement doc)
[ ] Read-only enumeration before ANY state change
[ ] No exfil of real customer data β prove access with a benign canary/own-account object
[ ] Discovered accounts/roles you can pivot to are NOT auto-authorized β confirm scope
Stop here if any box is unchecked.
0. IDENTIFY THE IDENTITY (do this first, always)
| You have | First call | Tells you |
|---|---|---|
| AWS keys | aws sts get-caller-identity |
account id, principal ARN, user vs role |
| AWS metadata | curl .../iam/security-credentials/<role> |
temp creds + role name |
| GCP SA JSON / token | gcloud auth ... / curl metadata ...token |
project, service account, scopes |
| Azure token / MI | IMDS .../identity/oauth2/token |
tenant, object id, resource access |
Never assume privilege. Enumerate what this identity actually has before planning.
1. AWS β ENUMERATE THEN ESCALATE
Enumerate (read-only):
aws sts get-caller-identity
aws iam get-account-authorization-details 2>/dev/null # full policy dump if allowed
aws iam list-attached-user-policies --user-name <u>
aws iam list-role-policies / list-attached-role-policies
# No IAM read? Brute the effective perms with enumerate-iam / then map with a policy tool
Classic privesc paths (need the matching permission):
| Permission held | Escalation |
|---|---|
iam:CreatePolicyVersion |
Write a new default *:* version onto an attached policy |
iam:PassRole + ec2:RunInstances / lambda:CreateFunction |
Launch compute AS an admin role |
iam:AttachUserPolicy / PutUserPolicy |
Attach AdministratorAccess to yourself |
sts:AssumeRole (over-broad trust) |
Assume a more privileged role |
iam:CreateAccessKey on another user |
Mint keys for a privileged user |
lambda:UpdateFunctionCode on privileged fn |
Run code with the function's role |
iam:UpdateAssumeRolePolicy |
Rewrite trust policy to let you assume it |
Impact proof (benign): list a bucket you were told is in scope, sts assume-role into the admin role and get-caller-identity to show the new ARN, or read a canary object. Don't touch real PII.
2. METADATA (IMDS) β SSRF LANDS HERE
IMDSv1 (no token): GET http://169.254.169.254/latest/meta-data/iam/security-credentials/<role>
IMDSv2 (token): PUT .../latest/api/token (X-aws-ec2-metadata-token-ttl-seconds: 21600)
then GET with X-aws-ec2-metadata-token: <token>
GCP: GET http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token
header: Metadata-Flavor: Google
Azure: GET http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com/
header: Metadata: true
Got temp creds β jump to section 1 (AWS) / 3 (GCP) / 4 (Azure) and enumerate what THAT role can do. SSRF alone is Medium; SSRF β metadata creds β data/admin is Critical.
3. GCP β IMPERSONATION IS THE PIVOT
gcloud auth activate-service-account --key-file=sa.json # or use the token
gcloud projects get-iam-policy <project>
gcloud iam service-accounts list
| Permission | Escalation |
|---|---|
iam.serviceAccounts.getAccessToken / actAs |
Impersonate a higher-priv SA (--impersonate-service-account) |
iam.serviceAccountKeys.create |
Mint a key for a privileged SA |
iam.roles.update on a custom role you hold |
Add permissions to yourself |
cloudfunctions.functions.update / deploy |
Run code as the function's SA |
storage.objects.get on a sensitive bucket |
Read secrets/state |
Owner/Editor at project level = effectively admin. Check for the default Compute SA having Editor β extremely common.
4. AZURE β MANAGED IDENTITY & RBAC
az account show
az role assignment list --assignee <objectId> --all
az resource list
| Path | Escalation |
|---|---|
| Managed identity with Contributor | Deploy/modify resources, run commands on VMs (az vm run-command) |
Microsoft.Authorization/*/write |
Assign yourself Owner |
FAQ
Can the agent change anything in the cloud?
The skill says to enumerate read-only before any state change, and to confirm scope first.
Should it use customer data as proof?
No. The skill says to prove access with a benign canary or the tester's own object.
Does a leaked key count as a finding by itself?
No. The skill says the finding is what the identity can do.
Details
Original description by the author
Post-access cloud exploitation for AWS, GCP, and Azure β what to do AFTER you obtain credentials or reach a metadata endpoint. Covers IAM enumeration and privilege escalation (iam:PassRole, CreatePolicyVersion, AssumeRole chains, GCP service-account impersonation, Azure managed-identity abuse), IMDSv1/v2 metadata credential theft, STS token abuse, S3/GCS/Blob bucket takeover and object exfil, Lambda/Cloud Functions env-var secrets, cross-account and cross-service pivoting, and turning leaked keys into demonstrated impact (read PII, assume admin, exfil data). Assumes authorized scope only. Use
Popularity
- GitHub stars
- 5.5k
- Ranking position
- #14787
- License
- MIT
- Updated
- 10/28/2026
Comments
- β¦
More skills from this repository
bug-bounty
5.5kHelps your agent plan a bug bounty review in stages, from checking the program scope and mapping assets to testing leads, validating impact, and writing a report.
agentic-app-audit
5.5kHelps your agent review a live AI assistant from the outside for risks such as hijacked tool calls, poisoned memory, and actions taken with more access than the user has.
argus
5.5kHelps your agent run six automated scanners for common web and AI app flaws, such as open cross-origin access, JWT weaknesses, and blind bugs confirmed out-of-band.
bb-methodology
5.5kHelps your agent plan a bug bounty session in stages, choosing the next step and the right checks, and dropping ideas that cannot cause real harm.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.