mirror of
https://github.com/scr34m/php-malware-scanner.git
synced 2026-06-16 12:30:35 +00:00
Added long single line PHP code pattern
One common tactic is to shove all of your PHP code into a single line, often contained within its own PHP tags, and drop it into any .php file that you want. This pattern should detect if more than 750 characters are contained within PHP tags on a single line.
This commit is contained in:
@@ -29,3 +29,7 @@ chr\s*\(\s*['"]?\s*((95)|(0[Xx]5[Ff]))\s*['"]?\s*\)
|
|||||||
#Detects generic base64 strings longer than 260 characters enclosed in quotes ending with 0-3 '=' chars.
|
#Detects generic base64 strings longer than 260 characters enclosed in quotes ending with 0-3 '=' chars.
|
||||||
#260 was a threshold chosen because strings of 256 characters are common enough. Might increase later to reduce false positives.
|
#260 was a threshold chosen because strings of 256 characters are common enough. Might increase later to reduce false positives.
|
||||||
['"][A-Za-z0-9+\/]{260,}={0,3}['"]
|
['"][A-Za-z0-9+\/]{260,}={0,3}['"]
|
||||||
|
|
||||||
|
#Detects long single lines contained within PHP tags.
|
||||||
|
#We can increase from 750 later if we need to.
|
||||||
|
^.*<\?php.{750,}\?>.*$
|
||||||
|
|||||||
Reference in New Issue
Block a user