Connecting
If from command line on Mac and Linux one can use openssl
. E.g:
openssl s_client -starttls smtp -4 -connect smtp.server.no:587 -crlf -ign_eof
-4
can be needed to force IPv4.
If from command line on Windows, one should not use the -crlf
option. E.g:
openssl s_client -starttls smtp -4 -connect smtp.server.no:587 -ign_eof
Hello
On successful connection and the welcoming 250 HELP
do the normal EHLO
:
EHLO nero<ENTER>
Yielding the server spec.
250-smtp.server.no Hello nero [1.2.3.4]
250-SIZE 157286400
250-8BITMIME
250-PIPELINING
250-PIPE_CONNECT
250-AUTH PLAIN LOGIN
250-CHUNKING
250 HELP
Authentication
Here I'm covering AUTH PLAIN
and AUTH LOGIN
.
- For
LOGIN
we need base-64 for username and password.
printf %s 'user' | base64
=> dXNlcg==
printf %s 'pass' | base64
=> cGFzcw==
- For
PLAIN
we need base-64 for 0x00Username0x00Password
printf '\0%s\0%s' 'user' 'pass' | base64
=> AHVzZXIAcGFzcw==
LOGIN
:
The login method commence as follows.
AUTH LOGIN<ENTER>
334 VXNlcm5hbWU6
dXNlcg==<ENTER>
334 UGFzc3dvcmQ6
cGFzcw==<ENTER>
235 Authentication succeeded
or (using username on AUTH line):
AUTH LOGIN dXNlcg==<ENTER>
334 UGFzc3dvcmQ6
cGFzcw==<ENTER>
235 Authentication succeeded
The responses are (in base-64):
VXNlcm5hbWU6
= Username:
UGFzc3dvcmQ6
= Password:
PLAIN
:
AUTH PLAIN<ENTER>
334
AHVzZXIAcGFzcw==<ENTER>
235 Authentication succeeded
Or AUTH, username and password in one line:
AUTH PLAIN AHVzZXIAcGFzcw==<ENTER>
235 Authentication succeeded
After this continue as normal with RCPT TO
etc. or what ever.
RCPT TO: [email protected]
withRENEGOTIATING<LF>139860672468096:error:1420410A:SSL routines:SSL_renegotiate:wrong ssl version:../ssl/ssl_lib.c:2127:
– Indaba