summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjvoisin2015-06-30 15:50:01 +0200
committerjvoisin2015-06-30 15:50:01 +0200
commit77e5a33cfac0b750543297cd9c8756b81d969614 (patch)
tree6a5dc0928fbc840a33b4ebbba38a18aa32291254
parent96d3ab78766aef646879f05175227cc59d19aac7 (diff)
Simplify a bit the rules
-rw-r--r--malwares.yara4
1 files changed, 2 insertions, 2 deletions
diff --git a/malwares.yara b/malwares.yara
index 3081e15..6e28d40 100644
--- a/malwares.yara
+++ b/malwares.yara
@@ -54,7 +54,6 @@ private rule CloudFlareBypass
54rule ObfuscatedPhp 54rule ObfuscatedPhp
55{ 55{
56 strings: 56 strings:
57 $vars = /\$___+/ // $__ is rarely used in legitimate scripts
58 $eval = /[;}][\t ]*@?(eval|preg_replace|system|exec)\(/ // ;eval( <- this is dodgy 57 $eval = /[;}][\t ]*@?(eval|preg_replace|system|exec)\(/ // ;eval( <- this is dodgy
59 $align = /(\$\w+=[^;]*)*;\$\w+=@?\$\w+\(/ //b374k 58 $align = /(\$\w+=[^;]*)*;\$\w+=@?\$\w+\(/ //b374k
60 $oneliner = /<\?php\s*\n*\r*\s*(eval|preg_replace|system|exec)\(/ 59 $oneliner = /<\?php\s*\n*\r*\s*(eval|preg_replace|system|exec)\(/
@@ -63,7 +62,7 @@ rule ObfuscatedPhp
63 $danone = /\$s20=strtoupper\((\$[0-9A-Za-z]{1,4}\[\d+\]\.){2,9}[^\)]*\);if/ 62 $danone = /\$s20=strtoupper\((\$[0-9A-Za-z]{1,4}\[\d+\]\.){2,9}[^\)]*\);if/
64 $strange_arg = /\${\$[0-9a-zA-z]+}/ 63 $strange_arg = /\${\$[0-9a-zA-z]+}/
65 condition: 64 condition:
66 IsPhp and ($align or $oneliner or $eval or $launcher or $strange_arg or #vars > 5 or $weevely3 or $danone) 65 IsPhp and any of them
67} 66}
68 67
69private rule base64 68private rule base64
@@ -98,6 +97,7 @@ rule SuspiciousEncoding
98rule DodgyPhp 97rule DodgyPhp
99{ 98{
100 strings: 99 strings:
100 $vars = /\$___+/ // $__ is rarely used in legitimate scripts
101 $execution = /(eval|passthru|exec|system|win_shell_execute) *\((base64_decode|php:\/\/input|str_rot13|gz(inflate|uncompress)|getenv|\\?\$_(GET|REQUEST|POST))/ 101 $execution = /(eval|passthru|exec|system|win_shell_execute) *\((base64_decode|php:\/\/input|str_rot13|gz(inflate|uncompress)|getenv|\\?\$_(GET|REQUEST|POST))/
102 $double_encoding = /(base64_decode\s*\(\s*){2}/ 102 $double_encoding = /(base64_decode\s*\(\s*){2}/
103 $basedir_bypass = /(curl_init\([\"']file:[\"']|file:file:\/\/)/ 103 $basedir_bypass = /(curl_init\([\"']file:[\"']|file:file:\/\/)/