Wordfence CLI is an open-source, high-performance malware and vulnerability scanner designed for the Linux command line environment. This tool is built to provide site owners, security administrators, operations teams, and security-focused organizations with a powerful and flexible solution for detecting malware and WordPress vulnerabilities at scale.
Wordfense CLI require Python 3.8 or newer installed on your server. To install Wordfence CLI, run the command
pip3 install wordfence
For Ubuntu/Debian:
cd /tmp
wget https://github.com/wordfence/wordfence-cli/releases/latest/download/wordfence.deb
sudo apt install ./wordfence.deb
For RHEL baed OS;
wget https://github.com/wordfence/wordfence-cli/releases/latest/download/wordfence-el9.rpm
sudo dnf install ./wordfence-el9.rpm
To scan all files in /home directory, run
wordfence malware-scan --output-format csv --output-path /root/wordfence-cli-scan.csv /home/
To get the list of infected files, use
cat wordfence-cli-scan.csv | grep "/home/" | awk -F ',' '{print $1}'
In the above command, replace grep “/home/” with the folder where the files are, this will remove non-file lines from the result.
Back to WordPress

Leave a Reply