Problem solve Get help with specific problems with your technologies, process and projects.

Exposing SMTP and IMAP’s security vulnerabilities in Exchange Server

Even though SMTP and IMAP have built-in features to protect Exchange’s external mail transmissions, both protocols are still susceptible to security vulnerabilities. See how easily both can be compromised.

Both SMTP and IMAP have several built-in security features that help Exchange organizations that rely on the protocols...

to communicate securely. However, both protocols are also quite vulnerable. SMTP can be easily manipulated to send large amounts of spam and the authentication process in IMAP can be circumvented to steal passwords.


SMTP vulnerabilities

The biggest problem with the SMTP protocol is that it was not designed with security in mind. It was initially assumed that all mail servers could be trusted and that users would not abuse the system. Because of this, SMTP was designed to send mail using a series of commands that were all sent in clear text.

When you use an application like Microsoft Outlook to send SMTP mail, you don’t see the commands that are processed behind the scenes. However, this is only because the mail client processes the commands internally and obscures them from view. It’s actually possible to connect to an SMTP server and send a message using a series of commands.

You can actually do this by telnetting to your SMTP server. To do so, open a Command Prompt window and enter the Telnet command, followed by your server’s IP address and the number 25 (because SMTP uses Port 25). For example, your command might look like this:

Telnet 192.168.0.1 25

After setting this up, you must enter a series of commands. Your SMTP server should issue a response after each command. You can use these commands to take on any identity you like. For example, suppose you want to pose as Anonymous@contoso.com and send a message to Admin@northwind.com.

First, you must convince the SMTP server that you’re using a computer in an SMTP domain. To do so, you would issue the HELO command, along with the fully qualified domain name of your computer. The name that you enter doesn’t matter, as long as it ends in Contoso.com. For example, you could use:

HELO: computer.contoso.com

Next, you must tell the SMTP server who the message is from. Do this by using the Mail From: command. If you still want the message to look like it came from Anonymous@contoso.com, the command would look like this:

MAIL FROM: Anonymous@contoso.com

The other commands used to manually send SMTP mail are fairly self-explanatory. Below, you can see an example of an SMTP conversation. In this conversation, you can see the commands that were issued, as well as the server’s responses:

telnet 192.168.0.25 25
220 mirage.production.com Microsoft ESMTP MAIL Service ready at Sun, 8 Aug
2010 22:44:59 -0400
HELO computer.contoso.com
250 mirage.production.com HELLO [147.100.100.39]

MAIL FROM: Anonymous@contoso.com
250 2.1.0 Sender OK
RCPT TO: Brien@brienposey.com 250 2.1.5 Recipient OK
DATA
354 Start mail input; end with <CRLF>.<CRLF>
this is a test over SMTP
.
250 2.6.0 <a49fd865-9301-49a6-a642-dbe62bbbf597@mirage.production.com>
Queued mail for delivery
QUIT
221 2.0.0 Service closing transmission channel
Connection to host lost.

This illustrates that SMTP can be easily manipulated. In this case, the commands shown above worked because I was already authenticated into Exchange. Remember that there is nothing stopping someone from setting up his own mail server and scripting a variation of the commands shown above in an effort to send mass quantities of spam.

IMAP vulnerabilities

The primary IMAP security flaw is that the client’s username and password are sent across the wire using clear text. Even though IMAP has an authentication mechanism, the authentication process can easily be circumvented by anyone who knows how to use a protocol analyzer to steal a password.

In an Exchange Server environment, you can fight this problem by using SSL encryption for IMAP. First acquire an X.508 certificate. Next, enable SSL encryption for IMAP by using the Enable-ExchangeCertificate cmdlet. When using this cmdlet, you’ll have to use the following parameter:

-Services IMAP

Remember that you can’t use the Enable-ExchangeCertificates command to implement SSL encryption for IMAP if you’re using a wildcard certificate. If you have a wildcard certificate, you have to use the Set-ImapSettings cmdlet instead.

ABOUT THE AUTHOR
Brien M. Posey, MCSE, is a seven-time Microsoft MVP for his work with Windows 2000 Server, Exchange Server and IIS. He has served as CIO for a nationwide chain of hospitals and was once in charge of IT security for Fort Knox. For more information visit www.brienposey.com.

This was last published in October 2010

Dig Deeper on Email Protocols

PRO+

Content

Find more PRO+ content and other member only offers, here.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

SearchEnterpriseDesktop

SearchCloudComputing

SearchSQLServer

Close