| Field | Detail |
|---|---|
| Summary | Validate usernames and probe mail servers (VRFY/EXPN/RCPT, open relay) |
| Category | Mail (SMTP) enumeration |
| Phase | enumeration |
| Interface | CLI |
| Platform | Linux |
| Licence | Open source |
| Docs | https://github.com/pentestmonkey/smtp-user-enum |
| Related | Nmap, Hydra, NetExec (CrackMapExec), OSINT and recon |
SMTP (#tcp/25, submission #tcp/587, SMTPS #tcp/465) often leaks valid usernames through the VRFY, EXPN and RCPT TO verbs, and sometimes acts as an open relay. Confirmed users become a spray/brute list; an open relay is a finding in its own right. smtp-user-enum automates the user check; swaks is the swiss-army SMTP client for everything else.
⚠️ Warning — Scope & lockouts User enumeration is active and logged. The usernames you confirm feed credential attacks — pull the password policy before spraying (see NetExec (CrackMapExec) / Hydra). In-scope hosts only.
Fingerprint the server first
nmap -p25,465,587 -sV --script smtp-commands,smtp-open-relay,smtp-enum-users 10.10.10.5
nc -nv 10.10.10.5 25 # banner; then type: EHLO x (see supported verbs)
smtp-user-enum (username validation)
smtp-user-enum -M VRFY -U users.txt -t 10.10.10.5 # VRFY method
smtp-user-enum -M EXPN -U users.txt -t 10.10.10.5 # EXPN (expands aliases/lists)
smtp-user-enum -M RCPT -U users.txt -t 10.10.10.5 # RCPT TO — works when VRFY/EXPN disabled
smtp-user-enum -M RCPT -D corp.local -U users.txt -t 10.10.10.5 # append a domain
smtp-user-enum -M VRFY -u administrator -t 10.10.10.5 # a single username
| Flag | Purpose |
|---|---|
-M VRFY\|EXPN\|RCPT |
Enumeration method/verb |
-U <file> / -u <user> |
Username list / single user |
-t <host> / -T <file> |
Target host / file of hosts |
-D <domain> |
Append @domain to each username |
-p <port> |
Non-default port |
-w <sec> |
Timeout |
swaks (manual SMTP / relay testing)
swaks --to user@target.com --server 10.10.10.5 # basic deliverability test
swaks --to ext@gmail.com --from x@target.com --server 10.10.10.5 # open-relay test (external->external)
swaks --to user@target.com --server 10.10.10.5 --auth LOGIN --auth-user u --auth-password p
swaks --to user@target.com --server 10.10.10.5 --attach phish.doc --body body.txt # (authorised SE only)
Manual verbs (when you want to see the exchange)
nc -nv 10.10.10.5 25
HELO x
VRFY root # 250/252 = exists, 550 = no such user
EXPN admin # expand a mailing list / alias
MAIL FROM:<a@b.c>
RCPT TO:<test@target.com> # 250 = valid recipient, 550 = unknown
Worked example
smtp-user-enum -M RCPT -D corp.local -U /usr/share/seclists/Usernames/top-usernames-shortlist.txt -t 10.10.10.5
Use RCPT TO (reliable when VRFY/EXPN are disabled), appending @corp.local to each candidate from a SecLists username list. Every address the server accepts (250) is a valid domain user — hand that list to Kerbrute / NetExec (CrackMapExec) for careful spraying, or Hydra for other services.
Kill-chain usage
Enumeration
smtp-user-enum -M RCPT -U users.txt -t 10.10.10.5 # validate usernames
Where it fits
Runs when Nmap shows #tcp/25 open. It's a cheap source of a validated username list that feeds the whole credential-attack chain, and the open-relay check is a standalone reportable finding. Names discovered via OSINT and recon (theHarvester) make a good input list.