Back to blog
Security June 20, 2026 12 min read

How to Find wp_options Malware That Imunify360 Misses

wp_options is the most attacked table in WordPress. Attackers inject base64-encoded redirects and SEO spam that file-based scanners like Imunify360, ClamAV, and Wordfence can't see. Here's how to find and remove it.

If you manage a cPanel or CloudLinux server with dozens of WordPress sites, you\u0026apos;ve probably run into a frustrating pattern: Imunify360 reports everything clean, ClamAV finds nothing, but your clients\u0026apos; sites keep redirecting to gambling domains. The payload isn\u0026apos;t in a PHP file — it\u0026apos;s sitting in the wp_options table, invisible to every file-based scanner on the market.

This guide shows you exactly how to find wp_options malware manually, why legacy scanners like Imunify360 and Wordfence miss it, and how to automate detection across your entire server fleet with CleanShift.

The Hidden Threat: Why wp_options Is the #1 Target

The wp_options table is WordPress\u0026apos;s key-value store for site configuration. It holds siteurl, home, active_plugins, theme settings, widget configurations, and thousands of custom options from plugins. This makes it the single most powerful injection point in a WordPress database.

Attackers target wp_options because:

  • Automatic execution: Values from siteurl and home are loaded on every single page request. Modifying these redirects the entire site instantly — no file modification needed.
  • Plugin piggyback: Injecting a rogue entry into active_plugins forces WordPress to load a backdoor plugin on every request, even if the plugin file is later deleted (it just throws a warning).
  • Serialized payloads: Options like widget configurations store serialized PHP arrays. Attackers inject base64-encoded JavaScript or PHP callbacks into these serialized strings — they execute when WordPress unserializes the value.
  • Custom option namespace abuse: Attackers create options with innocuous-looking names like _transient_feed_cache or widget_settings_backup that contain obfuscated redirect scripts.

Real-World Example: The Invisible Redirect

On a cPanel server we audited running 34 WordPress sites, Imunify360 had found and quarantined 2 PHP backdoor files in wp-content/uploads/. The admin marked the incident as resolved. Three days later, 28 of the sites were still redirecting mobile visitors to spam domains.

The redirects were coming from three places in the database:

  • Modified siteurl and home: On 4 sites, the attackers had changed these to point to a malicious proxy that served the original content to desktop users but redirected mobile User-Agents.
  • Rogue options with hack_ prefix: 19 sites had options named hack_redirect, hack_seo_inject, and hack_cron_payload. These contained base64-encoded JavaScript that injected invisible iframes.
  • Hijacked cron entries: The cron option in wp_options had been modified to schedule a daily event that re-injected the malware even after manual cleanup.

Imunify360 never saw any of this. It doesn\u0026apos;t read MySQL. It can\u0026apos;t.

Manual Detection: SQL Queries Every Sysadmin Should Know

Before you reach for an automated tool, here are the queries you can run directly against a WordPress database to surface common wp_options malware patterns.

1. Find encoded payloads and eval calls:

-- Check for obfuscated payloads in wp_options
SELECT option_name, LEFT(option_value, 200)
FROM wp_options
WHERE option_value LIKE \u0027%base64_decode%\u0027
OR option_value LIKE \u0027%eval(%\u0027
OR option_value LIKE \u0027%gzinflate(%\u0027
OR option_value LIKE \u0027%str_rot13(%\u0027
OR option_name LIKE \u0027hack_%\u0027;

2. Check for modified site URLs:

-- Verify siteurl and home aren\u0027t tampered
SELECT option_name, option_value
FROM wp_options
WHERE option_name IN (\u0027siteurl\u0027, \u0027home\u0027);

If the URL doesn\u0026apos;t match the expected domain — or contains a subdomain/path you don\u0026apos;t recognize — the site has been hijacked at the most fundamental level.

3. Detect rogue admin accounts:

-- Find unexpected admin users
SELECT u.ID, u.user_login, u.user_email, u.user_registered
FROM wp_users u
JOIN wp_usermeta m ON u.ID = m.user_id
WHERE m.meta_key = \u0027wp_capabilities\u0027
AND m.meta_value LIKE \u0027%administrator%\u0027
ORDER BY u.user_registered DESC;

Look for accounts registered in the last 7 days with emails you don\u0026apos;t recognize. Attackers exploiting privilege escalation CVEs (like CVE-2024-28000) almost always create a rogue admin as their first action.

4. Audit the wp_options cron for hijacked events:

-- Dump scheduled cron events
SELECT option_value FROM wp_options
WHERE option_name = \u0027cron\u0027;

The output is a serialized PHP array. Look for hook names you don\u0026apos;t recognize — legitimate cron hooks come from WordPress core (wp_update_plugins, wp_scheduled_delete) or known plugins. Anything with random strings or suspicious names like update_checker_hook_exec warrants investigation.

Why File Scanners Miss Database Malware

Understanding why Imunify360, ClamAV, and Wordfence miss database-level malware isn\u0026apos;t about criticizing these tools — they\u0026apos;re excellent at what they do. It\u0026apos;s about understanding their architectural limitations.

  • Imunify360 scans file contents using YARA rules and signature databases. It monitors file creation events via inotify. It has zero integration with MySQL — it cannot read a single database row.
  • ClamAV is a file-based antivirus engine. It scans byte streams from files against known signatures. Even if you piped a database dump through clamscan, the base64 encoding and serialization would prevent signature matching.
  • Wordfence compares WordPress core, theme, and plugin files against known-good checksums from wordpress.org. This is effective for detecting file modifications but provides zero database visibility. Its malware scan module checks PHP files, not MySQL tables.

The common thread: all three tools operate at the filesystem layer. They were designed in an era when malware meant backdoor PHP shells. Today\u0026apos;s WordPress attacks are increasingly database-first — the attacker never needs to write a file to disk.

Automated Detection with CleanShift

Running those SQL queries manually works for one site. But if you manage a server with 50, 100, or 500 WordPress installations, manual detection isn\u0026apos;t feasible. This is where CleanShift\u0026apos;s database scanner comes in.

Run a deep scan across your entire server:

$ cleanshift scan --server --scan-mode deep

The --scan-mode deep flag tells CleanShift to perform comprehensive database analysis in addition to the standard filesystem checks. For each WordPress installation detected, it:

  • Parses wp-config.php to extract database credentials and table prefix
  • Scans wp_options for encoded payloads, suspicious option names, and modified core options (siteurl, home, active_plugins)
  • Checks wp_users and wp_usermeta for rogue administrator accounts created after the last known-good scan
  • Examines wp_posts for injected SEO spam links and JavaScript in post content
  • Inspects the cron option for hijacked scheduled events
  • Cross-references findings across all sites on the server to detect coordinated compromise campaigns

Review results for a specific site:

$ cleanshift report --site example.com --format table

Cleanup: Removing wp_options Malware

Once CleanShift identifies the infected options, cleanup is straightforward:

$ cleanshift clean --server --auto-approve

For manual cleanup, delete the rogue options directly:

-- Remove attacker-created options
DELETE FROM wp_options WHERE option_name LIKE \u0027hack_%\u0027;
-- Restore siteurl and home
UPDATE wp_options SET option_value = \u0027https://yourdomain.com\u0027
WHERE option_name IN (\u0027siteurl\u0027, \u0027home\u0027);
-- Remove rogue admin accounts
DELETE FROM wp_users WHERE user_login = \u0027rogue_admin_username\u0027;

After cleanup, update all passwords, regenerate WordPress salts in wp-config.php, and update the vulnerable plugin that allowed the initial compromise.

Stop Guessing. Start Scanning.

File-based scanners were built for file-based malware. That\u0026apos;s not the threat landscape anymore. If you\u0026apos;re responsible for WordPress hosting security, you need database-level visibility.

Install CleanShift free at cleanshift.osg.co.in and run your first deep scan in under 5 minutes. See what Imunify360 is missing on your server.

Written by CleanShift Team