SMTP
About
Simple Mail Transfer Protocol (SMTP) is a protocol for sending emails in an IP network. It can be used between an email client and an outgoing mail server or between two SMTP servers. SMTP is often combined with the IMAP or POP3 protocols, which can fetch emails and send emails. In principle, it is a client-server-based protocol. Commonly it's using TCP/25 port for unencrypted SMTP, TCP/465 for encrypted, TCP/587 for SMTP STARTLS Encryption.
SMTP Servers
SMTP servers play a crucial role in preventing spam by supporting ESMTP with SMTP-Auth for authorized user-based email sending. The Mail User Agent (MUA) converts emails into headers and bodies, uploading them to the SMTP server. A Mail Transfer Agent (MTA) checks email size and spam, storing it after validation. Occasionally, a Mail Submission Agent (MSA) or Relay server validates email origin to prevent Open Relay Attacks. The MTA then searches DNS for the recipient mail server's IP address.
SMTP Commands
Connect
Usually to connect to SMTP server you could use just telnet and specify port.
VRFY
VRFY command is used for checking if the username is valid by requesting SMTP Server
EXPN
EXPN command is same as VRFY, but if you send it a distribution list, it'll send back all users from it.
RCPT TO
RCPT TO command specifies the recipient. The more times you use it, the more recipients you could find.
Microsoft 365
Sure here wouldn't be whole section about 365, but that's a common thing, so let's write here some basic enum techniques.
0365spray
O365spray is a tool for username enum and password spraying attack at Microsoft 365
Validate
Username Enum
Password Spraying
Tips2Hack
Nmap - Open Relay
Nmap - SMTP all scripts enum
DIG - Mail Server enum
Host Mail Server
smtp-user-enum script [LINK]
Hydra - Password attacks
If you know user, as example "den", don't use just username, use it with domain/email address, like den@amogus.com
Swaks - Send mail
Last updated