The Balada Injector malware campaign has been active since 2017, infecting an estimated one million WordPress websites. According to GoDaddy's Sucuri, this massive operation takes advantage of all known and recently discovered theme and plugin vulnerabilities to infiltrate WordPress sites. The attacks occur in waves, typically once every few weeks.
Security researcher Denis Sinegubko notes that the campaign is easily identifiable by its preference for String.fromCharCode obfuscation, the use of newly registered domain names hosting malicious scripts on random subdomains, and redirects to various scam sites. These sites include fake tech support, fraudulent lottery wins, and rogue CAPTCHA pages urging users to enable notifications to verify they are not robots, allowing the threat actors to send spam ads.
This report follows recent findings from Doctor Web, which detailed a Linux malware family that exploits flaws in over two dozen plugins and themes to compromise vulnerable WordPress sites. Throughout the years, Balada Injector has used over 100 domains and a variety of methods to exploit known security flaws (e.g., HTML injection and Site URL). The attackers mainly attempt to obtain database credentials in the wp-config.php file.
Moreover, the attacks are designed to read or download arbitrary site files, including backups, database dumps, log and error files, and search for tools like adminer and phpmyadmin that may have been left behind by site administrators after completing maintenance tasks.
The malware ultimately allows for the generation of fake WordPress admin users, harvests data stored in the underlying hosts, and leaves backdoors for persistent access. Balada Injector also conducts broad searches from top-level directories associated with the compromised website's file system to locate writable directories belonging to other sites.
Most commonly, these sites belong to the webmaster of the compromised site and they all share the same server account and the same file permissions," Sinegubko explains. "In this manner, compromising just one site can potentially grant access to several other sites 'for free.
If these attack pathways are unavailable, the admin password is brute-forced using a set of 74 predefined credentials. WordPress users are advised to keep their website software up-to-date, remove unused plugins and themes, and use strong WordPress admin passwords.
The injected malicious JS code was included on the homepage of more than half of the detected websites," Unit 42 researchers report. "One common tactic used by the campaign's operators was to inject malicious JS code on frequently used JS filenames (e.g., jQuery) that are likely to be included on the homepages of compromised websites.
This potentially helps attackers target the website's legitimate users, as they are more likely to visit the website's home page.
Conclusion: The Balada Injector malware campaign serves as a reminder of the importance of maintaining strong security measures for WordPress websites. To protect their sites, users should keep software up-to-date, remove unused plugins and themes, and use robust admin passwords.