![]() |
VOOZH | about |
Simple Mail Transfer Protocol (SMTP) is an application-layer protocol used over TCP/IP for sending and relaying emails between servers. SMTP Enumeration involves probing mail servers to identify valid users, system behavior and misconfigurations, often aiding penetration testing for discovering accounts usable in attacks like phishing or brute-force attempts.
Note: If a server responds positively to these commands, it may unintentionally expose valid user accounts.
SMTP works within a client-server model:
SMTP enumeration can be performed by using different tools and scripts like telnet, Nmap and smtp-user-enum.
Telnet allows manual interaction with SMTP servers. By connecting to the SMTP service, an attacker can test commands such as VRFY, EXPN, MAIL FROM and RCPT TO to discover valid users and server behavior.
Syntax:
telnet <domain/IP> <port>Output:
later you can use EXPN, MAIL FROM and RCPT TO after connecting to the target host.
Nmap provides NSE scripts that help enumerate SMTP users and gather server details such as valid accounts and configuration behavior.
sudo nmap -p 25 --script smtp-enum-users <target IP/domain>Example:
Metasploit provides auxiliary modules for SMTP enumeration, such as smtp_enum and smtp_version, which help identify valid users and SMTP server details.
smtp_enum Module:
msf6 > use auxiliary/scanner/smtp/smtp_enum
msf6 auxiliary(smtp_enum) > set RHOSTS <target IP>
msf6 auxiliary(smtp_enum) > set RPORT 25
msf6 auxiliary(smtp_enum) > set USER_FILE <path_to_user_list>
msf6 auxiliary(smtp_enum) > run
Output:
smtp_version Module:
msf6 > use auxiliary/scanner/smtp/smtp_version
msf6 auxiliary(smtp_version) > set RHOSTS <target IP>
msf6 auxiliary(smtp_version) > set THREADS 250
msf6 auxiliary(smtp_version) > run
Output: