Wordfence CLI

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

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

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *