Swaks 是一個功能強大,靈活,可編寫腳本,面向事務的 SMTP 測試工具,目前 Swaks 託管在私有 svn 存儲庫中。 官方項目 http://jetmore.org/john/code/swaks/
kali 自帶 swaks 工具,無需安裝服務器
swaks --to xxx@qq.com
拿個人 QQ 舉例svn
root@kali:~ ➤ swaks --to 1871973389@qq.com 01:59:06 === Trying mx3.qq.com:25... === Connected to mx3.qq.com. <- 220 newxmmxsza22.qq.com MX QQ Mail Server. -> EHLO kali.lan <- 250-newxmmxsza22.qq.com <- 250-STARTTLS <- 250-SIZE 73400320 <- 250 OK -> MAIL FROM:<root@kali.lan> <- 250 OK. -> RCPT TO:<1871973389@qq.com> <- 250 OK 1 -> DATA <- 354 End data with <CR><LF>.<CR><LF>. -> Date: Sat, 07 Dec 2019 01:59:07 -0500 -> To: 1871973389@qq.com -> From: root@kali.lan -> Subject: test Sat, 07 Dec 2019 01:59:07 -0500 -> Message-Id: <20191207015907.007285@kali.lan> -> X-Mailer: swaks v20190914.0 jetmore.org/john/code/swaks/ -> -> This is a test mailing -> -> -> . <- 250 Ok: queued as -> QUIT <- 221 Bye. === Connection closed with remote host.
返回 250 Ok,說明該郵箱能夠正常通訊。工具
QQ 的 或 163 官網的均可以,我的感受 163 的還方便些測試
記住 smtp 的密碼code
swaks --to 收件箱 --from 發件箱 --body 郵件內容 --header "Subject:hello" --server smtp.qq.com -p 25 -au 發件箱 -ap SMTP的密碼
參數說明:server
--to //收件人郵箱; --from //發件人郵箱; --ehlo qq.com //僞造郵件的ehlo頭,即發件人郵箱的域名,身法認證; --body "https://goobe.io" //引號內爲郵件正文; --header "Subject:hello" //郵件頭信息,Subject爲郵件標題; --data email.txt //將正常郵件內容保存成TXT文件,再做爲正常郵件發出; --help 顯示命令幫助 --verison 顯示版本信息 輸出內容的含義: 「===」:swaks輸出的信息行 「*「:swaks中產生的錯誤 」 ->」:發送到目標的預期行(無錯誤) 「<- 「:服務器的預期回覆(無錯誤) 「<**」:服務器返回的錯誤信息
swaks --to 收件箱 --from 發件箱 --body 郵件內容 --header "Subject:hello" --attach example.doc --server smtp.qq.com -p 25 -au 發件箱 -ap SMTP密碼
--data email.txt //將正常郵件內容保存成TXT文件,再做爲正常郵件發出
發送內容爲 email.txt (記得添加文件路經) 裏的所有內容
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =事務
先找一分郵件,查看郵件原文,複製裏面的內容,存爲 .txtrem
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
去掉 Received 和 To 兩行 (發送時用 --from 和 --to 代替)
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =域名
swaks --data ./email.txt --to 收件箱 --from 發件箱 --server smtp.qq.com -p 25 -au 發件箱 -ap SMTP密碼
收件箱收到的是 email.txt 裏的內容it