r/StopBadBots • u/siterightaway • 3h ago
How Custom Malware Blinded Wordfence to Hide a Rogue Ad
Man, this attack is seriously next-level compared to your run-of-the-mill WordPress hacks. It breaks the usual playbook because of five super sneaky things the hackers pulled off:
Supply Chain Hit Without Touching Plugin Code Usually, when a legit plugin gets hijacked, the bad guys slip malware into a new update. Not here. The actual plugin files on WordPress.org weren't touched at all. Instead, the attackers abused the trust baked into the developer's setup and poisoned the external server that pushes promo banners straight into users' dashboards. Because of that, standard file-integrity scanners—the ones checking if plugin files got altered—completely missed the entry point.
Hijacking the Admin's Own Session (Zero Server Flaws Needed) The hackers didn't exploit a single bug on the victim's actual web server—no SQL injection, no sketchy file uploads. The malicious script ran right inside the logged-in admin's browser. So if you look at the server logs, every shady move (spinning up new users, uploading plugins) looks like the real site owner did it from their own IP and session. That makes it a total nightmare for firewalls (WAFs) to catch.
Next-Level Stealth and Log Evasion This malware was crazy smart about staying under the radar:
Sniffing Out Hidden Logins: Before phoning home with stolen credentials, the script scraped the page's logout link just to find the site's real login URL—totally bypassing plugins that hide the default /wp-login.php page.
Spoofing Timestamps and Hashes: The rogue must-use plugin (mu-plugin) got uniquely encrypted with a random key on every single infected site, making file-hash detection completely useless. On top of that, it backdated its own timestamp to match the original wp-config.php file, fooling anyone eyeballing the folder for recent changes.
Blinding Both WordPress and the Security Plugin Instead of just making a basic admin account and calling it a day, the second stage dropped an mu-plugin that hijacked database queries to wipe the hacker's account from the "Users" screen—and even subtracted one from the total admin count so the numbers looked normal. Even crazier? It was custom-coded to scrub the rogue user from Wordfence's own internal list of monitored admins, flat-out blinding the security tool.
Weaponizing an "Inactive" Fake Plugin as a Backdoor The attackers uploaded a bogus plugin (WP Object Cache Extension), yet they never even turned it on. Since its main file was a total dud, it wouldn't raise red flags on the active plugins list. Meanwhile, a secondary file (cache-rebuild.php) sitting inside that folder stayed wide open via direct URL for any logged-in admin, acting as a sneaky backdoor to pull up the hidden credentials whenever needed.
Join us at r/stopbadbots and help protect the people who build the internet.