Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


April 20, 2004

Exchange Server SMTP AUTH Attacks


RSS
Subscribe to Windows IT Pro | See More Security Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Exchange Server SMTP AUTH Attacks

If you run Microsoft Exchange Server to process incoming Internet email, spammers might be using your mail server as a relay even though your server isn't an open relay. How is this possible? Spammers authenticate to your email server, then use your server to send mail. Paul Robichaux wrote about this attack in "A New Kind of Attack," ( http://www.winnetmag.com/article/articleid/40507/40507.html ). The following discussion outlines how you can determine whether someone is using your system as a mail relay, how to close the hole, and how to test the measures you've taken to prevent such attacks.


Is Your System Under Attack?
To determine whether your system is a victim of such an attack, check the SMTP mail queues to see whether a spammer is using your mail server for relaying. To do so, start the Exchange System Manager (ESM) and go to Organization, Administrative Groups, Organizational Unit , Servers, ServerName Protocols, SMTP, Default SMTP Virtual Server, Queues. To list the messages in the queue, right-click the name of the queue for which you want to view the messages, select Enumerate 100 Messages, and double-click the queue to view the messages. Check the sender and recipient in several active queues. If the sender or recipient isn't a user from your local domain, the mail server is probably used as a mail relay. By default, Exchange 2000 and later allows relaying if a mail sender can successfully authenticate to the mail server. Don’t be alarmed if you have a lot of messages that are sent from postmaster@your_domain or administrator@your_domain because these are typically non-deliverable messages sent by the server.


How did the spammer get a username and password? Spammers can get a valid username and password in several ways. They can repeatedly guess the guest or other user's password until they stumble upon it, or they can launch an attack to obtain a valid username and password. Refer to my articles Malicious Hackers and Spam, Parts 1 and 2 at http://www.winnetmag.com/article/articleid/41094/41094.html, and http://www.winnetmag.com/article/articleid/41456/41456.html, respectively, for more information about how hackers can compromise your network. The hacker needs only one username and password combination to relay mail using your server.
Which account is the spammer using? To determine which account the spammer is using to relay email, you first need to turn up logging on your Exchange Server. Open ESM and go to Organization, Administrative Groups, Organizational Unit, Servers and right-click Server Name, Properties, and click the Diagnostics Logging tab. In the Services window, select MSExchangeTransport, and in the Categories window increase the logging level to maximum for all of the categories: Routing Engine, Categorizer, Connection Manager, Queuing Engine, Exchange Store Driver, SMTP protocol, and NTFS store driver. Check the event log; you should see an event with the Auth command and User ID when anyone authenticates to the mail server. Of course if you have multiple Exchange mail servers in your organization, you'll see many authentications to this mail server from other Exchange servers in your company. Specifically, you’re looking for an authentication from an external or unknown mail server that isn't in your organization. The logon ID that the spammer is using will show up as event 1708 in the Application event log. To track unsuccessful login attempts to the server, enable Successful/failure Account Login Attempts. Unsuccessful login attempts will show up in the security log with event ID 680.

Plugging the Hole
Change passwords. Change the password for the account the spammer uses. In fact, you might want to change the passwords for all users on the network in case the spammer has more than one valid user ID and password. Also, make sure the Guest account is disabled, and don’t forget about the accounts that are used to start services on the server: If you haven’t already done so, now is a good time to set up individual accounts that are used to start services on the server. Disable authentication on the outfacing Exchange Server. To disable authentication on these servers, start ESM, and go to Organization, Administrative Groups, Organizational Unit, Servers, ServerName, Protocols, SMTP, and right-click the Default SMTP Virtual Server. Select Properties, open the Access tab, and click Authentication. Leave Anonymous access enabled, but clear the Basic authentication and Integrated Windows Authentication checkboxes. Clearing these checkboxes essentially disables the Auth command on the SMTP server. Enable relaying for other internal Exchange Servers. If you have other internal Exchange Servers, make sure to enable relaying for these servers. On the Access tab, click Relay, select Only the List Below, and explicitly list the internal mail servers that are allowed to relay to this mail server. This action ensures that the internal mail servers can send mail to this server.

Test
After making these changes, thoroughly test the configuration. Test mail flow to and from the Internet and to and from all mail servers in your organization. These changes have the potential to break mail flow between servers, so you might want to wait until the weekend to make these changes. Better yet, test these changes in a lab environment before implementing them in production. I strongly suggest that you take these steps and make these changes. If a hacker ever gets a valid user ID and password and is able to relay mail, your mail server will get put on various email blacklists; you'll spend significantly less time preventing these attacks than troubleshooting mail delivery problems, getting removed from blacklists, and fixing the vulnerability.

Tip
Running any VPNs? Make sure to use at least 3DES or Advanced Encryption Standard (AES) to encrypt your data. DES encryption keys can be broken in less than 1 day using a network of 100,000 PCs on the Internet. As of this date, 3DES has not been cracked and AES is even more difficult to crack than 3DES. See http://www.eff.org/privacy/crypto_misc/descracker/html/19990119_deschallenge3.html for more information.

End of Article



Reader Comments
Here's another tip: If your users always access your Exchange server from the same computer then you can restrict the computer name that the user can log on from to just the name of their computer. Go to Active Directory Users and Computers > Users and retrieve properties on the user. Go to the Account tab and click on the "Log On To..." button. Restrict logon access to only the machine they use to access the network. Note that the computer name is only a NetBIOS name check and no SIDs are looked up so it’s not totally secure. It would, however, make things much more difficult for the spammer as he would not only have to guess the correct username and password, but would also have to know the correct NetBIOS name to match in order to logon. This would eliminate automated "brute force" password attacks as the attacker would need to guess the username, then try all password combinations for that username as well as all NetBIOS name combinations for each password. Unless he were using some kind of software that spoofs the NetBIOS name, this could not be done automatically and he would be forced to change the computer name manually and reboot for each attempt.

Blake Hensley April 20, 2004


Thanks Alan Sugarno!
I was working on a client's Exchange server which had suffered this attack. Your article helped me to fix the issue and clean up the server, but more importantly, helped the client understand why this had occurred. They were using weak, or no passwords, making it easy for the spammer to get access.
So, thanks again. Keep up the great work!
Hamish - Melbourne, Australia

Hamish April 27, 2004


What needs to be done to secure Exchange 5.5. Thanks.

tadd henry April 28, 2004


Thank you very much!!!!! we heave solved this problem!!!
S. van Hooff
Administrator
sbo-de-toermalijn
Netherlands

SBO De Toermalijn May 16, 2004


This article rocks!! Thanks so much. Help cured my headache.

Anis Isahak May 25, 2004


I am still under attack and will see I a Win ;>)

Olivier

Anonymous User December 24, 2004 (Article Rating: )


I would like to know if a typical Account Lockout Policy (such as 5 wrong password attempts locks the acct for 10 minutes) also applies to the Exchange server. That would essentially prevent dictionary actacks by making them take forever. Anybody know?

Anonymous User January 17, 2005 (Article Rating: )


To jest test

Anonymous User March 13, 2005 (Article Rating: )


Thank you so much... This article help me alot!

davewon January 24, 2007 (Article Rating: )


You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
Friday at PASS Europe 2006

Kevin talks about the closing day of the event and shares a funny Microsoft film. ...

Windows Mobile: What Went Wrong?

Paul discusses the evolution of Windows Mobile and why he thinks the platform is probably doomed. ...

Microsoft Makes Windows 7 Name Official

It's official: Microsoft's next Windows version, currently being developed under the codename Windows 7 will use that moniker as its official final name when it hits the market in early 2010. The news, delivered as is so often the case these days via a ...


Security Whitepapers Protecting (You and) Your Data with Exchange Server 2007

Extended Validation SSL Certificates

Unauthorized applications: Taking back control

Related Events Check out our list of Free Email Newsletters!

Security eBooks Spam Fighting and Email Security for the 21st Century

Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

Related Security Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.

Job Openings in IT


ADS BY GOOGLE SPONSORED LINKS FEATURED LINKS

Microsoft Exchange & Windows Connections event returns to Las Vegas Nov 10 - 13
Connections returns to Las Vegas for this exciting event where each attendee will receive SQL Server 2008 standard with 1 CAL. Co-located with Microsoft ASP.NET, SQL Server, and SharePoint Connections with over 250 in-depth sessions.

Free Online Event! Virtualization:Get the Facts!
Register now and attend this free, live in-depth online conference on November 13 and 20, 2008, produced by Windows IT Pro. All registrants are eligible to receive a complimentary one-year digital subscription to Windows IT Pro (a $49.95 value)!

Check Out Hyper-V Video on ITTV
Watch Karen Forster's interview on Hyper-V's performance on ITTV.net.

Ease Your Scripting Pains with the Flexibility of PowerShell!
Join MVP Paul Robichaux on December 11, 2008 at 11:00 AM EDT as he equips you with PowerShell basics in 3 introductory lessons, each followed by a live Q&A session—all on your own computer!

PASS Community Summit 2008 in Seattle on Nov 18-21
The don’t-miss event for Microsoft SQL Server Professionals. Register now and you’ll enjoy top-notch Microsoft and Community speakers and more.



Order Your SQL Fundamentals CD Today!
Learn how to use SQL Server, understand Office integration techniques and dive into the essentials of SQL Express and Visual Basic with this free SQL Fundamentals CD.

Email Recovery and eDiscovery for Microsoft Exchange!
Discover, Recover, and Export mailboxes, folders and individual items direct from offline EDB’s or online production Exchange Servers. Free 30 Day Demo.
Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing