WordPress flaw lets attackers install PHP backdoors
Key Takeaways A new attack chain, dubbed TRUST#GRAFT, exploits active WordPress administrator sessions to install persistent PHP backdoors. The attack leverages a compromised page to execute a...
Key Takeaways
- A new attack chain, dubbed TRUST#GRAFT, exploits active WordPress administrator sessions to install persistent PHP backdoors.
- The attack leverages a compromised page to execute a JavaScript loader, which then uses the administrator’s authenticated browser session to upload and activate a malicious plugin.
- The malicious plugin, “Web Media Optimizer,” hides itself as a “must-use” plugin, making detection and removal challenging.
- This attack highlights the significant risk of browsing public websites while logged into a WordPress admin panel.
A recently uncovered attack chain is exploiting a common, yet risky, habit among WordPress administrators: maintaining an active login session while browsing other websites. This vulnerability allows attackers to install hidden PHP backdoors on WordPress sites without ever needing the administrator’s password.
Table Of Content
The method involves a sophisticated JavaScript loader that waits for a logged-in administrator to visit a compromised page. Once triggered, it hijacks the trusted browser session to surreptitiously inject a persistent backdoor into the WordPress installation. This technique bypasses traditional password protections by leveraging the administrator’s own authenticated browser to perform the malicious actions.
Recent incidents underscore the prevalence and danger of this attack pattern, including a campaign that potentially exposed over 1.2 million websites. Malware that only activates during active, logged-in sessions poses a significant challenge for conventional security scans, elevating concerns for website owners and administrators.
Security researchers at Securonix Threat Research, Akshay Gaikwad and Aaron Beardslee, identified this malware and named the entire sequence TRUST#GRAFT. Their analysis revealed that the JavaScript loader does not attempt to break the WordPress login mechanism. Instead, it checks if a visitor is already authenticated as an administrator and then reuses that established session to introduce new, malicious code to the site. Securonix noted that the initial vector for how the JavaScript script reaches the compromised page remains unconfirmed.
Hackers Can Abuse Logged-In WordPress Admin Sessions
The infection process initiates with a deceptive security verification. The malicious script overlays the current webpage with a full-screen frame, mimicking a legitimate Cloudflare “Just a moment” security check. During this simulated waiting period, the script discreetly gathers system information, including screen dimensions, graphics data, timezone, and the number of installed plugins. It also actively checks for indicators of automated analysis tools, suggesting an attempt to evade detection.
After a brief interaction, such as solving a small puzzle, the browser transmits this collected data to a command-and-control server. This server then determines whether to proceed with the next stage of the attack. The critical step that follows involves the script leveraging the browser’s existing login cookies to request the WordPress plugin upload page. From this page, it extracts a WordPress security token, known as a nonce.
Following this, the script downloads a ZIP archive, named wm.zip, from a staging server. It then uploads this file through the standard WordPress plugin installation endpoint. If the upload is successful, the script navigates to the plugins page and activates the newly installed plugin. WordPress processes each of these requests as legitimate because the browser is already authenticated with the necessary administrative permissions to install plugins.
Securonix emphasizes that this attack is not a standalone login bypass. It specifically requires an administrator account that is already logged in and possesses the necessary privileges to install plugins. Nevertheless, the risk remains substantial for any administrator who browses public websites while simultaneously logged into their wp-admin dashboard, or who uses a single browser profile for both general browsing and site management.
Persistent PHP Backdoor Hides in Must-Use Plugins
The uploaded wm.zip file contains a PHP plugin deceptively named “Web Media Optimizer, version 2.1.” While its name suggests a benign utility for image or media optimization, Securonix has confirmed it functions as a backdoor. This malicious plugin injects remote JavaScript into public-facing pages, disables TLS certificate checks when retrieving its controller script, and can establish an administrator login cookie for the primary admin account using a hardcoded token.
A key aspect of this plugin’s design is its self-preservation mechanism. Upon activation, it copies itself to the wp-content/mu-plugins/wmedia-recovery.php directory. WordPress automatically loads all files within the mu-plugins folder, and crucially, these “must-use” plugins do not appear on the standard Plugins page. This tactic of hiding malware within must-use plugins has been observed before, highlighting why merely removing the visible plugin is insufficient for complete remediation.
What You Should Do
- Use Separate Browser Profiles: Dedicate a distinct browser profile or even an entirely separate browser solely for managing your WordPress admin panel. This isolates your administrative session from general web browsing activities.
- Log Out Promptly: Always log out of your WordPress admin session immediately after completing administrative tasks, especially if you plan to browse other websites.
- Rotate Administrator Credentials: Regularly change passwords for all administrator accounts.
- Limit Plugin Upload Rights: Where possible, restrict the ability to upload new plugins to only essential administrator accounts.
- Monitor
mu-pluginsDirectory: Periodically check thewp-content/mu-plugins/directory for any suspicious or unfamiliar PHP files. Since these plugins are hidden from the standard WordPress interface, manual inspection is crucial. - Thorough Cleanup: If a compromise is suspected, ensure you remove not only the visible malicious plugin but also its copy in
wp-content/mu-plugins/wmedia-recovery.phpand any associated remote script sources to prevent reinfection. - Review Backdoor Cases: Stay informed about recent WordPress self-restoring backdoor malware cases, as deleted files can sometimes reappear.
Indicators of compromise (IoCs):-
| Type | Indicator |
|---|---|
| JavaScript loader | gerlace[.]com/0k2blyny.js |
| JavaScript loader | gerlace[.]com/j0ghlty4.js |
| JavaScript loader | vtevens[.]icu/50w2ouvx.js |
| JavaScript loader | vtevens[.]icu/x9bpnmck.js |
| JavaScript loader | caapman[.]me/cse3g1jd.js |
| JavaScript loader | http://caapman[.]me/9l56j7cg.js |
| JavaScript loader | https://caapman[.]me/4oco7gwc.js |
| Second-stage ZIP | http://caapman[.]me/p/wm.zip |
| Second-stage ZIP | https://vtevens[.]icu/p/wm.zip |
| Second-stage ZIP | https://nutmann[.]club/p/wm.zip |
| Second-stage ZIP | https://okuneva[.]sbs/p/wm.zip |
| Controller source | vilialobos[.]lol/ads.php |
| C2 domains | caapman[.]me, vtevens[.]icu, gerlace[.]com, nutmann[.]club, okuneva[.]sbs, vilialobos[.]lol |
| C2 API paths | /api/v1/8e4c615, /api/v1/f659473, /api/v1/e81929c, /api/v1/6a38418, /api/v1/76584c1 |
| JavaScript SHA256 | 19d9335e66d9d519c9068994491b1a0f8734626b5328fca9723d942b7128bc9c |
| JavaScript SHA256 | 0a3cb24e0d0c05b544a3e32affe3ea8a4ed87c0cc90e918c10b94d3b849d76fa |
| JavaScript SHA256 | 16f73adce28e3a33e98035a19721819ddac9cda130e6f1c337db6f8d8c2f95c6 |
| JavaScript SHA256 | f110e20dce8361a31332faba49e29e6afd54f8bc4913841f9bdad3cbb66c14e3 |
| JavaScript SHA256 | 85515e25894cace49286581f9436bd2da429e05bd96d39fafe1c42fbcdfcd4e7 |
| JavaScript SHA256 | 765525c4fabd01383ca3dd330dd4f4fbc931bea0724c12f553df41b48a96ca82 |
| JavaScript SHA256 | 804349f8f087588b057e942f321ec2c0a677a0374e02d47f95d43196fc4cac0a |
| JavaScript SHA256 | 4659d9648275113f7f95735d170f27f10fd6d0a4e606c5b4f6e916ddc54924ed |
| JavaScript SHA256 | 2cac894bf2cef2232247927e18acd35280065b576c5fa030b5fbad666db0afcc |
| JavaScript SHA256 | eeb182444019802abb34668bd6efc7e947c1822e95c87f9a5b5288b4331400c8 |
| JavaScript SHA256 | 2747316171bb2816b68db308162b40a47c6ddf82779d5f460a194921eb60f32c |
| JavaScript SHA256 | eb5a6c895d24fd08e3bbd74d7a0ea02600d3b7574b9761efb2876b671e8ddd39 |
| JavaScript SHA256 | 3b79b342a580dd09a5e3f907e475c3131f4005be59468a59905fc289e005806d |
| JavaScript SHA256 | 2fa9c207981e05141162b9c5cf62a86bdc6593b3a6861968e4df58f49c47da0d |
| JavaScript SHA256 | e98949a8370c5c3356a8e97f49a2f963a6126b917e1bc653890f8c79738c981d |
| JavaScript SHA256 | 07955dcb5f4f80c90ede398879589f2e369eb2d84c4975d3c8adf08433783409 |
| PHP SHA256 (wmedia-recovery.php) | 86d775c2d5cb459541cd2b0b967fac65ce20c60e483c71c9f7e108d5ad0bd564 |
| PHP SHA256 (ads.php) | 2dfa9e708fdb92e5d36080065f978e33a692c0fe813a75be9c7cdff03be51b6e |
| ZIP SHA256 (wm.zip) | 9215d17e5138cee498bb529e69b1cc7267305136535025e9b49fe173cf648720 |
| Plugin name | Web Media Optimizer 2.1 |
| Persistence path | wp-content/mu-plugins/wmedia-recovery.php |
| Hardcoded token | M2wS8mR4yP1qL7xC5vB3dG9jK6tH2z |
Note: IP addresses and domains are intentionally defanged (e.g., [.]) to prevent accidental resolution or hyperlinking. Re-fang only within controlled threat intelligence platforms such as MISP, VirusTotal, or your SIEM.
Disclaimer: HackersRadar reports on cybersecurity threats and incidents for informational and awareness purposes only. We do not engage in hacking activities, data exfiltration, or the hosting or distribution of stolen or leaked information. All content is based on publicly available sources.



No Comment! Be the first one.