SpiderLabs Blog

Hey, can I use your server for spamming?

Written by Phil Hay | Sep 19, 2013 2:05:00 PM

Over the last few months I have encountered two separate cases of our customers being impacted by outbound spam, i.e., spam originating from within their networks. The first sign that anything was wrong was that the customers' mail servers were listed on DNS Blacklists like Spamhaus.org. This of course causes headaches trying to deliver mail because anyone using the Blacklist will reject all your email.

My first thought was that the spam would be originating from some spam-sending malware on a compromised machine. But in both cases a closer look at the spam showed this not to be the case. All the spam had valid Microsoft Exchange headers, was originating from the organization's Exchange server and was addressed from a limited number of real user accounts.

So it appeared that user accounts were compromised and used to spam. Sure enough, when the passwords were changed for the affected users, the spam dried up as the Exchange delivery queues emptied. But this left me with a couple of questions. How did the accounts get compromised? And how did the spammers access the Exchange server? Pretty simply as it turns out.

A user in the organization fell victim to a "mailbox quota" phish. With this phishing technique, a user will receive a message purporting to be from a system administrator informing the user that their inbox or mailbox has exceeded some threshold and asking them to "validate" their mailbox by clicking a link. Note, because these messages themselves were from valid Exchange mail servers, with valid headers, with good IP reputation, occasionally they get missed by anti-spam filters. Here is a typical example:

The link led to a website hosting a simple form asking for credentials. Note this site is hosted at the free website provider Jimdo.com. This use of free website tools is common - Webs.com is also popular among this phishing crowd.

So how did they perform the spamming? A quick scan through Exchange and IIS logs revealed it was via Outlook Web Access (OWA), that handy Outlook web interface that allows employees to log-in to the corporate email system from anywhere. Once they had the credentials and a freely accessible OWA, they were able to spam. It's not clear whether the spammers' OWA login process was automated, but the variety and volume of spam sent through a single server suggests that it was.

In one case, the logs clearly showed the spammers logging in to OWA as a user and uploading their messages to the user's Draft folder. The connecting IP address 41.138.190.136 originated from - no surprises here - Nigeria.

So, in summary, the spammers are phishing, gathering credentials, and sending spam through accessible OWA platforms. Included among the thousands of spam sent are more seeding mailbox-quota spam to perpetuate the cycle. It appears that once one user in an organization gets sucked in by this ruse, others tend to follow because more seeding emails appear to come from the original impacted user whom others in the organization know and trust.

We see mailbox-quota spam, and other spam, from valid Exchange servers on a daily basis, so the problem appears to be quite widespread, but it adds up to only a tiny fraction of the total spam we see.

So, what can admins do about this issue? Here are some things to consider:

  • Be aware of it, so if you ever get blacklisted on Spamhaus, you can check this avenue out.
  • If impacted, change affected user passwords immediately. Also, if you haven't got policy that regularly expires passwords, put one in place.
  • If you change passwords, be aware that there is still likely to be a backlog of messages in Exchange queuing to be sent, so find those messages and delete them all.
  • Educate your users and make them aware of this mailbox-quota spam. User education isn't always effective, but try we must.
  • Limit OWA access to only people that need it, or to specific geo-IP blocks. You could even consider requiring a VPN connection to access OWA from the outside.
  • Monitor the IIS OWA logs, and look for suspicious activity such as too many messages sent in a certain timeframe or connections from unexpected IP ranges, like Nigeria for example.