What does it detect?
PHP-malware-finder does its very best to detect obfuscated/dodgy code as well as files using PHP functions often used in malwares/webshells.
The following list of encoders/obfuscators/webshells are also detected:
- Best PHP Obfuscator
- Cipher Design
- Joes Web Tools Obfuscator
- PHP Jiami
- Php Obfuscator Encode
- cobra obfuscator
Of course it’s trivial to bypass PMF, but its goal is to catch kiddies and idiots, not people with a working brain. If you report a stupid tailored bypass for PMF, you likely belong to one (or both) category, and should re-read the previous statement.
Instead of using an hash-based approach, PMF tries as much as possible to use semantic patterns, to detect things like “a
$_GET variable is decoded two times, unzipped, and then passed to some dangerous function like
- Install Yara.
This is also possible via some Linux package managers:
sudo apt-get install yara
- Red Hat:
yum install yara(requires the EPEL repository)
You can also compile it from source:
git clone https://github.com/jvoisin/php-malware-finder.git
How to use it?
Or if you prefer to use
Please keep in mind that you should use at least YARA 3.4 because we’re using hashes for the whitelist system, and greedy regexps. Please note that if you plan to build yara from sources, libssl-dev must be installed on your system in order to have support for hashes.
Oh, and by the way, you can run the comprehensive testsuite with