Skip to main content
The Simple Mail Transfer Protocol (SMTP) is used for sending and receiving email. It is commonly paired with POP3 or IMAP for message retrieval. Default Ports: 25 (SMTP), 465 (SMTPS), 587 (SMTP with STARTTLS)

Basic Connections

Enumeration

NTLM Info Disclosure

If the server supports NTLM auth (Windows), send a challenge to extract version info:

Username Enumeration

Sending Emails

Email Security Mechanisms

SPF (Sender Policy Framework)

SPF Qualifiers:
  • + = PASS (default)
  • ? = NEUTRAL
  • ~ = SOFTFAIL (accept but mark)
  • - = FAIL (reject)

DKIM (DomainKeys Identified Mail)

DMARC

Avoiding Email Security Gateways (SEGs)

Organizations using Entra ID / Exchange Online often have multiple accepted domains. If any accepted domain has an MX record pointing directly to the mail server (bypassing the SEG), you can deliver mail avoiding the gateway.The default <tenant>.onmicrosoft.com domain always has MX pointing to Exchange Online.

SMTP Spoofing

Open Relay Testing

Open relay configuration (misconfiguration to look for):

SMTP Smuggling

SMTP smuggling allows bypassing SPF, DKIM, and DMARC protections by exploiting line ending interpretation differences between SMTP servers. Some servers accept <LF>.<LF> while others only accept <CR><LF>.<CR><LF>, enabling message injection.

Config Files

Post-Exploitation: Headers Reveal Internal Structure

If you can make the victim send you an email (e.g., contact form), inspect the headers:
  • Internal server names and IP addresses
  • Antivirus software info (X-Virus-Scanned header)
  • Internal relay hops

NDN (Non-Delivery Notification) Harvesting

Send emails to non-existent addresses. The bounce-back NDN often contains:
  • Internal server names
  • IP addresses of mail infrastructure
  • AV software information