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
siteurlandhomeare 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_pluginsforces 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_cacheorwidget_settings_backupthat 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
siteurlandhome: 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 namedhack_redirect,hack_seo_inject, andhack_cron_payload. These contained base64-encoded JavaScript that injected invisible iframes. - Hijacked
cronentries: Thecronoption inwp_optionshad 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:
2. Check for modified site URLs:
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:
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:
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:
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.phpto extract database credentials and table prefix - Scans
wp_optionsfor encoded payloads, suspicious option names, and modified core options (siteurl,home,active_plugins) - Checks
wp_usersandwp_usermetafor rogue administrator accounts created after the last known-good scan - Examines
wp_postsfor injected SEO spam links and JavaScript in post content - Inspects the
cronoption for hijacked scheduled events - Cross-references findings across all sites on the server to detect coordinated compromise campaigns
Review results for a specific site:
Cleanup: Removing wp_options Malware
Once CleanShift identifies the infected options, cleanup is straightforward:
For manual cleanup, delete the rogue options directly:
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