Skip to content
Skillpedia
Security5.5k Β· #14787

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.md

Copy 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

Use this skill to help me: https://github.com/awarexone/Agentic-Bug-Hunter/blob/main/skills/cloud-pentest/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

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

repo: awarexone/Agentic-Bug-Hunter

Popularity

GitHub stars
5.5k
Ranking position
#14787
License
MIT
Updated
10/28/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills