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-41892_PoC — Proof-of-concept scripts and Docker lab for reproducing CVE-2023-41892, a pre-authenticated remote code execution vulnerability in Craft CMS. Includes log poisoning and Imagick MSL file write exploits. | Kitploit
Tools/GitHubGitHub/lyccyc/cve-2023-41892_poc
Vulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingLearning & EducationLabs & Practice
GitHublyccyc/cve-2023-41892_poc

CVE-2023-41892_PoC

Proof-of-concept scripts and Docker lab for reproducing CVE-2023-41892, a pre-authenticated remote code execution vulnerability in Craft CMS. Includes log poisoning and Imagick MSL file write exploits.

View Repository
12 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

CVE-2023-41892 Craft CMS PoC

This repository contains proof-of-concept scripts and a local Vulhub lab for reproducing CVE-2023-41892, a pre-authenticated remote code execution vulnerability in Craft CMS.

Use this project only in an authorized local lab or other systems where you have explicit permission to test.

Project Structure

root@kitploit:~
CVE-2323-41892_PoC/
+-- README.md
+-- LFI_to_RCE.py
+-- Imagick_PoC.py
+-- Vulnhub_env/
    +-- docker-compose.yml
    +-- README.md
    +-- README.zh-cn.md
    +-- 1.png ... 5.png

File Purpose

PathPurpose
LFI_to_RCE.pyPoC for log poisoning followed by local file inclusion through the Psy\Configuration gadget.
Imagick_PoC.pyPoC for arbitrary file write through the Imagick MSL gadget.
Vulnhub_env/docker-compose.ymlDocker Compose lab that starts vulnerable Craft CMS 4.4.14 and MySQL 5.7.
Vulnhub_env/README.mdOriginal Vulhub-style reproduction notes with request examples and screenshots.
Vulnhub_env/README.zh-cn.mdChinese version of the Vulhub reproduction notes.
Vulnhub_env/*.pngScreenshots used by the Vulhub environment documentation.

Vulnerability Summary

CVE-2023-41892 affects Craft CMS versions from 4.0.0-RC1 through 4.4.14. The issue was fixed in Craft CMS 4.4.15.

The vulnerable endpoint used by both scripts is:

root@kitploit:~
/index.php?action=conditions/render

The PoCs target the default local lab URL:

root@kitploit:~
http://localhost:8088

If your lab runs on another host or port, update the URL value near the top of LFI_to_RCE.py and Imagick_PoC.py.

Requirements

  • Docker and Docker Compose
  • Python 3
  • Python package: requests

Install the Python dependency:

root@kitploit:~
pip install requests

Lab Setup

Start the vulnerable Craft CMS environment:

root@kitploit:~
cd Vulnhub_env
docker compose up -d

Open the Craft CMS installer:

root@kitploit:~
http://localhost:8088/admin/install

Use the following default database settings during installation:

SettingValue
Database hostdb
Database namecraftcms
Database userroot
Database passwordroot

After installation, confirm the site is reachable at:

root@kitploit:~
http://localhost:8088

Usage

Run the commands from the repository root:

root@kitploit:~
cd CVE-2323-41892_PoC

PoC 1: Log Poisoning to RCE

Run:

root@kitploit:~
python LFI_to_RCE.py

What it does:

  1. Sends malformed JSON containing PHP code to the Craft CMS log.

  2. Builds a log file path using the current local date:

    root@kitploit:~
    ../storage/logs/web-YYYY-MM-DD.log
    
  3. Uses craft\elements\conditions\users\UserCondition with \Psy\Configuration to include the poisoned log file.

  4. Checks whether phpinfo() output appears in the response.

Expected success output:

root@kitploit:~
[*] Starting Log Poisoning...
[+] Payload sent successfully!
[*] Starting LFI to RCE...
[+] phpinfo() executed successfully!

PoC 2: Imagick MSL File Write

Run:

root@kitploit:~
python Imagick_PoC.py

What it does:

  1. Uploads an MSL payload through multipart form data.
  2. Triggers object creation with the Imagick gadget.
  3. Attempts to write webshell.php into the web root.
  4. Requests http://localhost:8088/webshell.php and checks for phpinfo().

Expected success output:

root@kitploit:~
[*] Sending multipart/form-data payload to trigger Imagick gadget...
[+] Success: phpinfo() output found.

The Imagick path may crash the PHP worker after the payload is triggered. In the Vulhub lab this can still be normal if webshell.php is written before the crash.

Configuration

Both scripts define the target URL at the top of the file:

root@kitploit:~
URL = "http://localhost:8088"

Change this value if the vulnerable lab is exposed on another address.

Imagick_PoC.py checks the generated file at:

root@kitploit:~
OUTPUT_FILE = "/webshell.php"

Troubleshooting

The scripts cannot connect

  • Confirm the containers are running:

    root@kitploit:~
    cd Vulnhub_env
    docker compose ps
    
  • Confirm the site is reachable at http://localhost:8088.

  • Check whether another service is already using port 8088.

  • Update the URL value in the Python scripts if you changed the exposed port.

LFI_to_RCE.py does not show PHP Version

  • Confirm Craft CMS installation is complete.
  • Confirm Craft CMS is writing logs under storage/logs/.
  • Check that the log filename date matches the container date.
  • If your host and container dates differ, update the generated web-YYYY-MM-DD.log path in LFI_to_RCE.py.

Imagick_PoC.py returns 404 for /webshell.php

  • Confirm the Imagick PHP extension is enabled in the target environment.
  • Confirm the PHP process can write to the web root.
  • Confirm uploaded temporary files are created under /tmp/php*.
  • Retry once if the PHP worker crashed during the trigger request.

Cleanup

Stop the lab:

root@kitploit:~
cd Vulnhub_env
docker compose down

Remove containers and the database volume if you want a clean reinstall:

root@kitploit:~
docker compose down -v

Mitigation

Upgrade Craft CMS to 4.4.15 or later.

If exploitation is suspected, rotate the Craft CMS security key, database credentials, application secrets, and any credentials stored in the environment.

References

  • Vulhub reproduction: https://github.com/vulhub/vulhub/blob/master/craftcms/CVE-2023-41892/README.md
  • Craft CMS advisory: https://github.com/craftcms/cms/security/advisories/GHSA-4w8r-3xrw-v25g
  • NVD entry: https://nvd.nist.gov/vuln/detail/CVE-2023-41892
Download Tool