[Last Call] Learn how to a build a cloud-first strategyRegister Now

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

SMTP Monitoring to find origin of messages


I have a issue and do not really find a feasible solution to my problem. I hope that maybe someone has a good pointer on how to tackle this issue.

Basically the problem is that I have a Linux server with postfix. I also have logwatch installed and get a daily report. There are maybe about 200 mail accounts on this server.  Most of them are not to active but logwatch says that 7k messages are send. So I do suspect maybe some of the programs hosted on this server has some exploit that allows some outside person to maybe send messages using my server by exploding a possible faulty script.
I wonder if there is any way to find something like this with some monitoring script or reporting script. Any tips on how to tackle a situation like this so that I can tighten the server and ensure nobody is using my machine to possible send spam.

Best wishes,
  • 2
3 Solutions
Chris HIT DirectorCommented:
One thing you might consider is that the email origination on the inbound emails is spoofed to your mail server domain, so when the 'dumb' report runs, it merely collects all the data in the "from" field on your emails and is making it look like (just in the report) you sent a bunch of crappy email.

Say your domain is domain.com and I craft an email from "bill@domain.com" to "thomas@domain.com" all the time knowing both accounts are active.  If you don't have recursive spoof detection enabled/installed on your perimeter, your mail server (postfix especially) will accept it and store it.  This is  a pretty common spam tactic to confuse simple spam traps.  Someone has probably harvested your user list.

The best solution would be to route the domain through a spam service, spam appliance, or install and configure spam assassin or @SSp on your network.
If you're not sure what causes the messages to be created, some kind of "brute force attack" could help. Chances are good that the mails are transferred w/o SSL encryption - so I would try to set Wireshark onto the network traffic, set up with an appropriate capture filter (to intercept SMTP traffic only, and maybe more smart conditions, i.e. to catch only the relevant header lines).

That way you're capable of reading the entire mail traffic and spot the suspect messages - but be prepared to read thru a huge heap of data, depending on the amount of data your users shove thru the server.
ThomanjiAuthor Commented:
Thanks guys this is good info.
choward16980: I do have a sam system implementer using AMAVIS-NEW, Spamassassin, DKIM, Razor2, OS_Fingerprint, ClamAV, SFP and even DMARC so I would hope this stuff does some detecting of these spoofs.

frankhelk: Wireshark sounds very interesting so I can see if anything is going on. I will play with this and see what is is capable of doing.
Chris HIT DirectorCommented:
I read this website 6 months back when I suspected our IIS server of being vulnerable.  It gave me the willies and seemed like more work than the actual creating of the website...


Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

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