• <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++博客 :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

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

            Posted on 2011-12-13 13:52 Prayer 閱讀(729) 評論(0)  編輯 收藏 引用 所屬分類: SOCKET
            =========先計算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==
            ======================開始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 # 開始認(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> # 郵件的接收方,若有多個收件人,則重復(fù)這一語句多次。
            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部分空一行開始寫
            . # 郵件寫完,以一個句點(diǎn)加回車結(jié)果。
            250 Mail OK queued as smtp10,wKjADQ2ApxRnnqBE0CWaEw==.38326S3 # 返回250 表示發(fā)送成功。
            NOOP # 空語句,不執(zhí)行任何操作,一般用來保持和服務(wù)器連接,不要掉線
            250 OK
            QUIT # 退出
            221 Closing connection. Good bye.
            Connection closed by foreign host.
            [crazywill@localhost crazywill]$


            ======================開始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表示查看整個郵件頭,其它正整數(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ā)信時偽造的一個假發(fā)送人信息,平時正常操作只顯示這個。
            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)聽OUTLOOK發(fā)送多人郵件分析出來的)
            同一封信發(fā)送/抄送給多人,在MAIL FROM:<...> 后,多次使用 RCPT TO:<...>
            每次一個郵件地址,需要發(fā)給多少人就 RCPT TO 多少次。

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

            CC與BCC的差別:同樣都是RCPT TO指定收件人,但是郵件客戶端程序,不會將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            # 列出符合條件的郵件序號(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)容,太長,略...]
            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                  # 空語句
            A11 OK NOOP completed


            A20 LOGOUT               #退出
            * BYE IMAP4rev1 Server logging out
            A20 OK LOGOUT completed
            Connection closed by foreign host.
            [crazywill@localhost crazywill]$
            国产A级毛片久久久精品毛片| 91精品国产91久久综合| 久久久久久九九99精品| 无码精品久久一区二区三区 | 色青青草原桃花久久综合| 国产精品一久久香蕉国产线看| 久久国产精品成人片免费| 久久国产精品77777| 久久99国产精品99久久| 久久久综合九色合综国产| 久久精品嫩草影院| 精品久久久久国产免费| 久久免费视频6| 久久无码国产专区精品| 蜜臀av性久久久久蜜臀aⅴ| 久久久久亚洲Av无码专| 69久久精品无码一区二区| 日韩精品国产自在久久现线拍| 青青青国产精品国产精品久久久久| 国产91久久综合| 国产精品久久新婚兰兰| 精品久久久久香蕉网| 国产精品99久久精品爆乳| 久久久久女教师免费一区| 久久只有这里有精品4| 久久精品国产亚洲AV电影| 99久久精品免费看国产| 国产香蕉久久精品综合网| 亚洲AV日韩AV天堂久久| 色综合久久精品中文字幕首页| 久久综合九色综合久99| 久久无码人妻一区二区三区| 久久青草国产精品一区| 久久精品国产2020| 久久精品www| 无码AV中文字幕久久专区| 国产精品热久久毛片| 久久偷看各类wc女厕嘘嘘| 亚洲人成无码www久久久| 精品久久久久久国产| 亚洲AV日韩精品久久久久久久|