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:
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.
Detection is performed by crawling the filesystem and testing files against a set of YARA rules. Yes, it’s that simple!
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 system
“.
sudo apt-get install yara
yum install yara
(requires the EPEL repository)You can also compile it from source:
git clone git@github.com:VirusTotal/yara.git
cd yara/
YACC=bison ./configure
make
git clone https://github.com/jvoisin/php-malware-finder.git
$ ./phpmalwarefinder -h
Usage phpmalwarefinder [-cfhtvl] …
-c Optional path to a rule file
-f Fast mode
-h Show this help message
-t Specify the number of threads to use (8 by default)
-v Verbose mode
Or if you prefer to use yara
:
$ yara -r ./php.yar /var/www
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 make tests
.
Check the whitelist.yar file. If you’re lazy, you can generate whitelists for entire folders with the generate_whitelist.py script.
Because:
Prompt injection is a type of security vulnerability that can be exploited to control the…
Firefly is an advanced black-box fuzzer and not just a standard asset discovery tool. Firefly…
Winit is a robust, cross-platform library designed for creating and managing windows in Rust applications.…
In today’s digital age, convenience often comes at the cost of security. One such overlooked…
Terminal GPT (tgpt) offers a seamless way to bring the power of ChatGPT 3.5 directly…
garak checks if an LLM can be made to fail in a way we don't…