From 3114ac27af22899d30a5a6e8f3a127589b0041e3 Mon Sep 17 00:00:00 2001 From: Julien Voisin Date: Mon, 9 Mar 2015 10:56:44 +0100 Subject: More obfuscator detection --- malwares.yara | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/malwares.yara b/malwares.yara index 96c5134..f75342e 100644 --- a/malwares.yara +++ b/malwares.yara @@ -7,10 +7,11 @@ - http://obfuscator.uk/example/ - http://w3webtools.com/encode-php-online/ - http://www.joeswebtools.com/security/php-obfuscator/ - - Weevely3 + - https://github.com/epinna/weevely3 - http://cipherdesign.co.uk/service/php-obfuscator - http://sysadmin.cyklodev.com/online-php-obfuscator/ - http://mohssen.org/SpinObf.php + - https://code.google.com/p/carbylamine/ */ private rule IsPhp @@ -38,26 +39,17 @@ private rule IRC 5 of them } -private rule Weevely3 -{ - strings: - $launcher = /\$\w=\$[a-zA-Z]\('',\$\w\);\$\w\(\);/ - $replace = /\$\w=str_replace\('.', ''(,\$\w)+\);/ - - condition: - any of them -} - rule ObfuscatedPhp { strings: $vars = /\$_{2,}/ fullword // $__ is rarely used in legitimate scripts $hexvars = /\${['"][\w\\]+['"]}/ fullword // ${blablabla} $eval_start = /(\s)*<\?(php)?(\n)*(\s)*eval\(/ // 5 or #hexvars > 5 or Weevely3) + IsPhp and ($eval_start or $eval or $launcher or #vars > 5 or #hexvars > 5 or $weevely3) } rule CloudFlareBypass @@ -79,8 +71,8 @@ rule DodgyPhp $safemode_bypass = /\x00\/\.\.\/|LD_PRELOAD/ $shellshock = /putenv\(["']PHP_[^=]=\(\) { [^}] };/ $restore_bypass = /ini_restore\(['"](safe_mode|open_basedir)['"]\)/ - $various = "