When configuring mail servers, it is often necessary to test services in the simplest way possible. In this article, I will explain how to send an email via telnet using a mail server that requires authentication.
The first step is to obtain the password in base64:
perl -MMIME::Base64 -e 'print encode_base64("\000kr0m@alfaexploit.com\000PASSWORD")'
WGp1EW5qw0Bm45msdHASHINVENTADOWFpbnRlcm5ldC5jb20Ac2FtdEE4
Connect via telnet to port 25 and authenticate:
telnet dc-fbd63f6e-mail.alfaexploit.com 25
Connected to dc-fbd63f6e-mail.alfaexploit.com.
Escape character is '^]'.
220 mail.alfaexploit.com ESMTP Postfix
ehlo A.B.C.D
250-mail.alfaexploit.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
AUTH PLAIN WGp1EW5qw0Bm45msdHASHINVENTADOWFpbnRlcm5ldC5jb20Ac2FtdEE4
235 2.7.0 Authentication successful
quit
221 2.0.0 Bye
Connection closed by foreign host.