SMTP (25,465,587)

Username enumeration (VRFY command)

rednorth@htb[/htb]$ telnet 10.129.14.128 25 
Trying 10.129.14.128... 
Connected to 10.129.14.128. 
Escape character is '^]'. 
220 ESMTP Server  
VRFY root 
252 2.0.0 root

Username bruteforce

Using smtp-user-enum

smtp-user-enum -M VRFY -U users.txt -t 10.129.42.195

Using metasploit (better to use if high response time)

msfconsole
use scanner/smtp/smtp_enum
set RHOSTS $ip
set USER_FILE /home/rednorth/users.txt
run

Footprinting using nmap (includes smtp-commands in nse)

nmap 10.129.14.128 -sC -sV -p25

Open relay using nmap

Notes:

port 25 - (server-to-server communication) port 587 - newer (client-to-server communication); starts with STARTTLS so its more secure than port 25 port 465 - smtps

Misconfigurations

Authentication

Username Enumeration

SMTP User Enum

-M is mode [VRFY, EXPN, RCPT] -D depends on the server configuration if it needs a domain

Cloud Enumeration

Password Attacks

o365sprayarrow-up-right or MailSniperarrow-up-right for Microsoft Office 365 or CredKingarrow-up-right for Gmail or Okta

Protocol Specific Attacks

Open relay

Last updated