跳到正文
Skillpedia
部署与云(DevOps)48k · #4162

cloud-iam-deep

它能做什么

这个工具可以帮助你在 AWS、Azure、GCP 等云环境中查找并排查安全隐患。它会通过模拟真实攻击,以合乎道德的方式进行安全测试,从而找出存在的漏洞。

适用场景

  • ✓当你发现云凭证(密钥、令牌)暴露时。
  • ✓当你发现一条可以访问敏感云服务信息的路径时。
  • ✓当你已经获得某台云服务器的访问权限,并想检查自己能控制哪些其他服务时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/cloud-iam-deep/SKILL.md

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“我在一段代码里发现了一个 AWS 访问密钥,怎么检查它有没有危险的权限?”

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

工作原理

工具会先找出可能泄露的凭证。然后,它会使用特定命令检查这些凭证关联的权限,并尝试寻找获取更多访问权限的途径,始终以安全为目的。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

⚠️ AUTHORIZED USE ONLY This skill is for educational purposes or authorized security assessments only. You must have explicit, written permission from the system owner before using this tool. Misuse of this tool is illegal and strictly prohibited.

Mandatory confirmation gate Before running any command that probes, exploits, changes, persists on, extracts data from, or attempts credential access against a target:

  1. Ask the user to state the exact target URL, IP, account, or resource.
  2. Ask the user to confirm written authorization and the permitted scope.
  3. Show the exact command(s) and explain their expected effect.
  4. Wait for explicit confirmation in the current conversation.

Without that confirmation, remain read-only and provide defensive guidance only. Prefer a sandbox, disposable VM, or controlled lab.

When to use

Trigger when:

  • A cloud credential surfaces (key, secret, token, JSON file)
  • SSRF chain reaches IMDS / metadata endpoint
  • APK / git-leak reveals embedded cloud key
  • Recon shows public S3/GCS/Azure-blob with permissions you can verify
  • A Kubernetes API or service-account token is exposed
  • Post-RCE on a cloud-hosted instance — pivot to cloud control plane

Do NOT use for:

  • On-prem-only environments (use AD attack skills — but those are out of scope per external-only boundary)
  • Web2 vulns that happen to be on AWS — use the relevant hunt-* skill

Credential identification (first 60 seconds)

# AWS access key patterns
AKIA[0-9A-Z]{16}                # IAM user access key (long-term)
ASIA[0-9A-Z]{16}                # STS temporary credential
AGPA[0-9A-Z]{16}                # IAM group
AIDA[0-9A-Z]{16}                # IAM user (user-id)
AROA[0-9A-Z]{16}                # IAM role
ANPA[0-9A-Z]{16}                # Managed policy

# AWS secret pattern (40-char base64-ish — context required)
[A-Za-z0-9/+=]{40}              # AWS secret access key

# Azure
AccountKey=[A-Za-z0-9+/=]{86}   # Storage account key
client_secret pattern + UUID    # Azure AD app credential

# GCP service account JSON
{
  "type": "service_account",
  "project_id": "...",
  "private_key_id": "...",
  "private_key": "-----BEGIN PRIVATE KEY-----..."
}

# K8s SA token (JWT format — decode to confirm)
eyJhbGciOiJSUzI1...     # decode kid claim to see issuer

AWS — read-only validation (the safe first step)

# Set credential
export AWS_ACCESS_KEY_ID="AKIA..."
export AWS_SECRET_ACCESS_KEY="..."

# 1. WHO am I?
aws sts get-caller-identity
# Returns: UserId, Account, Arn
# Arn tells you: IAM user vs role, account ID, name

# 2. WHAT can I do? (the privesc question)
# Try common read-only first — failures still inform you
aws iam list-users 2>&1 | head -5
aws iam list-roles 2>&1 | head -5
aws iam list-policies 2>&1 | head -5
aws iam list-groups 2>&1 | head -5

# 3. WHAT policies are attached to me?
aws iam list-attached-user-policies --user-name <self>
aws iam list-user-policies --user-name <self>          # inline policies
aws iam list-groups-for-user --user-name <self>

# 4. Service-by-service surface
aws ec2 describe-instances --max-items 1 2>&1 | head
aws s3 ls 2>&1 | head -10
aws lambda list-functions --max-items 5 2>&1 | head
aws rds describe-db-instances --max-items 5 2>&1 | head
aws secretsmanager list-secrets --max-results 5 2>&1 | head
aws ssm describe-parameters --max-results 5 2>&1 | head

# 5. Audit any cross-account / external trust
aws iam list-roles --query 'Roles[?contains(AssumeRolePolicyDocument.Statement[0].Principal.AWS, `arn:aws:iam::`)]' 2>&1 | head -20

AWS privesc patterns (24+ documented — iam_privesc techniques)

Quick lookup — if you have any of these IAM actions, escalate via the listed technique:

You have Escalate via
iam:CreateAccessKey Create access key on any user → impersonate
iam:CreateLoginProfile Set a console password on a user → login
iam:UpdateLoginProfile Reset console password on a user
iam:AttachUserPolicy Attach AdministratorAccess to self
iam:AttachGroupPolicy Attach AdministratorAccess to a group you're in
iam:AttachRolePolicy + sts:AssumeRole Attach to a role you can assume
iam:PutUserPolicy Inline AdministratorAccess to self
iam:PutGroupPolicy Inline policy on a group
iam:PutRolePolicy Inline on a role you can assume
iam:AddUserToGroup Add self to admin group

…

常见问题

这个工具可以用于所有云平台吗?

它主要针对 AWS、Azure 和 GCP 等公有云设计,但可能无法覆盖所有服务,或每个平台的特定配置。

使用它安全吗?

这个工具只能在系统所有者明确书面授权的前提下使用。未经授权的使用属于违法行为,也是被禁止的。建议你在受控的测试环境中使用。

什么是“红队攻击链”?

指“红队”(模拟攻击者的人员)利用云系统安全漏洞时所用的一系列步骤,从最初的访问入口一直到完全控制系统。

详情

作者的原始描述

Cloud IAM red-team attack chain across AWS, Azure, GCP

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#4162
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能