在kali中自帶一個郵件僞造工具Swaks,工具項目主頁爲 http://jetmore.org/john/code/swaks
swaks --to <要測試的郵箱> --from <被僞造的郵箱> --ehlo <網址> --body <郵件內容> --header <郵件標題> html
swaks --to xxxx@qq.com --from info@freebuf.com --ehlo freebuf.com --body hello --header "Subject: hello"安全
這個工具的原理是將STMP郵件命令封裝起來,填寫好參數後經過TCP發送。服務器
工具源碼:http://jetmore.org/john/code/swaks/files/swaks-20170101.0/swaks工具
$n{data} ||= 'Date: %DATE%\nTo: %TO_ADDRESS%\nFrom: %FROM_ADDRESS%\nSubject: test %DATE%\n' . "Message-Id: <%MESSAGEID%>\n" . "X-Mailer: swaks v%SWAKS_VERSION% jetmore.org/john/code/swaks/".'\n' . ($bound ? 'MIME-Version: 1.0\nContent-Type: multipart/mixed; boundary="'.$bound.'"\n' : '') . '%NEW_HEADERS%' . # newline will be added in replacement if it exists '\n' . '%BODY%\n';
阿里雲郵箱-查看郵件原文-Received字段就是發送郵件人的IP源碼分析
QQ郵箱-查看郵件原文測試
原文中的Received字段就是發件人的IP地址阿里雲
Received: from 36x.cn (unknown [192.119.131.28]) by newmx21.qq.com (NewMx) with SMTP id for <xxxxx@qq.com>; Tue, 27 Mar 2018 13:25:07 +0800 X-QQ-SPAM: true X-QQ-FEAT: s2GiS5gUmyK+eXv9+I/fePc92oQJu9XHtWyzT9PgGcvSpn7dWJrxhFyEnAwTo irizSvrfxLHBO0Uqb7XWddQ8Z9xc80zMicgaf6pyCj+5EaD7jNpPkUj3Q43vgXfmxscAQZm Oe6ApiG6Du5QFkISrDjb+OQ0ZZZZRHH8i0TOVHHHDCvYHF8RBXG44G53 MmI3Lhj8CoWPztQ9Oftn5LlkK0/8nxZ1BbYhzKovOY3U27E1qlNUYRLLzC3X3NSs= X-QQ-MAILINFO: M9mpTqh4QKvqUsonnjk0JTAHsII3lq/kTlJ+R+7KGWo2g8ZOmN0AZJRqQ muQ8LXR8jVXXZZZEZTaXbafIHHHHHVNffL3voKA1fvkRCxucXzc= X-QQ-mid: mx21t1522128307tnl9i9x2f X-QQ-ORGSender: linwei@36x.cn Date: Sat, 06 Jan 2018 03:02:36 +0800 To: xxxxx@qq.com From: linwei@36x.cn Subject:36x CERT X-Mailer: swaks v20130209.0 jetmore.org/john/code/swaks/ welcome
經過telnet客戶端發Email,以下圖所示:.net
僞造請求後,能夠看到發送的命令。以下圖所示:3d
root@kali:~# swaks --to xxxx@qq.com === Trying mx3.qq.com:25... === Connected to mx3.qq.com. <- 220 newmx59.qq.com MX QQ Mail Server -> EHLO kali <- 250-newmx59.qq.com <- 250-SIZE 73400320 <- 250-STARTTLS <- 250 OK -> MAIL FROM:<root@kali> <- 250 Ok -> RCPT TO:<xxxx@qq.com> <- 250 Ok -> DATA <- 354 End data with <CR><LF>.<CR><LF> -> Date: Tue, 05 Jan 2016 23:15:11 -0500 -> To: xxxx@qq.com -> From: root@kali -> Subject: test Tue, 05 Jan 2016 23:15:11 -0500 -> X-Mailer: swaks v20130209.0 jetmore.org/john/code/swaks/ -> -> This is a test mailing -> -> . <** 550 Mail content denied. http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=20022&&no=1000726 -> QUIT <- 221 Bye === Connection closed with remote host.
釣魚郵件初探:黑客是如何進行郵件僞造的?code
http://www.freebuf.com/sectool/92397.html
郵件發送和接收原理
https://blog.csdn.net/qq_15646957/article/details/52544099