Listen to this Post
While exploring exposed services during one of my weekend tests, I came across an SMTP server responding on port 25 with some interesting behavior.
π Using simple telnet, I initiated a connection and found the server allows:
– AUTH LOGIN PLAIN over cleartext
– Anonymous EHLO interaction
– Potential enumeration of authentication mechanisms
π‘ This could lead to:
- Unauthorized relay attempts
- Credential stuffing
- Email spoofing or phishing setups (depending on the server configuration)
Always double-check what services you expose publicly β especially legacy protocols like SMTP.
β Lesson: Even basic tools like telnet can reveal big misconfigurations if you know where to look. Keep testing, keep learning! π‘οΈ
You Should Know:
Testing SMTP Misconfigurations
1. Basic Telnet Connection to SMTP
To check if an SMTP server is open and responding:
telnet <target_IP> 25
Expected response:
220 mail.example.com ESMTP Postfix
2. Enumerate SMTP Commands
Use `EHLO` to check supported commands:
EHLO example.com
Look for dangerous responses like:
250-AUTH LOGIN PLAIN
3. Test for Open Relay
Try relaying an email through the server:
MAIL FROM: [email protected] RCPT TO: [email protected] DATA Subject: Test This is a test email. . QUIT
If the server accepts, itβs vulnerable.
4. Check for Anonymous Login
Attempt authentication without credentials:
AUTH LOGIN [Press Enter without input]
If the server proceeds, itβs misconfigured.
5. Automate with Nmap
Scan for SMTP vulnerabilities:
nmap --script smtp-commands,smtp-open-relay,smtp-vuln -p 25 <target_IP>
6. Secure Your SMTP Server
- Disable `AUTH PLAIN` and enforce TLS.
- Restrict IP access in Postfix (
/etc/postfix/main.cf
):smtpd_relay_restrictions = permit_mynetworks, reject_unauth_destination
- Disable `VRFY` and `EXPN` commands.
What Undercode Say
SMTP misconfigurations remain a critical attack vector in cybersecurity. Attackers exploit weak SMTP settings for spam, phishing, and credential theft. Always:
– Audit SMTP configurations (postconf -n
in Postfix).
– Monitor logs (tail -f /var/log/mail.log
).
– Use encryption (TLS for SMTP).
– Block port 25 if unused (iptables -A INPUT -p tcp --dport 25 -j DROP
).
For defenders:
Check active SMTP connections netstat -tuln | grep 25
For attackers (ethical hacking):
Bruteforce SMTP users with Hydra hydra -L users.txt -P passwords.txt smtp://<target_IP> -s 25 -V
Legacy protocols demand modern security. Test before exposure!
Expected Output:
220 vulnerable-smtp.example.com ESMTP 250-AUTH LOGIN PLAIN 250-VRFY 250-EXPN
π Further Reading:
References:
Reported By: Ashish Rai – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass β