Blog Post

Exchange Team Blog
2 MIN READ

SMTP Session Tarpitting for Windows 2003 and Exchange

The_Exchange_Team's avatar
The_Exchange_Team
Platinum Contributor
Dec 06, 2004

A common strategy for increasing the cost of would-be mail abuse uses a technique called tarpitting. Mail servers that tarpit wait a specified period of time before issuing SMTP responses to the client, thus increasing the time investment needed to successfully send a large amount of mail or a constant stream of (usually invalid) SMTP commands. To minimize the impact on the performance of well-meaning senders, servers can tarpit responses only for SMTP errors and allow authenticated clients to bypass the tarpit time.

Tarpitting is a useful countermeasure for:

  • Dictionary harvest attacks (where an attacker is trying to compile a list of valid e-mail addresses from your organization)
  • User account attacks (where an attacker repeatedly attempts to authenticate via username/password guessing)
  • Spam scripts that send more invalid than valid e-mail recipients.

Most of these abuses depend on quick SMTP server responses to complete in an acceptable timeframe. SMTP servers that tarpit slow down the amount of work they can do in a given amount of time, thereby making the abuse less enticing or lucrative.

Until recently, there wasn’t a way to enable tarpitting behavior for Windows/Exchange. Now, you can.

Simply install the KB:842851 package and KB:885881 package. The only requirement is that you’re running Windows Server 2003 with Internet Information Services 6.0. If you’re running Microsoft Exchange, the package automatically integrates with it.

Then, create/set the following registry key:

            HKLM\System\CurrentControlSet\Services\SmtpSvc\Parameters\TarpitTime (DWORD)

The key value is the number of seconds you wish the server to tarpit error responses. You must stop/start the SMTP service for the change to take place.

When used with Microsoft Exchange Server 2003 features like recipient lookup, tarpitting increases the cost of invalid lookups that makes it harder to abuse the feature to launch a dictionary harvest attack.

- Greg Beitler

Updated Jul 01, 2019
Version 2.0

14 Comments

  • Great! But what value for tar pit would be the best?
  • <p>
    Microsoft today released a hotfix for the Windows 2003 SMTP stack that provides tarpitting for SMTP.... The idea is that you install software that intentionally slows down SMTP throughput for bogus requests.
    </p>
  • Hi!

    That article is incorrect. Hotfix DOES NOT install Tarpit fix on Windowss 2003 unless _original_ KB842851 was installed.

    WindowsServer2003-KB885881-x86-enu.EXE includes two versions of smtp.dll - GDR (for RTM versions) and QFE (for hotfix version). ONLY QFE version of smtp.dll has Tarpit fix. RTM version does not.

    If original KB842851 fix (available from MS) was not installed, it is still possible to replace smtp.dll but that is not supported, of cause.

    And the way it works is very simple - it times out SMTP response if reply is not in 250 status. Works perfectly with plain SMTP service and some other sink-based spam filters.
  • Excellent work!

    I had a discussion almost one year ago with David Lemson (URL points to the post on his weblog) about this specific feature. It fired discussions on how MS decides and knows about user feature requests. Tarpitting was one of those features I requested: now it's here!

    I mentioned in previous posts on David's blog there was (and still is) a content scanning gateway in front of our Exchange organisation. I already have plans layed out to change that: have Exchange use IMF (recipient check), tarpit when needed, and then route back to the content scanning gateway. After the content scan messages will flow into the Exchange org again.

    Great to see this feature in the SMTP service!