diff options
| author | Julien (jvoisin) Voisin | 2016-04-11 17:00:04 +0200 |
|---|---|---|
| committer | Julien (jvoisin) Voisin | 2016-04-11 17:09:37 +0200 |
| commit | dac09770e449526b799254bd19c710c664bfe2bd (patch) | |
| tree | f79f7aa0ae76778435cec475c7e7103eb8542197 | |
| parent | 3854653c8686cf9ff9bbab13f09d1566682efb5e (diff) | |
Whitelist UHTMLPufifier
| -rw-r--r-- | php-malware-finder/php.yara | 2 | ||||
| -rwxr-xr-x | php-malware-finder/tests.sh | 1 | ||||
| -rw-r--r-- | php-malware-finder/whitelist.yara | 10 |
3 files changed, 10 insertions, 3 deletions
diff --git a/php-malware-finder/php.yara b/php-malware-finder/php.yara index 416215f..1370543 100644 --- a/php-malware-finder/php.yara +++ b/php-malware-finder/php.yara | |||
| @@ -53,7 +53,7 @@ rule ObfuscatedPhp | |||
| 53 | $weevely3 = /\$\w=\$[a-zA-Z]\('',\$\w\);\$\w\(\);/ // weevely3 launcher | 53 | $weevely3 = /\$\w=\$[a-zA-Z]\('',\$\w\);\$\w\(\);/ // weevely3 launcher |
| 54 | $c99_launcher = /;\$\w+\(\$\w+(,\s?\$\w+)+\);/ // http://bartblaze.blogspot.fr/2015/03/c99shell-not-dead.html | 54 | $c99_launcher = /;\$\w+\(\$\w+(,\s?\$\w+)+\);/ // http://bartblaze.blogspot.fr/2015/03/c99shell-not-dead.html |
| 55 | $variable_variable = /\${\$[0-9a-zA-z]+}/ | 55 | $variable_variable = /\${\$[0-9a-zA-z]+}/ |
| 56 | $too_many_chr = /(chr\([\d]+\)\.){2}/ // concatenation of more than two `chr()` | 56 | $too_many_chr = /(chr\([\d]+\)\.){5}/ // concatenation of more than two `chr()` |
| 57 | $concat = /(\$[^\n\r]+\.){5}/ // concatenation of more than 5 words | 57 | $concat = /(\$[^\n\r]+\.){5}/ // concatenation of more than 5 words |
| 58 | $var_as_func = /\$_(GET|POST|COOKIE|REQUEST)\s*\[[^\]]+\]\s*\(/ | 58 | $var_as_func = /\$_(GET|POST|COOKIE|REQUEST)\s*\[[^\]]+\]\s*\(/ |
| 59 | $gif = /^GIF89/ | 59 | $gif = /^GIF89/ |
diff --git a/php-malware-finder/tests.sh b/php-malware-finder/tests.sh index 2dee339..3aaceea 100755 --- a/php-malware-finder/tests.sh +++ b/php-malware-finder/tests.sh | |||
| @@ -81,7 +81,6 @@ run_test artificial/dodgy.php '0x126:$ini_get: ini_set("disable_function' | |||
| 81 | run_test artificial/dodgy.php '0x147:$ini_get: ini_restore("allow_url_include' | 81 | run_test artificial/dodgy.php '0x147:$ini_get: ini_restore("allow_url_include' |
| 82 | run_test artificial/dodgy.php '0x18d:$shellshock: () { :;};' | 82 | run_test artificial/dodgy.php '0x18d:$shellshock: () { :;};' |
| 83 | run_test artificial/dodgy.php '0x169:$pr: preg_replace ("/\*/e' | 83 | run_test artificial/dodgy.php '0x169:$pr: preg_replace ("/\*/e' |
| 84 | run_test artificial/dodgy.php '0x1e0:$user_function: call_user_func' | ||
| 85 | run_test artificial/dodgy.php '0x1fd:$various: <!--#exec cmd=' | 84 | run_test artificial/dodgy.php '0x1fd:$various: <!--#exec cmd=' |
| 86 | run_test artificial/dodgy.php '0x214:$: AddType application/x-httpd-php .htaccess' | 85 | run_test artificial/dodgy.php '0x214:$: AddType application/x-httpd-php .htaccess' |
| 87 | 86 | ||
diff --git a/php-malware-finder/whitelist.yara b/php-malware-finder/whitelist.yara index e9bb883..3aab9c5 100644 --- a/php-malware-finder/whitelist.yara +++ b/php-malware-finder/whitelist.yara | |||
| @@ -164,6 +164,13 @@ private rule Phpmyadmin | |||
| 164 | hash.sha1(0, filesize) == "398507962b9dd89b0352f2ea9c648152fe932475" // libraries/DBQbe.class.php | 164 | hash.sha1(0, filesize) == "398507962b9dd89b0352f2ea9c648152fe932475" // libraries/DBQbe.class.php |
| 165 | } | 165 | } |
| 166 | 166 | ||
| 167 | private rule Misc | ||
| 168 | { | ||
| 169 | condition: | ||
| 170 | /* HTMLPurifier standalone 4.6.0 */ | ||
| 171 | hash.sha1(0, filesize) == "9452a5f1183cbef0487b922cc1ba904ea21ad39a" | ||
| 172 | } | ||
| 173 | |||
| 167 | private rule IsWhitelisted | 174 | private rule IsWhitelisted |
| 168 | { | 175 | { |
| 169 | condition: | 176 | condition: |
| @@ -176,5 +183,6 @@ private rule IsWhitelisted | |||
| 176 | Concrete5 or | 183 | Concrete5 or |
| 177 | Dotclear or | 184 | Dotclear or |
| 178 | Owncloud or | 185 | Owncloud or |
| 179 | Phpmyadmin | 186 | Phpmyadmin or |
| 187 | Misc | ||
| 180 | } | 188 | } |
