Traversing directories for files with php extensions and testing files against text or regexp rules, the rules based on self gathered samples and publicly available malwares/webshells.
*`--base64` is an alternative scan mode which ignores the main pattern files and uses a large list of php keywords and functions that have been converted to base64. Slower and prone to false positives, but gives additional base64 scanning coverage. These pattern files are located in base64_patterns and were derived from php 7 keywords and functions. Not many PHP extensions are included.
*`--comment` flag will display the last comment to appear in the pattern file before the matched pattern, so documenting the pattern files is important.
Output formatting
-----------------
Default output depending on the specified parameters, but the full format is "%S %T %M # {%F} %C %P # %L" and using ANSI coloring too.
Possible variables are:
*`%S` - matching indicator, possible values are OK, ER, WL
There are three main pattern files the cover different types of pattern matching. There is one pattern per line. All lines where the very first character is a "`#`" is considered a comment and not used as a pattern. Whitespace in the pattern files is not used.
See [whitelist.txt](https://github.com/scr34m/php-malware-scanner/blob/master/whitelist.txt) file for a predefined MD5 hash list. Only the first 32 characters are used, rest of the line ignored so feel free to leave a comment.
You can automatically add md5sum from wordpress core files by specifing version as argument to --wordpress-version or -j.
Example:
```
scan -d . -j 4.9.2
```
That will automatically get md5sums from wordpress api (https://api.wordpress.org/core/checksums/1.0/?version=x.x.x) and add it to whitelist. To check your version simply check wp-includes/version.php file of your wordpress