mcpField
C
cloud-aksk-exploit

cloud-aksk-exploit

github.com/wgpsecSecurity1.8k47 installsUpdated 4d ago
Repository

About cloud-aksk-exploit

An AK/SK credential-use methodology for cloud security testers. It covers credential format identification, identity verification, permission enumeration, and follow-on actions, with detailed reference documents for AWS and Tencent Cloud.

Key features

  1. 01Identify credential formats across cloud platforms
  2. 02Configure credentials and verify identity
  3. 03Enumerate user, role, and service permissions
  4. 04Map follow-on actions by resource type
  5. 05AWS and Tencent Cloud command references

Use cases

  1. 01Identify the cloud platform for exposed credentials
  2. 02Verify credential identity and inspect permissions
  3. 03Examine storage, compute, or function resources

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/wgpsec/aboutsecurity --skill cloud-aksk-exploit

After installing, type/cloud-aksk-exploitin Claude Code to confirm it loaded.

Bundled filesreferences/aws-exploit.mdreferences/tencent-exploit.md

Details

From the project README

云凭据 AK/SK 泄露利用方法论

拿到云凭据后的黄金时间窗口通常很短(尤其临时凭据),需要快速高效地完成"枚举→利用→持久化"链条。

按云平台查阅详细命令

识别云平台后,加载对应 reference 获取完整命令:

Phase 0: 凭据识别与配置

0.1 凭据格式识别
云平台格式特征示例前缀
AWS 长期20字符 AccessKeyIdAKIA...
AWS 临时20字符 + SessionTokenASIA...
腾讯云36字符 SecretIdAKIDz...
阿里云~24字符 AccessKeyIdLTAI...
华为云~20字符 AKAK... / SK...
GCPService Account JSON"type": "service_account"
AzureClientId + ClientSecret + TenantIdGUID 格式
0.2 快速配置

AWS:

export AWS_ACCESS_KEY_ID="AKIA..."
export AWS_SECRET_ACCESS_KEY="..."
export AWS_SESSION_TOKEN="..."  # 临时凭据需要
export AWS_DEFAULT_REGION="us-east-1"
aws sts get-caller-identity

腾讯云:

export TENCENTCLOUD_SECRET_ID="AKIDz..."
export TENCENTCLOUD_SECRET_KEY="..."
export TENCENTCLOUD_SESSION_TOKEN="..."  # 临时凭据
export TENCENTCLOUD_REGION="ap-guangzhou"
tccli sts GetCallerIdentity

阿里云:

export ALIBABA_CLOUD_ACCESS_KEY_ID="LTAI..."
export ALIBABA_CLOUD_ACCESS_KEY_SECRET="..."
aliyun sts GetCallerIdentity

Phase 1: 通用攻击流程

配置凭据后,按以下顺序操作(具体命令参见对应云平台 reference):

  1. 权限枚举(前 2 分钟内完成)

    • 确认身份(GetCallerIdentity)
    • 枚举当前用户/角色附加的策略
    • 逐服务快速探测(存储/计算/函数/密钥)
  2. 资源接管(按价值排序)

    • 存储桶(S3/COS/OSS)→ 列桶、下载敏感文件
    • 计算实例(EC2/CVM)→ SSM/重置密码获取 shell
    • 云函数(Lambda/SCF)→ 下载代码、读环境变量
    • 密钥服务(Secrets Manager/KMS/SSM Parameter Store)
  3. 提权

    • 创建高权限策略并附加到当前用户
    • PassRole + Lambda/SCF 提权
    • AssumeRole 跨角色切换
    • → 更多提权路径详见 cloud-iam-audit skill
  4. 持久化后门

    • 创建后门用户 + AK/SK
    • 附加管理员策略

临时凭据注意事项

  • 有效期: 通常 15 分钟 ~ 12 小时
  • SessionToken: 每次 API 调用都必须携带
  • 优先操作: 先创建长期凭据(新 AK/SK 或用户),再慢慢枚举
  • 刷新: 如果来自元数据服务,可能可以重复获取新凭据

决策树

获取到 AK/SK
├── 识别云平台(AKIA=AWS, AKIDz=腾讯, LTAI=阿里)
│   └── 加载对应 reference(aws-exploit.md / tencent-exploit.md)
├── 配置环境变量 + 验证身份
├── 快速权限枚举(2 分钟内)
│   ├── 有 S3/COS 权限 → 列桶 → 下载敏感文件 → 找 flag
│   ├── 有 Lambda/SCF 权限 → 读代码 → 读环境变量
│   ├── 有 EC2/CVM 权限 → 获取 shell
│   ├── 有 IAM/CAM 权限 → 提权 → 管理员
│   └── 有 Secrets 权限 → 读密钥
├── 如果是临时凭据 → 先创建持久化后门
└── 深度利用 → cloud-iam-audit skill

Comments

Markdown supported