SMTP enumeration
SMTP enumeration extracts server version, supported capabilities, authentication mechanisms, and internal hostnames from the banner and EHLO response. The three ports behave differently: port 25 is server-to-server and often leaks more, port 587 is submission and usually enforces AUTH and STARTTLS, port 465 uses implicit TLS. Always check all three and compare output — misconfigurations are often port-specific.
Service Discovery
25/tcp open smtp Postfix smtpd 465/tcp open ssl/smtp Postfix smtpd 587/tcp open smtp Postfix smtpd
Banner Grab and EHLO
Connect to port 25 and send EHLO to get the full capability list. The banner hostname often leaks internal naming useful for AD recon:
220 mail.internal.company.com ESMTP Postfix (Ubuntu)
220 mail.internal.company.com ESMTP Postfix 250-mail.internal.company.com 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-STARTTLS 250-AUTH PLAIN LOGIN 250-8BITMIME 250 DSN
Note which capabilities are advertised: 250-STARTTLS means TLS is available but not required. 250-AUTH shows which authentication mechanisms are supported. 250-VRFY means user validation is enabled. Missing STARTTLS on port 587 is a misconfiguration — credentials sent there are plaintext on the wire.
NSE Script Enumeration
Run the SMTP NSE scripts for structured capability output and relay testing in one pass:
| smtp-commands: mail.company.com | PIPELINING SIZE 10240000 VRFY ETRN STARTTLS AUTH PLAIN LOGIN |_ HELP
STARTTLS and TLS Certificate
Upgrade to TLS on port 587 and check the certificate SANs for internal hostnames:
subject=CN=mail.company.com DNS:mail.company.com, DNS:autodiscover.company.com, DNS:smtp.company.com
Certificate SANs often reveal additional internal hostnames — autodiscover, OWA, and other Exchange-related endpoints — that are not in public DNS. Feed these into virtual host enumeration.
NTLM Info Extraction
Exchange and other Microsoft mail servers respond to an SMTP AUTH NTLM initiation with server metadata before completing authentication. This reveals domain name, hostname, and OS version without credentials:
| smtp-ntlm-info: | Target_Name: COMPANY | NetBIOS_Domain_Name: COMPANY | NetBIOS_Computer_Name: MAIL01 | DNS_Domain_Name: company.local | DNS_Computer_Name: mail01.company.local |_ Product_Version: 10.0.17763
The domain name, computer name, and product version are immediately useful for AD targeting. Windows Server 2019 is version 10.0.17763. Feed the domain name into Kerberos enumeration and password spraying scope.
User Enumeration — VRFY and EXPN
VRFY and EXPN are often disabled on hardened servers but worth checking when enabled. A 250 response confirms the user exists:
250 2.0.0 admin 550 5.1.1 <root>: Recipient address rejected 250 2.0.0 postmaster
User Enumeration — RCPT TO
RCPT TO works even when VRFY and EXPN are blocked. The server validates the recipient locally before accepting the message. A 250 response means the address is accepted:
250 2.1.5 Ok
550 5.1.1 <[email protected]>: Recipient address rejected: User unknown
Automated User Enumeration
smtp-user-enum automates VRFY, EXPN, or RCPT testing against a wordlist. RCPT mode is most reliable:
[*] Trying RCPT method... [+] [email protected] exists [+] [email protected] exists [-] [email protected] does not exist
Build a confirmed user list for password spraying against OWA, SMTP submission, and other services. A 252 response to VRFY is not a positive — it means the server won't verify but will accept the message. Only treat 250 as confirmed. Move to open relay testing and user enumeration for dedicated methodology pages.
References
-
nmap — smtp-commands NSEnmap.org/nsedoc/scripts/smtp-commands.html (opens in new tab)
EHLO capability enumeration via nmap
-
nmap — smtp-ntlm-info NSEnmap.org/nsedoc/scripts/smtp-ntlm-info.html (opens in new tab)
NTLM metadata extraction from Exchange SMTP
-
nmap — smtp-open-relay NSEnmap.org/nsedoc/scripts/smtp-open-relay.html (opens in new tab)
Automated open relay detection
-
smtp-user-enumgithub.com/pentestmonkey/smtp-user-enum (opens in new tab)
VRFY, EXPN, and RCPT user enumeration tooling
Was this helpful?
Your feedback helps improve this page.