Sploitus

Exploit for Improper Handling of Exceptional Conditions in Openbsd Opensmtpd

githubexploit Β· 2020-02-17

Exploit Code

README23 lines
## https://sploitus.com/exploit?id=321CE1D7-0A40-548A-A1F0-8FF781F4CC28
# cve-2020-7247
Exploit Title: OpenSMTPD 6.6.2 - Remote Code Execution.  
The new Date: 2020-01-29.  
Exploit Author: 1F98D.  
Original Author: Qualys Security Advisory.  
Vendor Homepage: https://www.opensmtpd.org/.  
Software Link: https://github.com/OpenSMTPD/OpenSMTPD/releases/tag/6.6.1p1.  
Version: OpenSMTPD < 6.6.2.  
Tested on: OpenBSD 6.6, OpenBSD 6.5, OpenBSD 6.4, OpenBSD 5.9.  

OpenSMTPD after commit a8e222352f and before version 6.6.2 does not adequately escape dangerous characters from user-controlled input. An attacker can exploit this to execute arbitrary shell commands on the target.

# Usage

```
sudo apt install python3-pip
pip3 install --user pwn
python3 poc1.py LHOST LPORT RHOST RPORT
```

# Credit
https://packetstormsecurity.com/files/156145/OpenSMTPD-6.6.2-Remote-Code-Execution.html