CVE-2024-3400: PAN-OS Command Injection Vulnerability in GlobalProtect Gateway. Learn More

CVE-2024-3400: PAN-OS Command Injection Vulnerability in GlobalProtect Gateway. Learn More

Services
Capture
Managed Detection & Response

Eliminate active threats with 24/7 threat detection, investigation, and response.

twi-managed-portal-color
Co-Managed SOC (SIEM)

Maximize your SIEM investment, stop alert fatigue, and enhance your team with hybrid security operations support.

twi-briefcase-color-svg
Advisory & Diagnostics

Advance your cybersecurity program and get expert guidance where you need it most.

tw-laptop-data
Penetration Testing

Test your physical locations and IT infrastructure to shore up weaknesses before exploitation.

twi-database-color-svg
Database Security

Prevent unauthorized access and exceed compliance requirements.

twi-email-color-svg
Email Security

Stop email threats others miss and secure your organization against the #1 ransomware attack vector.

tw-officer
Digital Forensics & Incident Response

Prepare for the inevitable with 24/7 global breach response in-region and available on-site.

tw-network
Firewall & Technology Management

Mitigate risk of a cyberattack with 24/7 incident and health monitoring and the latest threat intelligence.

Solutions
BY TOPIC
Offensive Security
Solutions to maximize your security ROI
Microsoft Exchange Server Attacks
Stay protected against emerging threats
Rapidly Secure New Environments
Security for rapid response situations
Securing the Cloud
Safely navigate and stay protected
Securing the IoT Landscape
Test, monitor and secure network objects
Why Trustwave
About Us
Awards and Accolades
Trustwave SpiderLabs Team
Trustwave Fusion Security Operations Platform
Trustwave Security Colony
Partners
Technology Alliance Partners
Key alliances who align and support our ecosystem of security offerings
Trustwave PartnerOne Program
Join forces with Trustwave to protect against the most advance cybersecurity threats
SpiderLabs Blog

Hey, can I use your server for spamming?

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.

12799_f99d283d-4504-4236-bcbd-bd47143ace77

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:

8731_37190721-6a30-4392-b133-72ff13e2cd7c

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.

11421_b7fa082e-1302-496d-a86e-c693a196f713

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.

7965_107d230e-b148-4a6b-99e7-4265b38d652f

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.

Latest SpiderLabs Blogs

EDR – The Multi-Tool of Security Defenses

This is Part 8 in my ongoing project to cover 30 cybersecurity topics in 30 weekly blog posts. The full series can be found here.

Read More

The Invisible Battleground: Essentials of EASM

Know your enemy – inside and out. External Attack Surface Management tools are an effective way to understand externally facing threats and help plan cyber defenses accordingly. Let’s discuss what...

Read More

Fake Dialog Boxes to Make Malware More Convincing

Let’s explore how SpiderLabs created and incorporated user prompts, specifically Windows dialog boxes into its malware loader to make it more convincing to phishing targets during a Red Team...

Read More