我如何操作电子邮件中的“发件人”字段,并使“发件人”看到与实际不同的内容。
例:
真的从
From: [email protected]
但他们看到了
From: Tremayne "Top Dog" Stamper
我听说过它操纵SMTP,但真的不知道这是多么准确或如何做到这一点
在它的基础上,SMTP只是一个基于文本的协议,没有真正的validation。 这是一个例子:
=== Trying g3.example.net:25... === Connected to g3.example.net. <- 220 home.example.net ESMTP Exim 4.68 Thu, 07 May 2009 11:03:21 -0400 -> EHLO g3.example.net <- 250-home.example.net Hello g3.example.net [192.168.0.4] <- 250-SIZE 52428800 <- 250-PIPELINING <- 250-AUTH CRAM-SHA1 CRAM-MD5 MSN <- 250-STARTTLS <- 250 HELP -> MAIL FROM:<[email protected]> <- 250 OK -> RCPT TO:<[email protected]> <- 250 Accepted -> DATA <- 354 Enter message, ending with "." on a line by itself -> Date: Thu, 07 May 2009 11:03:21 -0400 -> To: [email protected] -> From: [email protected] -> Subject: test Thu, 07 May 2009 11:03:21 -0400 -> X-Mailer: swaks v20070921.0-dev jetmore.org/john/code/#swaks -> -> This is a test mailing -> -> . <- 250 OK id=KJA4HL-0006M6-8T -> QUIT <- 221 home.example.net closing connection === Connection closed with remote host.
“MAIL FROM:”行定义了SMTP信封发件人,并且在信息DATA中定义了From:。 有办法来防止这种情况,但它们是在邮件服务器逻辑中定义的,而不是在协议本身中定义的。
例如,作为邮件提供者,我可能会要求用户使用user @ domaintypes的用户名进行身份validation。 然后,我的邮件服务器可能会要求他们发送的任何邮件都有一个信封发件人和一个From:邮件头,它们与他们身份validation的用户相匹配。 像DKIM和SPF的其他技术也可以帮助在这方面。
这里有几个不同的事情需要考虑。 如果您只想显示不同的名称或电子邮件地址,请将消息的“From”标题(来自地址的消息)设置为括号中显示名称的电子邮件地址,如下所示:
来自:<Joe示例> [email protected]
请记住,邮件标题中的“从”行仅用于显示目的。 实际的路由由SMTP信封地址完成。 这是SMTP服务器实际用于在服务器之间传输消息的内容。 这可能与“来自”标题的消息不同。 如果您有一个自定义的SMTP引擎,只需使用SMTP信封中的一个地址,并在实际消息的“from”标题中使用另一个地址。
有许多合理的理由,你可能想要做到这一点,但请避免恶意的目的。
telnet some_smtp_server.com 25 ehlo whatsup mail from: [email protected] rcpt to: [email protected] data your message here end with a dot on a single line like this: .
当然,你将需要一个SMTP服务器,允许中继,这几乎是不可能find…或滚动自己的(只是不要使用这个知识垃圾邮件!)。
“真正来自”地址来自SMTP对话中的“from:”对话框。
“假来源”来自利用电子邮件客户端中显示SMTP会话的数据部分中列出的各种头部字段的惯例。 例如:
# telnet mail.example.com 25 Connected to mail.example.com. Escape character is '^]'. 220 mail.example.com ESMTP Postfix helo fakeserver 250 mail.example.com mail from: [email protected] 250 2.1.0 OK rcpt to: [email protected] 250 2.1.5 Ok data 354 End data with <CR><LF>.<CR><LF> from: [email protected] to: [email protected] subject: This is a subject This is the body. . 250 2.0.0 Ok: queued as 90D0F95A06 quit 221 2.0.0 Bye Connection closed by foreign host. #
如果您在数据部分中遗漏了“from:”和“to:”行,则会显示实际的信封发件人和收件人。
请注意,这些技巧经常被垃圾邮件filter所查找,并且不会让您成为任何永久的朋友。 此外,这不适用于所有的邮件客户端(只是最常见的)。
是的,这是通过手动设置SMTP标头,是微不足道的完成。 去谷歌上查询。 但不要被发现垃圾邮件……
这个我的2c直接出来的代码 – 用C#
public static void SendSpam(string message, string to) { System.Net.Mail.MailMessage myMessage = new System.Net.Mail.MailMessage("Fake Name", to); myMessage.Subject = "SPAM"; myMessage.Body = message; System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("mail.mailserver.com", 25); System.Net.NetworkCredential c = new System.Net.NetworkCredential("[email protected]", "realpassword"); client.Credentials = c; client.Send(myMessage); }