Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

php-malware-finder

> 编程语言
Open source

Detect potentially malicious PHP files

1.5K stars0 likes0 views
WebsiteGitHub

About

Detect potentially malicious PHP files

PHP Malware Finder

 _______  __   __  _______
|  ___  ||  |_|  ||       |
| |   | ||       ||    ___|
| |___| ||       ||   |___   Webshell finder,
|    ___||       ||    ___|   kiddies hunter,
|   |    | ||_|| ||   |		website cleaner.
|___|    |_|   |_||___|

Detect potentially malicious PHP files.

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:

  • Bantam
  • Best PHP Obfuscator
  • Carbylamine
  • Cipher Design
  • Cyklodev
  • Joes Web Tools Obfuscator
  • P.A.S
  • PHP Jiami
  • Php Obfuscator Encode
  • SpinObf
  • Weevely3
  • atomiku
  • cobra obfuscator
  • nano
  • novahot
  • phpencode
  • tennc
  • web-malware-collection
  • webtoolsvn
  • Kraken-ng

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.

How does it work?

Detection is performed by crawling the filesystem and testing files against a set of YARA rules. Yes, it's that simple!

Instead of using a 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".

Installation

From source

  • Install Go >= 1.17 (using your package manager, or manually)
  • Install libyara >= 4.2 (using your package manager, or from source)
  • Download php-malware-finder: git clone https://github.com/jvoisin/php-malware-finder.git
  • Build php-malware-finder: cd php-malware-finder && make

or replace the last 2 steps with go install github.com/jvoisin/php-malware-finder, which will directly compile and install PMF in your ${GOROOT}/bin folder.

How to use it?

…

Or if you prefer to use yara:

$ yara -r ./data/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.

Docker

If you want to avoid having to install Go and libyara, you can also use our docker image and simply mount the folder you want to scan to the container's /data directory:

$ docker run --rm -v /folder/to/scan:/data ghcr.io/jvoisin/php-malware-finder

Whitelisting

Check the whitelist.yar file. If you're lazy, you can generate whitelists for entire folders with the generate_whitelist.py script.

Why should I use it instead of something else?

Because:

  • It doesn't use a single rule per sample, since it only cares about finding malicious patterns, not specific webshells
  • It has a complete testsuite, to avoid regressions
  • Its whitelist system doesn't rely on filenames
  • It doesn't rely on (slow) entropy computation
  • It uses a ghetto-style static analysis, instead of relying on file hashes
  • Thanks to the aforementioned pseudo-static analysis, it works (especially) well on obfuscated files

Licensing

PHP-malware-finder is licensed under the GNU Lesser General Public License v3.

The amazing YARA project is licensed under the Apache v2.0 license.

Patches, whitelists or samples are of course more than welcome.

Issues· 11 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHPantivirusmalwarephpwebshell

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言