• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            Prayer

            在一般中尋求卓越
            posts - 1256, comments - 190, trackbacks - 0, articles - 0
              C++博客 :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

            利用telnet進(jìn)行SMTP的驗(yàn)證

            Posted on 2011-12-13 13:52 Prayer 閱讀(738) 評(píng)論(0)  編輯 收藏 引用 所屬分類: SOCKET
            =========先計(jì)算BASE64編碼的用戶名密碼,認(rèn)證登錄需要用到===========
            [crazywill@localhost crazywill]$ perl -MMIME::Base64 -e 'print encode_base64("crazywill");'
            Y3Jhenl3aWxs

            [crazywill@localhost crazywill]$ perl -MMIME::Base64 -e 'print encode_base64("mypassword");'
            bXlwYXNzd29yZA==
            ======================開(kāi)始SMTP發(fā)信操作==========================
            [crazywill@localhost crazywill]$ telnet smtp.163.com 25 #telnet登錄25端口
            Trying 202.108.5.81...
            Connected to smtp.163.com.
            Escape character is '^]'.
            220 163.com Coremail SMTP(Anti Spam) System
            EHLO smtp.163.com # 握手 :)
            250-mail
            250-PIPELINING
            250-AUTH LOGIN PLAIN
            250-AUTH=LOGIN PLAIN
            250 8BITMIME
            AUTH LOGIN # 開(kāi)始認(rèn)證登錄
            334 dXNlcm5hbWU6
            crazywill
            334 UGFzc3dvcmQ6
            mypassword
            535 Error: authentication failed # 直接用戶名密碼不能登錄
            AUTH LOGIN
            334 dXNlcm5hbWU6
            Y3Jhenl3aWxs
            334 UGFzc3dvcmQ6
            bXlwYXNzd29yZA==
            235 Authentication successful # 使用Base64編碼則成功登錄
            MAIL FROM:<test@163.com> # 郵件發(fā)送方
            553 You are not authorized to send mail, authentication is required # 不可偽造發(fā)送郵件
            MAIL FROM:<crazywill@163.com> # 郵件發(fā)送方
            250 Mail OK
            RCPT TO:<crazywill@163.com> # 郵件的接收方,若有多個(gè)收件人,則重復(fù)這一語(yǔ)句多次。
            250 Mail OK
            DATA # 郵件體內(nèi)容
            354 Please start mail input.
            TO: crazywill@163.com # 此處的TO,F(xiàn)ROM,等內(nèi)容,可以隨便造假 :) 可以騙人但騙不了懂得查看郵件源碼的。
            FROM: cccc@163.com
            SUBJECT: test by telnet/smtp

            test, just a test. # 郵件正文內(nèi)容,與Header部分空一行開(kāi)始寫
            . # 郵件寫完,以一個(gè)句點(diǎn)加回車結(jié)果。
            250 Mail OK queued as smtp10,wKjADQ2ApxRnnqBE0CWaEw==.38326S3 # 返回250 表示發(fā)送成功。
            NOOP # 空語(yǔ)句,不執(zhí)行任何操作,一般用來(lái)保持和服務(wù)器連接,不要掉線
            250 OK
            QUIT # 退出
            221 Closing connection. Good bye.
            Connection closed by foreign host.
            [crazywill@localhost crazywill]$


            ======================開(kāi)始POP3收信操作==========================

            [crazywill@localhost crazywill]$ telnet pop.163.com 110 #telnet登錄110端口
            Trying 202.108.5.104...
            Connected to pop.163.com.
            Escape character is '^]'.
            +OK Welcome to coremail Mail Pop3 Server (163com[20050206])
            USER crazywill # 用戶名
            +OK core mail
            PASS mypassword # 登錄密碼
            +OK 254 message(s) [27676669 byte(s)]
            STAT # 查看郵箱狀態(tài)
            +OK 254 27676669
            LIST # 郵件列表
            +OK 254 27676669
            1 2468
            2 21945
            3 33136
            4 2071
            5 3364
            6 18906
            7 3136
            8 24764
            .................

            TOP 254 0 # 查看指定郵件的郵件頭,0表示查看整個(gè)郵件頭,其它正整數(shù)表示限制返回多少行。
            +OK core mail
            Received: from smtp.63.com (unknown [58.252.70.158])
            by smtp5 (Coremail) with SMTP id wKjREDrA9gIfFqlEjCnRAg==.29062S4;
            Mon, 03 Jul 2006 21:07:18 +0800 (CST)
            TO: crazywill@163.com
            FROM : cccc@163.com # 這里即前面發(fā)信時(shí)偽造的一個(gè)假發(fā)送人信息,平時(shí)正常操作只顯示這個(gè)。
            SUBJECT: test by telnet/smtp # 郵件主題
            Message-Id: <44A91687.0E6F6C.07562>
            Date: Mon, 3 Jul 2006 21:07:19 +0800 (CST)
            Sender: crazywill@163.com # 這里是真正的發(fā)送人,不可偽造。


            .
            RETR 254 # 獲取指定郵件
            +OK 354 octets
            Received: from smtp.63.com (unknown [58.252.70.158])
            by smtp5 (Coremail) with SMTP id wKjREDrA9gIfFqlEjCnRAg==.29062S4;
            Mon, 03 Jul 2006 21:07:18 +0800 (CST)
            TO: crazywill@163.com
            FROM : cccc@163.com
            SUBJECT: test by telnet/smtp
            Message-Id: <44A91687.0E6F6C.07562>
            Date: Mon, 3 Jul 2006 21:07:19 +0800 (CST)
            Sender: crazywill@163.com

            test, just a test.
            .

            DELE 254 # 刪除第254封郵件
            +OK core mail
            STAT # 查看郵箱狀態(tài)
            +OK 253 27676315
            QUIT # 退出
            +OK core mail
            Connection closed by foreign host.
            [crazywill@localhost crazywill]$


            ===============================================================

            QUESTION:
            如何發(fā)送給多人,如何CC,BCC?

            ANSWER: (此答案由SnifferPro監(jiān)聽(tīng)OUTLOOK發(fā)送多人郵件分析出來(lái)的)
            同一封信發(fā)送/抄送給多人,在MAIL FROM:<...> 后,多次使用 RCPT TO:<...>
            每次一個(gè)郵件地址,需要發(fā)給多少人就 RCPT TO 多少次。

            在DATA里面寫的CC,BCC,TO,等信息只起顯示作用,與實(shí)際發(fā)送人接收人無(wú)關(guān)。

            CC與BCC的差別:同樣都是RCPT TO指定收件人,但是郵件客戶端程序,不會(huì)將BCC的收件人寫到DATA要傳送的數(shù)據(jù)里。
             
            使用IMAP
            [crazywill@localhost crazywill]$ telnet 192.168.0.1 143      #telnet登錄IMAP協(xié)議的143端口
            Trying 192.168.0.1...
            Connected to xxxxxx
            Escape character is '^]'.
            * OK xxxxxxx System IMap Server Ready
            A01 LOGIN abc 123       #用戶登錄
            A01 OK LOGIN completed
            A02 LIST "" *           #列出所有信箱列表
            * LIST () "/" "INBOX"
            * LIST () "/" "Drafts"
            * LIST () "/" "Sent Items"
            * LIST () "/" "Trash"
            * LIST () "/" "Junk E-mail"
            * LIST () "/" "Virus Items"
            * LIST () "/" "&XfJT0ZABkK5O9g-"
            * LIST () "/" "&g0l6Pw-"
            * LIST () "/" "&XfJT0ZABkK5O9g-/DailyReport"
            * LIST () "/" "Jira"
            * LIST () "/" "Admin"
            * LIST () "/" "&V4NXPpCuTvY-"
            A02 OK LIST Completed
            A03 Select INBOX         #選擇收件箱
            * 37 EXISTS
            * 0 RECENT
            * OK [UIDVALIDITY 1] UIDs valid
            * FLAGS (\Answered \Seen \Deleted \Draft)
            * OK [PERMANENTFLAGS (\Answered \Seen \Deleted \Draft)] Limited
            A03 OK [READ-WRITE] SELECT completed
            A04 Search ALL           #查詢收件箱所有郵件
            * OK X-SEARCH in progress
            * OK X-SEARCH in progress
            * OK X-SEARCH in progress
            * SEARCH 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
            A04 OK SEARCH completed            # 列出符合條件的郵件序號(hào)(ALL表示列出當(dāng)前信箱INBOX中的所有郵件)
            A05 Search new           #查詢收件箱所有新郵件
            * OK X-SEARCH in progress
            * OK X-SEARCH in progress
            * OK X-SEARCH in progress
            * SEARCH
            A05 OK SEARCH completed            #找不到任何新郵件
            A06 Fetch 5 full         #獲取第5封郵件的郵件頭
            * 5 FETCH (INTERNALDATE "27-Jun-2006 14:00:27 +0800" FLAGS (\Seen) ENVELOPE ("Tue, 27 Jun 2006 13:56:51 +0800" "test " (("xxxxxx" NIL "xxxx" "xxxxxx")) (("xxxxxx" NIL "xxxx" "xxxxxx")) (("xxxxxx" NIL "xxxx" "xxxxxx")) ((NIL NIL "xxx" "xxxxx")) NIL NIL NIL "<000f01c699ae$7c5014a0$6b01a8c0@xxxxxx.xx>") BODY (("text" "plain" ("charset" "gb2312") NIL NIL "base64" 14 2) ("text" "html" ("charset" "gb2312") NIL NIL "base64" 420 7) "alternative") RFC822.SIZE 1396)
            A06 OK Fetch completed
            A07 Fetch 5 rfc822       #獲取第5封郵件的完整內(nèi)容
            * 5 FETCH (RFC822 {1396}
            [這里是郵件內(nèi)容,太長(zhǎng),略...]
            A07 OK Fetch completed
            A08 Fetch 5 flags        #查詢第5封郵件的標(biāo)志位
            A08 OK Fetch completed
            A09 Store 5 +flags.silent (\deleted)          #設(shè)置標(biāo)志位為刪除
            A09 OK STORE completed
            A10 Expunge              #永久刪除當(dāng)前郵箱INBOX中所有設(shè)置了\deleted標(biāo)志的信件
            A10 OK EXPUNGE completed
            A11 noop                  # 空語(yǔ)句
            A11 OK NOOP completed


            A20 LOGOUT               #退出
            * BYE IMAP4rev1 Server logging out
            A20 OK LOGOUT completed
            Connection closed by foreign host.
            [crazywill@localhost crazywill]$
            久久婷婷午色综合夜啪| 久久99精品久久久久久水蜜桃| 蜜桃麻豆WWW久久囤产精品| 97精品依人久久久大香线蕉97| 亚洲女久久久噜噜噜熟女| 嫩草影院久久国产精品| 亚洲另类欧美综合久久图片区| 久久久久人妻一区精品色| 青青青国产精品国产精品久久久久| 久久精品国产精品亜洲毛片| 性高湖久久久久久久久| 久久国产精品偷99| 精品久久久久久久久午夜福利| 国产一级持黄大片99久久| 久久久精品波多野结衣| 国内精品久久久久久99蜜桃 | 欧美激情精品久久久久久久九九九| 亚洲伊人久久成综合人影院 | 欧美熟妇另类久久久久久不卡 | 手机看片久久高清国产日韩| 久久最近最新中文字幕大全| 亚洲国产精品无码久久| 久久综合九色欧美综合狠狠| 日本三级久久网| 久久久中文字幕| 99国产欧美久久久精品蜜芽| 99久久国产精品免费一区二区 | 狠狠色丁香婷婷综合久久来| 亚洲午夜久久久久久噜噜噜| 久久人妻无码中文字幕| 人妻无码久久精品| 久久人搡人人玩人妻精品首页| 国产精品一区二区久久| 2021久久国自产拍精品| 日韩精品久久无码中文字幕| 久久国产劲爆AV内射—百度| 久久国产精品一区| 伊人久久无码精品中文字幕| 日本人妻丰满熟妇久久久久久| 久久综合给久久狠狠97色 | 久久亚洲春色中文字幕久久久|