A command-line malware scanner for WordPress installations on Ubuntu-based servers. It combines ClamAV, Linux Malware Detect (LMD), rkhunter, and custom PHP pattern scanning.
- Deep scan for known PHP malware patterns
- Integration with ClamAV + LMD
- Rootkit detection
- Custom scan reports and log files
- Safe update and quarantine practices
We recommend placing the script in:
/usr/local/bin/wp-malware-scan.shThis ensures it's executable from anywhere on your server via terminal.
# Step 1: Copy the script
sudo cp wp-malware-scan.sh /usr/local/bin/wp-malware-scan.sh
# Step 2: Make it executable
sudo chmod +x /usr/local/bin/wp-malware-scan.sh
# Step 3: Run the script
sudo wp-malware-scan.shYou can optionally define a config file to point to your WordPress installation path:
sudo cp config/wp-malware-scan.conf.sample /etc/wp-malware-scan.confThen edit it:
sudo nano /etc/wp-malware-scan.confExample contents:
# Absolute path to your WordPress installation
WP_PATH="/var/www/html"If this file is missing, the script will default to /var/www/html.
-
Suspicious PHP patterns:
~/suspicious_php.txt -
LMD malware reports:
/usr/local/maldetect/events/ -
Logs and future output locations:
logs/(empty now, for cronjob or future logs)reports/(custom location for structured findings)
MIT