SMTP邮箱登录验证

通过telnet命令连接smtp邮箱验证

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# telnet smtp.163.com 25
Trying 220.181.12.15...
Connected to smtp.163.com.
Escape character is '^]'.
220 163.com Anti-spam GT for Coremail System (163com[20141201])
EHLO 163.com
250-mail
250-PIPELINING
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-coremail 1Uxr2xKj7kG0xkI17xGrU7I0s8FY2U3Uj8Cz28x1UUUUU7Ic2I0Y2UFxjkZGUCa0xDrUUUUj
250-STARTTLS
250 8BITMIME
AUTH LOGIN
334 dXNlcm5hbWU6
<Base64加密后的用户名>
334 UGFzc3dvcmQ6
<Base64加密后的授权码>
235 Authentication successful
MAIL FROM:xxx@163.com
250 Mail OK
RCPT TO:xxxx@163.com
250 Mail OK
DATA
354 End data with <CR><LF>.<CR><LF>
subject:test
Telnet smtp test
.

通过openssl s_client命令连接smtp邮箱验证(TLS/SSL)

如果SMTP使用了TLS/SSL加密,连接时需要执行STARTTLS指令,则需要使用openssl s_client建立TLS/SSL加密传输会话。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# telnet smtp.qq.com 587
Trying 14.17.57.241...
Connected to smtp.qq.com.
Escape character is '^]'.
220 smtp.qq.com Esmtp QQ Mail Server
EHLO qq.com
250-smtp.qq.com
250-PIPELINING
250-SIZE 73400320
250-STARTTLS
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN
250-MAILCOMPRESS
250 8BITMIME
AUTH LOGIN
530 Must issue a STARTTLS command first.
STARTTLS
220 Ready to start TLS
<这里开始邮件内容的通讯就被保护起来了>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# openssl s_client -starttls smtp -connect smtp.qq.com:587 -crlf
CONNECTED(00000003)
depth=2 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert Global Root CA
verify return:1
depth=1 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = GeoTrust RSA CA 2018
verify return:1
depth=0 C = CN, ST = Guangdong, L = Shenzhen, O = Shenzhen Tencent Computer Systems Company Limited, OU = R&D, CN = pop.qq.com
verify return:1
---
Certificate chain
0 s:/C=CN/ST=Guangdong/L=Shenzhen/O=Shenzhen Tencent Computer Systems Company Limited/OU=R&D/CN=pop.qq.com
i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=GeoTrust RSA CA 2018
1 s:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=GeoTrust RSA CA 2018
i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Global Root CA
---
Server certificate
-----BEGIN CERTIFICATE-----
MIIHTTCCBjWgAwIBAgIQAuRNdDX1RaHDYpqxvEjceDANBgkqhkiG9w0BAQsFADBe
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMR0wGwYDVQQDExRHZW9UcnVzdCBSU0EgQ0EgMjAxODAe
Fw0xODA0MTAwMDAwMDBaFw0xODEyMDcxMjAwMDBaMIGTMQswCQYDVQQGEwJDTjES
MBAGA1UECBMJR3Vhbmdkb25nMREwDwYDVQQHEwhTaGVuemhlbjE6MDgGA1UEChMx
U2hlbnpoZW4gVGVuY2VudCBDb21wdXRlciBTeXN0ZW1zIENvbXBhbnkgTGltaXRl
ZDEMMAoGA1UECwwDUiZEMRMwEQYDVQQDEwpwb3AucXEuY29tMIIBIjANBgkqhkiG
9w0BAQEFAAOCAQ8AMIIBCgKCAQEAt5JjtVvrQK+/s/Y77OFpmeqXP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ljZXJ0LmNvbS9DUFMwCAYGZ4EM
AQICMHQGCCsGAQUFBwEBBGgwZjAlBggrBgEFBQcwAYYZaHR0cDovL29jc3AxLmRp
Z2ljZXJ0LmNvbTA9BggrBgEFBQcwAoYxaHR0cDovL2NhY2VydHMuZ2VvdHJ1c3Qu
Y29tL0dlb1RydXN0UlNBQ0EyMDE4LmNydDAJBgNVHRMEAjAAMIIBBQYKKwYBBAHW
eQIEAgSB9gSB8wDxAHYApLkJkLQYWBSHuxOizGdwCjw1mAT5G9+443fNDsgN3BAA
AAFirwooDwAABAMARzBFAiEA8pVQZaUJ79lQFavjUuZzM0xhsEw3yTrHsw5itR1X
70cCIC1EffzQ+AUNtAyqqL49IBTUZV2uXCLTewVylOMwi+XEAHcAb1N2rDHwMRnY
mQCkURX/dxUcEdkCwQApBo2yCJo32RMAAAFirwopfAAABAMASDBGAiEAibcXAiR8
FPPtrZepqRoH9KSDd7yop8dTbfPwRbMGTggCIQCU9OxTnYjwN56raHOJwUmwSPVy
i8+xMycUQ2LhFPbTMjANBgkqhkiG9w0BAQsFAAOCAQEAerJCCpS1eEvIKlGUngDa
DXaUlCTepYcfGxspi6bdE1XkdSrW9bKOoMY4Q0AijKHrf0StAiZ4FRGE/FS1YtIY
1P7x3hdfaelGwIPBOba2ZgGBuPKmRAuaFUKPbQLBe8vY4N6e3HRXdgHFNKJHefu+
evmov1eNyxPsxLyM5ctMHGmPGlfz+NaWnyqy/SfB63lrhlOR0ZaI6+7WJl+rJM/R
of7tBkkvl1SZfgXX45RJK+iJHJxDoXg7TwsowKXqpPxFwtZWAGQzkju/PqQFZpN+
Xos4+Y0ZfSzGe1xAMuczTKknAk4BKSpKWKmzvthUWtnJD1K/rtC71ZZjPkZ/Efqi
bw==
-----END CERTIFICATE-----
subject=/C=CN/ST=Guangdong/L=Shenzhen/O=Shenzhen Tencent Computer Systems Company Limited/OU=R&D/CN=pop.qq.com
issuer=/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=GeoTrust RSA CA 2018
---
No client certificate CA names sent
---
SSL handshake has read 3594 bytes and written 682 bytes
---
New, TLSv1/SSLv3, Cipher is AES128-SHA256
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : AES128-SHA256
Session-ID: B6FC7443D745A3A56F3C96F7F4E30F763A5319F9872DE3B96CC1F5CAE7C67C2D
Session-ID-ctx:
Master-Key: 4884C5DD8FD046B265E09DDE6A95032C552916ADC51FD2FF7F4A198994A6E2C9775005C5A9838DB1E939C6ABE1F22EB4
Key-Arg : None
Krb5 Principal: None
PSK identity: None
PSK identity hint: None
TLS session ticket lifetime hint: 1200 (seconds)
TLS session ticket:
0000 - ef b7 06 39 df b9 ec 34-48 8b da 1d af 42 0d 24 ...9...4H....B.$
0010 - e8 bb df 51 f3 b9 1b 6c-02 26 30 d1 ee b2 6a a7 ...Q...l.&0...j.
0020 - 26 c1 5a 32 b8 4d 5a 00-a1 df 78 db 94 90 0c a6 &.Z2.MZ...x.....
0030 - 02 2c ce 4f ab 5e 65 52-5c 41 e3 7d a6 52 ef 9e .,.O.^eR\A.}.R..
0040 - 58 b2 cc 66 c4 e1 49 be-50 1c 3c f5 87 5d 17 ff X..f..I.P.<..]..
0050 - d8 08 e4 fc 37 ab 36 8d-ba c9 8e f0 a8 02 c8 bd ....7.6.........
0060 - a6 7c 9f 2a d7 bb 35 6c-7e 86 90 ff 2e b0 96 27 .|.*..5l~......'
0070 - 73 65 59 8d 91 b5 34 9f-4b 36 3d 8c 91 57 6d 63 seY...4.K6=..Wmc
0080 - d9 eb 1f d6 8c e1 fb 11-e3 66 cc 3f 22 7e 7b fd .........f.?"~{.
0090 - e6 29 8e b9 7c 8a cb a3-f5 10 30 78 0e 4f 8c 45 .)..|.....0x.O.E

Start Time: 1527728623
Timeout : 300 (sec)
Verify return code: 0 (ok)
---
250 8BITMIME
EHLO qq.com
250-smtp.qq.com
250-PIPELINING
250-SIZE 73400320
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN
250-MAILCOMPRESS
250 8BITMIME
AUTH LOGIN
334 VXNlcm5hbWU6
<现在就可以输入Base64加密后用户名、密码进行验证>
坚持原创技术分享,您的支持将鼓励我继续创作!
0%