跳到正文
Skillpedia
安全5.5k · #14787

cloud-pentest

它能做什么

这项技能教智能体如何检查测试人员已持有的云身份的权限。内容包括列出该身份能够访问的范围,以及查找权限提升路径,并从只读步骤开始。

适用场景

  • ✓当测试人员持有云访问密钥或元数据令牌,需要了解其权限范围的时候。
  • ✓当测试人员需要检查某个云身份能否获得更多权限的时候。
  • ✓当测试人员需要展示云访问的实际影响,同时不接触客户数据的时候。

技能链接

https://github.com/awarexone/Agentic-Bug-Hunter/blob/main/skills/cloud-pentest/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/awarexone/Agentic-Bug-Hunter/blob/main/skills/cloud-pentest/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我有一个属于本次测试范围的 AWS 访问密钥。请先以只读方式帮我看看这个身份能做什么。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会先用只读调用确定身份,然后列出其权限。它会检查已知的权限提升路径,并使用无害的测试对象来证明影响,而不是使用客户数据。

技术内容(原始 SKILL.md)

作者在 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
常见问题

智能体能修改云端的任何东西吗?

这项技能说明,在任何状态变更之前都应先只读枚举,并先确认范围。

它应该用客户数据作为证据吗?

不应该。这项技能说明,应使用无害的金丝雀对象或测试人员自己的对象来证明访问权限。

泄露的密钥本身算是发现吗?

不算。这项技能说明,发现的是该身份能做什么。

详情

作者的原始描述

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

热度

GitHub 星标
5.5k
排名
#14787
许可证
MIT
更新时间
2026/10/28

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能