WordPress PBN Plugin Drops Dual Webshells via Database Injection
A fake WordPress plugin called 'Beloved PBN Entegrasyonu' beaconed the site URL to an external server and injected returned HTML/JS into the page footer, while two PHP webshells stored in the wp_posts database table gave the attacker unauthenticated read/write access to the entire server filesystem.
Published on blog.sucuri.net
During a recent incident response engagement, our team uncovered a multi-stage WordPress infection that goes beyond the usual file-based malware. The attacker combined a fake plugin, a remote command-and-control server, and two PHP web shells stored directly inside the WordPress database.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the attacker gained initial access to install a plugin and inject database records, then used a fake plugin and database-resident webshells to maintain persistence and evade file-based detection.
Impact
Every visitor received injected PBN links, damaging search rankings, and the webshells gave the attacker complete persistent filesystem access, allowing them to read wp-config.php, exfiltrate data, deploy cryptominers, or pivot to other sites.
What the attacker needed
Compromised WordPress admin access; ability to install plugins; ability to modify database
The fix
The plugin directory was removed, malicious wp_posts entries were deleted, credentials were rotated, and the malicious domain was blocked.
How it was found
- The attacker installed a fake plugin named 'Beloved PBN Entegrasyonu' in the wp-content/plugins directory.
- The plugin sent the site's URL to an external API on every page load.
- The plugin injected the returned HTML or JavaScript into the page footer only if it contained a specific marker.
- The attacker also injected two PHP webshells as raw code into wp_posts database records.
- The webshells allowed unauthenticated file operations and directory browsing across the server.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A WordPress site was infected with a fake plugin that secretly sent the site's address to an attacker-controlled server and inserted hidden links into every page. The attacker also hid two malicious scripts inside the site's database, which let them read, change, or delete any file on the server without needing a password. This is dangerous because most security tools only scan files, not the database.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.