• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1118
  • Last Modified:

has my mail-server been hijacked as a spam relay?

I have a pretty worrying problem with an SBS 2003 mail server I am maintaining. I did not set it up originally and whilst I am getting to grips with the technology I am still a relative newcomer to exchange. It sends and receives mail using SMTP.

I recently setup a couple of pop3 accounts locally on a machine on the network  they initially worked fine but it appears their arrival may have highlighted a more serious underlying problem. Whilst the main mailserver continues to work fine these local pop3 accounts recently stopped sending  investigation revealed that the static IP address was being blocked by one of the spamhaus registers  this is the message I receive:

xxx.xxx.xxx.xxx is listed in the XBL, because it appears in:
"      CBL
followed by:

ATTENTION: This IP is infected with, or NATting for a computer infected with a high volume spam sending trojan - it is participating in a botnet.
This is the Cutwail BOT
You need to patch your system and then fix/remove the trojan. Do this before delisting, or you're most likely to be listed again almost immediately.
If this IP is a NAT firewall/gateway, you MUST configure the NAT to prevent outbound port 25 connections to the Internet except from your real mail servers.

Furthermore at least two of the client machines have reported an unusually high volume of spam with a lot of the spam email subjects containing details of emails they have sent out (client names / order numbers etc) interspersed with the usual spam content. This concerned me greatly but I dont know what it is attributable to.

Ive scanned the server for Trojans using spyware doctor plus all the antivirus appears to be up to date  Ive also had a look on msconfig to see if any suspicious looking programs have appeared and there is no change there. Ive also checked those two clients for key loggers etc and made sure everyone elses antivirus is up to date.

My question is: how can I tell where the problem is (on the server or one of the clients) and how can I remove it. Also how are the spam email subjects incorporating specific details of emails sent from client computers?

Many thanks in advance guys...
  • 6
  • 6
1 Solution
Do you have a lot of emails queued in your outbound queue?
Go into Servers -> YOURSERVER -> Queues.
well , for start make sure the whole lan/servers segment are not allowed to use port 25 to the world , exept for your SBS server. that will rule out any client spamming...
you could try to track down some network activity too.

as for making sure that your server is configured correctly to not allow unauthenticated relay , follow this acticle :

all the best.
bowen2007Author Commented:
Hi guys - sincere apologies for leaving this open for so long - I've been reading up on the articles and having a play around but I'm not really making much headway. I've been stalling because I don't want to mess with the setup too much in case they lose their emails altogether. This is what I've ascertained so far:

* I've pretty much ruled out all the clients. All the antivirus was properly updated plus I've run virus / spyware tests on each of them independently and they does not seem to be anything of any note there. Also the the IP address got relisted over the weekend when all the workstations were switched off.

* I've checked the queues and there were about 20 queues coming from the default smtp server and they did all look rather spurious (bonkers4bingo.com, brainyquote.com, blazingwheels.com to name a few). I've frozen them for now - was that the right thing to do?

* I've followed the instructions in the microsoft document to test if the mail server is acting as an open relay. Unfortunately I only get as far as  "set local_echo" and "open (external ip address) 25". At this point I get the error message "could not open connection to host on port 25. Connection failed." I don't know where to go from here as this message does not appear in either the webcast or the article.

What should I try next guys? I am a little bit edgy as I did not originally set up this installation and whilst I  have setup exchange server a few times I am new to the inner workings and don't have that much experience troubleshooting it.

Any further feedback would be greatly appreciated.


Evaluating UTMs? Here's what you need to know!

Evaluating a UTM appliance and vendor can prove to be an overwhelming exercise.  How can you make sure that you're getting the security that your organization needs without breaking the bank? Check out our UTM Buyer's Guide for more information on what you should be looking for!

microsoft suggest that you try to emulate a session to your server to see if relay is allowed from your server..
there are some tools on the net you can try run..

these are automatic , but using telnet will allow you to "figure" it out better :)
anyways you should make sure your connector is configured correctly to the internet,
and that your smtp virtual server is configured to allow relay "only to the list below"
and remove the allow all users that able to authtenticate to relay...

these are mostly the common ones.
make sure that in the your email receipents policy you check all the email domains you are recieving mail from.

and if all hope is lost... you should try to detect any rootkits on the server or so, if not :( format it ...
fastest way to go acctually.

good luck
bowen2007Author Commented:
Hi ilantz,

Many thanks for the further feedback. Been onsite with the server today and I've examined the configuration in accordance with your most recent post and the Msoft article you recommended before.

* The SMTP virtual server IS configured to allow relay only to the list below.
* Allow all computers which successfully authenticate to relay, regardless of the list above IS selected (consistent with the Msoft article recommendations) - are you saying that I should definitely uncheck this?

* Under the Smallbusiness  SMTP properties everything is in order apart from "allow messages to be relayed to these domains" is checked - contrary to the Msoft article. What would be the implications of unchecking this?

Once I've ironed out these configuration questions I'm going to run those utilites you've suggested.

What would you recommend to use to scan for Rootkits - I've already used spyware doctor (I've found that very effective on workstation but I'm not sure how suited it is to this particular scenario).

Many thanks again for your continued interest...
* Under the Smallbusiness  SMTP properties everything is in order apart from "allow messages to be relayed to these domains" is checked - contrary to the Msoft article. What would be the implications of unchecking this? <<< this is your issue.

* Allow all computers which successfully authenticate to relay, regardless of the list above IS selected (consistent with the Msoft article recommendations) - are you saying that I should definitely uncheck this? - this could be unchecked , i prefered it like that , so no one that is not explicitly allowed will be able to relay (even with auth).

rootkits ;) best utility is format c: /q
if you have doubts ... but that's to be super safe.

i'd go with ever util there is , but as you'd like :)

good luck !
bowen2007Author Commented:
:) thanks for the feedback again mate,

Right so first off I'm going to uncheck "allow messages to be relayed to these domains". Then freeze all the dodgy queues, then remove myself from the spamhaus registers.

Should it need a reboot?

no you didn't need a reboot..
any luck ?

queues looking normal ?
i'd advice you to setup some connection filter using the IMF of exchange.. (hope your running sp2 of exchange 2003) , check out this great Real-time block list & how to install info :

http://www.spamcop.net/fom-serve/cache/345.html (match the filter to apply only to
also block all who are not in directory , etc...

spam control can only be as good as you'd like to "handle" it btw :)
just a prespective..

good luck !
bowen2007Author Commented:
Hi there ilantz - thanks again for staying on board!

I did give it a quick reboot just to be on the safe side. Unfortunately it is not running SP2. I didn't do the original installation and there are a few issues with it - I'm not completely confident in the trend micro antivirus and there is very little space left on the system partition. Problem is they absolutely rely on their emails so if I update and the whole thing falls over its going to come right back on me. Its a tricky situation to fair - deep down I know they need a rebuild but its a case of convincing them that all the disruption is necessary.

I think I may have had a breakthrough - It seemed like the change you suggested had sorted it to begin with - I removed the IP address from the XBL blacklist, froze all the dodgy looking queues and we did not hear anything from the ISP for a day. The next thing I knew I got a panicked call from my customer saying the internet connection had been chopped by their ISP.

In desperation I removed the trend virus from the clients (even though it was all up to date) and tried AVG (which I believed to be more comprehensive - checking for rootkits etc too). It found a trojan.spambot on one of the workstations - I immediately isolated it from the network and got the ISP to restore the internet connection. It has been fine ever since and we have not been relisted on any of the spam registers. I was so convinced that it was something to do with the way the mail server had been originally configured that I underestimated the risks posed by the clients themselves.

With all this in mind, what server / client antivirus solution would you recommend?

Cheers again...
np. i'd still go with installing sp2..
if you need to resize partitions just use GPARTED and be happy :)

as for antivirus, trendmicro or forefront (antigen for 2003) ..

good job!
bowen2007Author Commented:
Hi there,

I've left it a full week and there has been no recurrence since I isolated that one PC from the network. After all that it was a single client PC spamming (with a trojan.spambot).

Many thanks for all the great advice...
bowen2007Author Commented:
Many thanks for your help ilantz,

You were right on the money with port 25 on the clients - I was convinced it was something wrong with the server because I hadn't originally set it up!

I'll know in future - you take care mate...
glad to assist !

I've open my own blog now:

tune in ;)

Featured Post

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

  • 6
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now