From d9b7742bb7c1179f53429a0d8cab7f0bd04ffe00 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Tue, 26 Jun 2018 18:37:23 +0200 Subject: Detect things like '@include' This should close #71 --- php-malware-finder/php.yar | 1 + php-malware-finder/samples/real/include.php | 4 ++++ php-malware-finder/tests.sh | 1 + 3 files changed, 6 insertions(+) create mode 100644 php-malware-finder/samples/real/include.php 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 $double_var = /\${\s*\${/ $extract = /extract\s*\(\s*\$_(GET|POST|REQUEST|COOKIE|SERVER)/ $reversed = /noitcnuf_etaerc|metsys|urhtssap|edulcni|etucexe_llehs/ nocase + $silenced_include =/@\s*include\s*/ nocase condition: (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 @@ +