Lightweight PHP scanner for suspicious patterns in WordPress databases, focused on wp_options. This tool does not clean malware—it flags risky patterns so you can investigate safely.
- Scope: Reads selected option values (default:
wp_options) and matches curated regex rules. - Threat model: Detects common webshell/obfuscation signatures, not complete malware eradication.
- Safety: Read-only access; no writes or deletions.
- Run locally or on staging with read-only DB credentials.
- Export results (JSON/table) for review.
- Delete the scanner immediately after use.
âś… Strict guidance: remove the scanner files after every scan. Never keep this tool deployed.
- CLI (recommended): predictable output, exit codes, JSON export.
- Web UI (temporary): local-only page for one-off scans.
- PHP 8.1+ with PDO MySQL
- Composer
- WordPress database credentials (read-only)
composer install
cp .env.example .envEdit .env with your DB credentials.
Key settings:
DB_HOST,DB_PORT,DB_USER,DB_PASS,DB_NAMEWP_TABLE(default:wp_options)OPTION_NAMES(comma-separated)OUTPUT_FORMAT(tableorjson)WEB_ALLOW_REMOTE(default:false)
php bin/scan.phpExamples:
php bin/scan.php --format=json --output=scan.json
php bin/scan.php --format=tableExit codes:
0no suspicious patterns1suspicious patterns found2execution error
php -S 0.0.0.0:8080 -t publicThen open http://127.0.0.1:8080. Remote access is blocked unless WEB_ALLOW_REMOTE=true.
For a simpler startup (and for containerized screenshot tools), use:
bin/serve-ui.shRemove the
public/directory (or the whole project) after scanning.
- Table: human-readable ASCII table
- JSON: structured export for incident response
âś… Scans suspicious patterns (e.g., eval, <script>, base64_decode) in known option keys.
❌ Does not disinfect files, detect every attack, or fix WordPress.
- No results but still compromised? Add option names or broaden rules.
- DB errors: verify
.env, confirm DB user has read-only access. - Remote UI blocked: expected for safety—use CLI or localhost.
This tool identifies suspicious patterns only. Always perform a full incident response and restore from clean backups when in doubt.
Delete the scanner files immediately after scanning:
rm -rf wp-malware-scannerMIT License