IRIsuru Ratnayake

Phantom Shell Malware: How It Hijacks WordPress Servers

Phantom Shell creates hidden admins, spreads to every site on a server and steals database passwords. How it works, how to detect it and how to clean up.

Isuru Ratnayake

Isuru Ratnayake

· 4 min read

While cleaning up a compromised WordPress server in early May 2026, I came across one of the most aggressive pieces of malware I've seen in years. It calls itself Phantom Shell.

What makes it dangerous isn't one clever trick. It's the combination: it gives the attacker full control, spreads to every other site on the server, steals your database credentials and hides its own tracks. If your WordPress site is infected, you probably won't notice until serious damage is done, because it's designed that way.

Here's what it does, how to check whether you're affected, and what to do about it.

What Phantom Shell can do: 5 capabilities

1. Creates a rogue administrator, silently

One URL parameter is all it takes. Phantom Shell loads WordPress through wp-load.php, creates a new administrator account with a random username and password, and hands the attacker full access to the site. No existing login is needed.

Even if you change your own password, the attacker still has their own admin account.

2. Copies itself to every site on your server

It scans the server for all hosted domains and copies itself into every public_html folder as wp-cover.php.

On shared hosting, or a VPS with several sites under one account, that means one infected site = every site on the server is infected. Cleaning just the site you noticed isn't enough.

3. A full remote file manager

The attacker can browse, read, edit, upload or delete any file the web server can reach, from / and /home to /var/www and /tmp. That's complete file system access from a browser window, which makes it easy to plant more backdoors, deface pages or inject spam.

4. Steals your database credentials

It reads wp-config.php directly and extracts the database username, password and site URLs: everything needed to copy your database or take it over, even after the malicious file is removed.

5. Switches off error logging

error_reporting(0) runs at the top of the file, so there are no PHP errors, no log entries and no alerts. It works invisibly until someone goes looking for it.

How to check if your server is infected

If you manage your own hosting or have SSH access, these checks give a quick first picture. Adjust the paths to your server layout. The example uses the common cPanel layout of /home/<account>/public_html.

Look for the file it drops:

find /home/*/public_html -name 'wp-cover.php' 2>/dev/null

List every administrator on each WordPress site and look for accounts nobody recognises, especially recently registered ones with random names:

wp user list --role=administrator --fields=ID,user_login,user_email,user_registered

Find PHP files changed recently. Legitimate updates show up here too, so look for odd names and odd locations:

find /home/*/public_html -name '*.php' -mtime -14 2>/dev/null

No results doesn't prove the server is clean. Attackers rename files. But any hit on these checks means you should treat the whole server as compromised.

Already infected? What to do

  1. Take a backup first, including files and database, so you keep evidence and have a fallback. Keep it off the server.
  2. Clean every site on the server, not just the one you noticed. Remove wp-cover.php copies and any other unknown files.
  3. Delete rogue administrator accounts, then reset all remaining admin passwords.
  4. Change the database password and update wp-config.php. The old one must be considered stolen.
  5. Refresh the WordPress security keys (salts) to log everyone out, for example with wp config shuffle-salts.
  6. Reinstall WordPress core, plugins and themes from clean sources, rather than trusting existing files.
  7. Find and close the entry point, usually an outdated plugin, a nulled theme or a weak password. Otherwise the malware comes back.
  8. Check Google Search Console and blacklists, and request a review if your site was flagged.

How to prevent infections like this

  1. Keep WordPress core, plugins and themes updated. Most infections exploit known vulnerabilities in outdated software.
  2. Keep the server software and operating system patched.
  3. Never use nulled (pirated) plugins or themes. They're the number one delivery route for malware like this.
  4. Only install plugins with a solid track record: a long history in the WordPress repository, regular updates and good reviews.

A few extra steps help limit the damage if something does get in:

  • Isolate your sites. Separate hosting accounts or users for each site stop one infection from spreading to all of them.
  • Disable file editing in wp-admin by adding define( 'DISALLOW_FILE_EDIT', true ); to wp-config.php.
  • Use strong, unique passwords and two-factor authentication for every administrator.
  • Keep regular off-site backups, so recovery is a restore, not a rebuild.

Need help cleaning up?

Don't panic. Phantom Shell is aggressive, but it can be removed completely. I offer professional WordPress malware removal with a 3-month free cleanup warranty: if the malware comes back within 3 months, I clean it again at no charge. I also offer ongoing protection plans if you want your site covered long term.

Tell me what's happening with your site and I'll reply within a few hours.

  • WordPress
  • Security
  • Malware
Isuru Ratnayake

Isuru Ratnayake

Senior WordPress & PHP Developer. Top Rated on Upwork with 250+ completed jobs and 15+ years of PHP & WordPress experience.