This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SMTP being hijacked - trying to block sender

Looks like over the weekend we got hijacked and now I have spammers from Italy using our SMTP relay to send thousands of emails. I have added their domains to the sender blacklist filter and the expression filter, but the emails continue to pour through. Obviously, I'm not using the right tool to stop them. I've got a list of the domains they're using - does anyone know how I can block these guys? Thanks!

edit: Also realized this could be a malware intrusion on one of our workstations - we are currently scanning all machines with Malwarebytes to see if we can find the culprit. Just in case this is not the issue and we indeed have been hijacked, any tips for dealing with this would be highly appreciated. 
____

ASG220
Firmware 7.501
Pattern Version 22662


This thread was automatically locked due to age.
  • another thing i just tried - under SMTP / Relaying I added these pirate domains under Host/Network Blacklist, using the DNS Host option when adding the new network definitions. Not sure if this has made any difference - my SMTP log continues to get hammered with requests from these domains. here is a common log message:

    lnfo@cartasi.it routing defer (-51): retry time not reached
  • Update - not so sure it's malware anymore. Looking at my live SMTP Proxy log I noticed that this spam was authenticating to the mail server using a legit account that exists in my Open Directory, which ties into the Astaro for backend authentication. it was a test account and they must have discovered the password somehow. I've since deleted that test account and now all the messages are getting blocked. But I am still getting slammed with the requests which is blowing up my SMTP log and still slowing down the firewall. There's got to be some way to determine where this traffic is coming from?
  • If you were on 8.103, I'd tell you to enable Country Blocking in the Packet Filter and block Italy (unless you need email from there).

    CTO, Convergent Information Security Solutions, LLC

    https://www.convergesecurity.com

    Advice given as posted on this forum does not construe a support relationship or other relationship with Convergent Information Security Solutions, LLC or its subsidiaries.  Use the advice given at your own risk.

  • We had some serious issues upgrading firmware in the past, that's why I've been riding out this one for as long as possible, but I might have to bite the bullet. As long as I can fully roll back to a previous firmware without any complications I'll definitely do it.

    In the meantime, any other suggestions with the tools I currently have?
  • You need to quarantine that mail server. You don't know if it is compromised internally or externally. It doesn't need to have a trojan on it if someone has full acess to it. How can someone from the outside send mail from your internal mail server? Is it exchange server or alike with web interface?
  • It's a Dovecot mailserver running on Mac OS 10.6 Server. It does have a webmail interface via Squirrelmail frontend. The mail relays to the Astaro and users are authenticated via the LDAP link. 

    The good news is that I have stopped all the pirated mail, deleting that "test" account in LDAP they were using for authentication seemed to do the trick. So far today, the Astaro reports no email from/to those Italian domains, all traffic is my internal users. But now I'd like to block the SMTP requests entirely from these people. I'm going to keep doing malware checks on peoples' computers, but if there's something I can do at the firewall level to block this traffic before it ever hits SMTP that's what I'd like to do.
  • I am glad you have it under control now, as Bruce suggested, I would upgrade to 8.103 and publish that squirrel-mail with astaro waf and use country block.
  • Anytime I see a horror story like this, I wonder if the SMTP Proxy is in "Transparent" mode.  I know there may be a reason to use the proxy transparently, but I can't imagine it being anything other than for testing... even then!

    The other question would be how they got in where they were able to authenticate against the mail server with the "test" account.  What settings do you have on your mail server that might lock an account for a time after several failed passwords in a defined period?

    Cheers - Bob
     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • Hey Bob, definitely do not have SMTP in transparent mode. In my Open Directory environment I have it set to disable login after 4 failed password attempts. How they got in I have no idea - perhaps they were using a sophisticated query tool that took common directory names & password combinations with test emails until one succeeded? My knowledge of hacking is fairly limited, but it doesn't seem out of the question that someone could script that. 

    At any rate, my success in blocking the spam seems only temporary, as over the weekend the logs show me that at least a dozen new email accounts were sending mail on our server. CPU usage remains at 100% almost all day. I'm still not sure if this is the result of a malware intrusion - my scans have come up negative on all workstations so far. 

    I'm waiting for my reseller to get me a maintenance subscription renewal so I can get the latest firmware installed and tested. The Astaro US division has been extremely slow in getting back to us, which isn't helping matters.
  • My knowledge of hacking is fairly limited, but it doesn't seem out of the question that someone could script that.
    Unless someone is specifically targeting you, 99+% of the time, these things are automated using pre-canned tools.

    Unfortunately, you've found out the hard way that Apple Mac stuff being more secure is a myth.  

    If it were me, I'd be getting Apple, Dovecot, and SquirrelMail support involved because they seem to be exploiting some sort of vulnerability.  I'd guess Squirrel may be the culprit, being the front-end.  Seems that each of their updates has quite a few security fixes.  Were you running the latest, 1.4.22?

    Since they seem to be able to send through different accounts on your server/mail server, you'd best plan on doing a rebuild after you find out how they got in.  Who knows what they've injected into the server(s).
    __________________
    ACE v8/SCA v9.3

    ...still have a v5 install disk in a box somewhere.

    http://xkcd.com
    http://www.tedgoff.com/mb
    http://www.projectcartoon.com/cartoon/1