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:
nichogenius
2017-08-15 12:03:19 -06:00
committed by GitHub
parent ab8a6c471a
commit 19589b8311

View File

@@ -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,}\?>.*$