Skip to content

PHP script to scan WordPress databases for hidden malware in the wp_options table, detecting common malicious code patterns.

Notifications You must be signed in to change notification settings

Kvnbbg/wp-malware-scanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WordPress Malware Scanner Script

License
Version
Status
Contact
Blog

This PHP script scans your WordPress database for suspicious entries in the wp_options table, identifying common malicious code patterns like <script>, eval, base64_decode, and document.write. It assists in detecting and mitigating potential malware threats to your WordPress installation.

Key Features

  • Efficient Malware Detection: Scans for common malicious patterns in the wp_options table.
  • Flexible Usage: Run via a web browser or command line.
  • Security First: The script only reads the database and does not perform any destructive actions.
  • Ease of Use: Designed for quick deployment with minimal configuration.
  • Customizable: Easily edit the script to fit your specific requirements.

Getting Started

Step 1: Download and Configure

  1. Download the scanner.php script or copy the code from here.
  2. Open the file in any text editor.
  3. Update the following database placeholders:
    • your_db_host: Database host (e.g., localhost).
    • your_db_username: Database username.
    • your_db_password: Database password.
    • your_db_name: WordPress database name.

Step 2: Deploy the Script

  1. Upload scanner.php to your WordPress directory (or any accessible directory on your server).

Step 3: Run the Script

Option 1: Via Web Browser

  • Access the script in your browser, e.g., http://yourwebsite.com/scanner.php.

Option 2: Via SSH

  • Log into your server and execute:
    php /path/to/scanner.php

Step 4: Review Findings

  • The script displays suspicious entries (name and truncated value) for your review.
  • Manually inspect and clean any suspicious entries using tools like phpMyAdmin or direct database queries.

Step 5: Remove the Script

After use, delete the scanner.php file from your server to avoid unauthorized access.


Updates and Improvements

New Functionalities

  • Integration with Aikido.dev:
    Future versions will integrate with Aikido.dev to streamline detection and provide real-time updates on vulnerabilities and solutions.

  • Matrix Optimization Scripts:
    Testing various approaches through scripts matrix1.sh, matrix2.sh, and matrix3.sh. These experimental batch scripts aim to enhance system configurations with varying methodologies. Outputs may require expertise for review, especially concerning bit sizing.

Planned Features

  • Translation to PHP:
    Batch functionalities from matrix.sh series will be migrated to PHP for better platform independence and adaptability.

  • Advanced Malware Patterns:
    Expanding detection capabilities to include emerging malware trends.

  • Result Export:
    Generate detailed reports in JSON, XML, or PDF formats.


Known Issues and Limitations

  • Unexpected Output: Experimental features in the matrix.sh series may yield unexpected results requiring specialized expertise.
  • Scope: Focused on the wp_options table; malware in other tables may go undetected.
  • Pattern Recognition: May not detect obfuscated or non-standard malware patterns.

To-Do List

  • Translate batch scripts to PHP for better compatibility.
  • Optimize the matrix.sh series outputs and bit sizing mechanisms.
  • Add support for automatic database cleanup (optional, with confirmations).
  • Develop a GUI-based version for non-technical users.

Contact and Updates

For support, suggestions, or queries, reach out via email:
📧 [email protected]

Stay updated on the latest developments and announcements:
📰 KVNBlog


Disclaimer

This script is a diagnostic tool to help identify potential vulnerabilities. It does not guarantee complete protection or malware detection. Always maintain up-to-date backups of your WordPress database and files.

About

PHP script to scan WordPress databases for hidden malware in the wp_options table, detecting common malicious code patterns.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published