SMTP,the short form of
Simple Mail Transfer Protocol, is one of the most common used protocols for sending emails. But how secure is it?
A SMTP mail usually consists of
- Sender
- Receiver
- Subject
- Date
- Content
Usually in the format
From: mail@example.com
To: mail2@example.com
Subject: TheSubject
Date: Thu, 03 Oct 2012 11:11:11 +0200
TheContent
So we can see that the important information (sender,receiver,subject) is stored in the header of the mail. Also,the protocols for reading mails (
IMAP,
POP3) shows the sender/receiver/subject stored in the header. This is definitely one of the most important security leaks of SMTP, as someone,who writes a mail by hand (e.g. with a command-line or script) can manipulate this data,to show a different sender/receiver.
These manipulated mails are called
Shadow Mails.
To create a
Shadow Mail you will have to write it by hand with a telnet-connection to a smtp server or by using a scripting-language.
So a example how you could create a mail with a fake sender in Python
#Python 2.7.2
from email.message import Message
import smtplib
msg = Message()
msg['From'] = 'notme@example.com'
msg['To'] = 'receiver@example.com'
msg['Subject'] = 'Shadow Mail'
msg['Date'] = 'Mon, 14 Apr 2012 20:00:41 +0200'
msg.set_payload('This is a Shadow Mail...') # <-- Content of the mail
text = msg.as_string() # <-- Converts data in to upper format
smtp = smtplib.SMTP('smtp.example.com')
smtp.login('mymail@example.com','mypasswd')
smtp.sendmail('mymail@example.com','receiver@example.com',text) # <-- Real mail!
smtp.quit()
Now imagine spam-bots would use this too...
You wouldn't be able to know if it's the real sender or a fake sender...
But this protocol is still in use,but it has to be said that there are already more secure ways,where this trick can't be used anymore (e.g.
PGP or
SPF)
BTW,If you are too lazy to write that upper code again and again,I'm working on a
ShadowMail SMTP-client right now ^^
Download Executeable for Windows,or
Download Python-Compiled for Linux