Skip to content

Simple Mail Transfer Protocol, port 25/587, TCP Envoie/réception de mails, sans utilisation de STARTTLS les informations transitent en clair sur le réseau. Client (MUA) ➞ Submission Agent (MSA) ➞ Open

Il est possible d'utiliser SMTP en se connectant directement en telnet sur le port 25, les commandes disponibles sont:

CommandDescription
AUTH PLAINAUTH is a service extension used to authenticate the client.
HELOThe client logs in with its computer name and thus starts the session.
MAIL FROMThe client names the email sender.
RCPT TOThe client names the email recipient.
DATAThe client initiates the transmission of the email.
RSETThe client aborts the initiated transmission but keeps the connection between client and server.
VRFYThe client checks if a mailbox is available for message transfer.
EXPNThe client also checks if a mailbox is available for messaging with this command.
NOOPThe client requests a response from the server to prevent disconnection due to time-out.
QUITThe client terminates the session.

Enumeration

Connection telnet:

bash
nc -vn $ip 25

Connection openssl (si utilisation de starttls):

bash
openssl s_client -starttls smtp -crlf -connect $domain:587

Savoir si le serveur peut être utilisé comme open relay:

bash
sudo nmap $ip -p25 --script smtp-open-relay -v

Connaître les différentes commandes pourvant être utilisées:

bash
nmap -p25 --script smtp-commands $ip

Brute force

Brute force des users:

bash
nmap --script smtp-enum-users $ip
bash
smtp-user-enum -M <MODE> -u <USER> -t $ip

Brute force password:

bash
hydra -l monUser -P /usr/share/seclists/Passwords/xato-net-10-million-passwords-1000000.txt $ip smtp

Metasploit

auxiliary/scanner/smtp/smtp_enum