SMTP
A primer on how SMTP enumeration and common exploitation techniques
Mail systems commonly use SMTP with POP3 and IMAP, which enable users to save messages in the server mailbox and download them from the server when necessary.
SMTP uses mail exchange (MX) servers to direct mail via DNS.
SMTP runs on TCP port 25 but can also run on TCP ports 465, 2525, or 587.
Banner Grabbing/Basic connection
SMTP:
Using netcat
Using telnet
After receiving the following:
We can type in the HELO command to get the greeting message from the mail server.
A sample greeting is as follows:
SMTPS:
Finding MX servers of an organisation
Enumeration
Using SMTP commands
SMTP has three commands which can be used for enumeration:
VRFY: Validates users
EXPN: Displays the actual delivery addresses of aliases and mailing lists.
RCPT TO: Defines the recipients of the message
Using nmap
Lists all the SMTP commands available in the Nmap directory
Identify SMTP open relays
Enumerate all the mail users on the SMTP server
Using metasploit
Launch Metasploit msfconsole and switch to the relevant auxiliary scanner to initiate the process auxiliary/scanner/smtp/smtp_enum
.
Using smtp-user-enum
The smtp-user-enum
is a tool for enumerating OS-level user accounts on Solaris via the SMTP service (sendmail). Enumeration is performed by inspecting the responses to VRFY, EXPN, and RCPT TO commands.
The smtp-user-enum has the following options:
Last updated