Default Ports: 25 (SMTP), 465 (SMTPS), 587 (Submission)
SMTP handles outbound mail delivery, and because it was designed in an era with no real concept of spoofing or abuse prevention, a lot of its original commands still double as enumeration and attack primitives today. User enumeration through VRFY, open relay abuse, and plaintext credential capture are all still findable on real engagements, especially on older or internally-facing mail servers.
Port 25
Server-to-server mail relay, the original SMTP port. Usually unauthenticated between trusted mail servers, which is exactly what makes open relay misconfigurations possible.
Ports 465 / 587
Client submission ports, used by mail clients to send outgoing mail. Normally require authentication and often enforce TLS.
SMTP Commands
Everything SMTP does, legitimately or for enumeration, happens through a small set of plaintext commands. Knowing these makes manual interaction over telnet or netcat straightforward instead of guesswork.| Command | Description |
|---|---|
HELO / EHLO | Opens the session, identifying the client. EHLO also lists every extended command the server supports |
MAIL FROM | Specifies the sender address |
RCPT TO | Specifies the recipient address |
DATA | Begins the actual message body |
VRFY | Asks the server to confirm whether a mailbox exists |
EXPN | Asks the server to expand a mailing list or alias into its member addresses |
AUTH PLAIN | Authenticates the client |
RSET | Aborts the current message without closing the connection |
NOOP | No-op, used to keep a connection alive |
QUIT | Closes the session |
Connecting Manually
A raw connection is often the fastest way to confirm what a server actually supports before reaching for a dedicated tool.EHLO is the first thing worth sending, it both opens the session properly and lists every extension the server supports in one response:
Nmap Enumeration
User Enumeration
SMTP’sVRFY and EXPN commands were designed to confirm whether a mailbox exists, which makes them a direct username oracle on servers that haven’t disabled them. Where both are blocked, RCPT TO often still leaks the same information through a different response code.
VRFY but still respond differently to RCPT:
Open Relay Testing
An open relay forwards mail for domains it has no authority over, letting anyone send spoofed mail through the server’s own reputation.swaks is the most reliable way to test and craft messages manually.
sendemail is a lighter alternative when swaks isn’t installed:
Brute Forcing
Metasploit Modules
Known RCE Vulnerability: Haraka
The Haraka mail server had a well-documented remote code execution vulnerability in older versions, worth checking for oncesmtp_version has fingerprinted the server software.
Quick Reference Tools
Hackviser: SMTP
Quick-reference pentesting guide for the SMTP service.
MXToolbox
Passive MX, blacklist, and mail configuration lookups.
SMTP Response Codes
Reference for interpreting SMTP status and error codes during manual testing.

