[TELNET] Telnet 을 이용한 Gmail 테스트 하기.

Category: Telnet | April 17, 2015

준비물

  • perl
  • openssl
  • telnet
  • 그리고 gmail 주소

Gmail 계정을 암호화 하기

id : zxcvbnm@gmail.com
pw : tyuiop (실제 계정 아님. 두번 아님.)

$ perl -MMIME::Base64 -e 'print encode_base64("\000zxcvbnm\@gmail.com\000tyuiop")' 
AHp4Y3Zibm1AZ21haWwuY29tAHR5dWlvcA==

계정과 비밀번호 앞에 '000'은 반드시 써줘야 함

PLAIN 방식으로 gmail에 접근한다.

$openssl s_client -starttls smtp -connect smtp.gmail.com:587 -crlf -ign_eof

아래는 테스트 참고 한 내용.

CONNECTED(00000003)
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA
verify error:num=20:unable to get local issuer certificate
verify return:0
---
Certificate chain
... 생략 ..
---
Server certificate
-----BEGIN CERTIFICATE-----
... 생략 ...
-----END CERTIFICATE-----
subject=/C=US/ST=California/L=Mountain View/O=Google Inc/CN=smtp.gmail.com
issuer=/C=US/O=Google Inc/CN=Google Internet Authority G2
---
No client certificate CA names sent
---
SSL handshake has read 3967 bytes and written 466 bytes
---
New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES128-GCM-SHA256
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : TLSv1.2
... 생략 ....
---
250 SMTPUTF8
EHLO test.com
250-mx.google.com at your service, [61.40.129.178]
250-SIZE 35882577
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN XOAUTH
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8
AUTH PLAIN AHp4Y3Zibm1AZ21haWwuY29tAHR5dWlvcA==
235 2.7.0 Accepted
MAIL FROM: <zxcvbnm @gmail.com>
250 2.1.0 OK m2sm8296731pdp.4 - gsmtp
RCPT TO: <test1111 @gmail.com>
250 2.1.5 OK m2sm8296731pdp.4 - gsmtp
DATA
354 Go ahead m2sm8296731pdp.4 - gsmtp
Subject: it works.!!!!</p>

ok?
good?

.</strong>
250 2.0.0 OK 1429230923 m2sm8296731pdp.4 - gsmtp
quit
221 2.0.0 closing connection m2sm8296731pdp.4 - gsmtp
read:errno=0

</blockquote>