From 1c7deb02ca805a28d6485f76e44ee0b7fe6f31d4 Mon Sep 17 00:00:00 2001 From: Julien (jvoisin) Voisin Date: Fri, 26 Feb 2016 11:53:40 +0100 Subject: Did you know that php functions aren't case-sensitive ? --- php-malware-finder/malwares.yara | 108 ++++++++++++++++++++------------------- 1 file changed, 55 insertions(+), 53 deletions(-) diff --git a/php-malware-finder/malwares.yara b/php-malware-finder/malwares.yara index a326ef3..81de9e5 100644 --- a/php-malware-finder/malwares.yara +++ b/php-malware-finder/malwares.yara @@ -57,7 +57,7 @@ private rule CloudFlareBypass rule ObfuscatedPhp { strings: - $eval = /(<\?php|[;{}])\s*@?(eval|preg_replace|system|exec|assert|passthru|win_shell_execute)\s*\(/ // ;eval( <- this is dodgy + $eval = /(<\?php|[;{}])\s*@?(eval|preg_replace|system|exec|assert|passthru|win_shell_execute)\s*\(/ nocase // ;eval( <- this is dodgy $b374k = "'ev'.'al'" $align = /(\$\w+=[^;]*)*;\$\w+=@?\$\w+\(/ //b374k $weevely3 = /\$\w=\$[a-zA-Z]\('',\$\w\);\$\w\(\);/ // weevely3 launcher @@ -108,16 +108,16 @@ rule DodgyPhp $basedir_bypass = /curl_init\s*\(\s*["']file:\/\// $basedir_bypass2 = "file:file:///" // https://www.intelligentexploit.com/view-details.html?id=8719 $disable_magic_quotes = /set_magic_quotes_runtime\s*\(\s*0/ - $execution = /(eval|assert|passthru|exec|system|win_shell_execute|base64_decode)\s*\(\s*(base64_decode|php:\/\/input|str_rot13|gz(inflate|uncompress)|getenv|pack|\\?\$_(GET|REQUEST|POST|COOKIE))/ + $execution = /(eval|assert|passthru|exec|include|system|win_shell_execute|base64_decode)\s*\(\s*(base64_decode|php:\/\/input|str_rot13|gz(inflate|uncompress)|getenv|pack|\\?\$_(GET|REQUEST|POST|COOKIE))/ nocase $htaccess = "SetHandler application/x-httpd-php" $iis_com = /IIS:\/\/localhost\/w3svc/ $include = /include\s*\(\s*[^\.]+\.(png|jpg|gif|bmp)/ // Clever includes - $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)/ - $pr = /(preg_replace(_callback)?|mb_ereg_replace|preg_filter)\s*\(\s*['"]\/[^\/]*\/e/ // http://php.net/manual/en/function.preg-replace.php + $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 + $pr = /(preg_replace(_callback)?|mb_ereg_replace|preg_filter)\s*\(\s*['"]\/[^\/]*\/e/ nocase // http://php.net/manual/en/function.preg-replace.php $safemode_bypass = /\x00\/\.\.\/|LD_PRELOAD/ $shellshock = /\(\)\s*{\s*:\s*;\s*}\s*;/ $udp_dos = /fsockopen\s*\(\s*['"]udp:\/\// - $user_function = /(call_user_func|create_function)/ + $user_function = /(call_user_func|create_function)/ nocase $various = "