diff options
| author | jvoisin | 2016-07-08 15:37:03 +0200 |
|---|---|---|
| committer | jvoisin | 2016-07-08 15:37:03 +0200 |
| commit | 2417f4477ae56a856a154c056e95b737ad7c28f4 (patch) | |
| tree | e44393a5f81a092db8ba83fdee1c0c85937e254a | |
| parent | 8b7406123865b83743ba24539304ad0b08ef518f (diff) | |
Fix the previous commit
It seems that a lot of jpeg files contain some <?php stuff :/
| -rw-r--r-- | php-malware-finder/php.yar | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/php-malware-finder/php.yar b/php-malware-finder/php.yar index c7af3f2..d4a77c1 100644 --- a/php-malware-finder/php.yar +++ b/php-malware-finder/php.yar | |||
| @@ -33,17 +33,6 @@ global private rule IsPhp | |||
| 33 | $php and filesize < 5MB | 33 | $php and filesize < 5MB |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | rule HiddenInAFile | ||
| 37 | { | ||
| 38 | strings: | ||
| 39 | $gif = {47 49 46 38 ?? 61} // GIF8[version]a | ||
| 40 | $png = {89 50 4E 47 0D 0a 1a 0a} // \X89png\X0D\X0A\X1A\X0A | ||
| 41 | $jpeg = {FF D8 FF E0 ?? ?? 4A 46 49 46 } // https://raw.githubusercontent.com/corkami/pics/master/JPG.png | ||
| 42 | |||
| 43 | condition: | ||
| 44 | $gif at 0 or $png at 0 or $jpeg at 0 | ||
| 45 | } | ||
| 46 | |||
| 47 | rule PasswordProtection | 36 | rule PasswordProtection |
| 48 | { | 37 | { |
| 49 | strings: | 38 | strings: |
| @@ -152,3 +141,13 @@ rule DangerousPhp | |||
| 152 | not $whitelist and (5 of them or #system > 250) and not IsWhitelisted | 141 | not $whitelist and (5 of them or #system > 250) and not IsWhitelisted |
| 153 | } | 142 | } |
| 154 | 143 | ||
| 144 | rule HiddenInAFile | ||
| 145 | { | ||
| 146 | strings: | ||
| 147 | $gif = {47 49 46 38 ?? 61} // GIF8[version]a | ||
| 148 | $png = {89 50 4E 47 0D 0a 1a 0a} // \X89png\X0D\X0A\X1A\X0A | ||
| 149 | $jpeg = {FF D8 FF E0 ?? ?? 4A 46 49 46 } // https://raw.githubusercontent.com/corkami/pics/master/JPG.png | ||
| 150 | |||
| 151 | condition: | ||
| 152 | ($gif at 0 or $png at 0 or $jpeg at 0) and (PasswordProtection or ObfuscatedPhp or DodgyPhp or DangerousPhp) | ||
| 153 | } | ||
