diff options
| author | xarkes | 2016-04-11 11:22:01 +0200 |
|---|---|---|
| committer | Julien (jvoisin) Voisin | 2016-04-11 17:09:34 +0200 |
| commit | 3854653c8686cf9ff9bbab13f09d1566682efb5e (patch) | |
| tree | 4615cb15e9c81428068ae3a3f13faf10cc426e0d | |
| parent | b1f5377f011ff1eeab9bec96261667ed566c6fbe (diff) | |
Fixed debian package + readme
Diffstat (limited to '')
| -rw-r--r-- | .travis.yml | 6 | ||||
| -rw-r--r-- | Makefile | 10 | ||||
| -rw-r--r-- | README.md | 5 | ||||
| -rw-r--r-- | debian/nbs-phpmalwarefinder.install | 4 | ||||
| -rw-r--r-- | php-malware-finder/php.yara | 1 |
5 files changed, 18 insertions, 8 deletions
diff --git a/.travis.yml b/.travis.yml index 9fb27eb..6a89685 100644 --- a/.travis.yml +++ b/.travis.yml | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | language: c | 1 | language: c |
| 2 | 2 | ||
| 3 | addons: | ||
| 4 | apt: | ||
| 5 | packages: | ||
| 6 | - devscripts | ||
| 7 | |||
| 3 | install: | 8 | install: |
| 4 | - git clone --depth 1 https://github.com/plusvic/yara.git yara3 | 9 | - git clone --depth 1 https://github.com/plusvic/yara.git yara3 |
| 5 | - cd yara3 | 10 | - cd yara3 |
| @@ -11,3 +16,4 @@ install: | |||
| 11 | 16 | ||
| 12 | script: | 17 | script: |
| 13 | - make tests | 18 | - make tests |
| 19 | - make package | ||
| @@ -1,5 +1,5 @@ | |||
| 1 | VERSION=1.0 | 1 | VERSION=1.0 |
| 2 | DEBVER := $(shell cut -d'.' -f1 < /etc/debian_version) | 2 | DEBVER := $(shell sed 's,[/\.].*,,' < /etc/debian_version) |
| 3 | 3 | ||
| 4 | tests: | 4 | tests: |
| 5 | @cd ./php-malware-finder && bash ./tests.sh | 5 | @cd ./php-malware-finder && bash ./tests.sh |
| @@ -10,14 +10,16 @@ clean: | |||
| 10 | 10 | ||
| 11 | extract: | 11 | extract: |
| 12 | cp -r debian php-malware-finder | 12 | cp -r debian php-malware-finder |
| 13 | git checkout php-malware-finder/malwares.yara | 13 | git checkout php-malware-finder/common.yara |
| 14 | git checkout php-malware-finder/php.yara | ||
| 15 | git checkout php-malware-finder/asp.yara | ||
| 14 | 16 | ||
| 15 | set_distribution: | 17 | set_distribution: |
| 16 | sed -e "s/##version/`cut -d'.' -f1 < /etc/debian_version`/" -i php-malware-finder/debian/control php-malware-finder/debian/changelog | 18 | sed -e "s/##version/${DEBVER}/" -i php-malware-finder/debian/control php-malware-finder/debian/changelog |
| 17 | 19 | ||
| 18 | check_distribution: | 20 | check_distribution: |
| 19 | ifeq ($(DEBVER),6) | 21 | ifeq ($(DEBVER),6) |
| 20 | sed -e '/too_many_chr/d' -e '/b64_concat/d' -e 's/^import.*//g' -e 's/^include.*//g' -e 's/and\ not\ IsWhitelisted//g' -i php-malware-finder/malwares.yara | 22 | sed -e '/too_many_chr/d' -e '/b64_concat/d' -e 's/^import.*//g' -e 's/^include.*//g' -e 's/and\ not\ IsWhitelisted//g' -i php-malware-finder/common.yara |
| 21 | endif | 23 | endif |
| 22 | 24 | ||
| 23 | package: clean extract set_distribution check_distribution | 25 | package: clean extract set_distribution check_distribution |
| @@ -47,7 +47,7 @@ both) category, and should re-read the previous sentence. | |||
| 47 | ## How does it work? | 47 | ## How does it work? |
| 48 | 48 | ||
| 49 | Detection is performed by crawling the filesystem and testing files against a | 49 | Detection is performed by crawling the filesystem and testing files against a |
| 50 | [set]( https://github.com/nbs-system/php-malware-finder/blob/master/malwares.yara ) | 50 | [set]( https://github.com/nbs-system/php-malware-finder/blob/master/php.yara ) |
| 51 | of [YARA](https://plusvic.github.io/yara/) rules. Yes, it's that simple! | 51 | of [YARA](https://plusvic.github.io/yara/) rules. Yes, it's that simple! |
| 52 | 52 | ||
| 53 | 53 | ||
| @@ -67,7 +67,8 @@ Usage phpmalwarefinder [-cfhtv] [-l (php|asp)] <file|folder> ... | |||
| 67 | Or if you prefer to use `yara`: | 67 | Or if you prefer to use `yara`: |
| 68 | 68 | ||
| 69 | ``` | 69 | ``` |
| 70 | $ yara -r ./malwares.yara /var/www | 70 | $ yara -r ./php.yara /var/www |
| 71 | $ yara -r ./asp.yara /var/www | ||
| 71 | ``` | 72 | ``` |
| 72 | 73 | ||
| 73 | Please keep in mind that you should use at least YARA 3.4 because we're using | 74 | Please keep in mind that you should use at least YARA 3.4 because we're using |
diff --git a/debian/nbs-phpmalwarefinder.install b/debian/nbs-phpmalwarefinder.install index 9727f63..676b4aa 100644 --- a/debian/nbs-phpmalwarefinder.install +++ b/debian/nbs-phpmalwarefinder.install | |||
| @@ -1,4 +1,6 @@ | |||
| 1 | malwares.yara etc/phpmalwarefinder | 1 | common.yara etc/phpmalwarefinder |
| 2 | php.yara etc/phpmalwarefinder | ||
| 3 | asp.yara etc/phpmalwarefinder | ||
| 2 | whitelist.yara etc/phpmalwarefinder | 4 | whitelist.yara etc/phpmalwarefinder |
| 3 | phpmalwarefinder usr/bin/ | 5 | phpmalwarefinder usr/bin/ |
| 4 | docroot-check.sh usr/bin/ | 6 | docroot-check.sh usr/bin/ |
diff --git a/php-malware-finder/php.yara b/php-malware-finder/php.yara index 0f46025..416215f 100644 --- a/php-malware-finder/php.yara +++ b/php-malware-finder/php.yara | |||
| @@ -78,7 +78,6 @@ rule DodgyPhp | |||
| 78 | $safemode_bypass = /\x00\/\.\.\/|LD_PRELOAD/ | 78 | $safemode_bypass = /\x00\/\.\.\/|LD_PRELOAD/ |
| 79 | $shellshock = /\(\)\s*{\s*:\s*;\s*}\s*;/ | 79 | $shellshock = /\(\)\s*{\s*:\s*;\s*}\s*;/ |
| 80 | $udp_dos = /fsockopen\s*\(\s*['"]udp:\/\// | 80 | $udp_dos = /fsockopen\s*\(\s*['"]udp:\/\// |
| 81 | $user_function = /(call_user_func|create_function)/ nocase | ||
| 82 | $various = "<!--#exec cmd=" //http://www.w3.org/Jigsaw/Doc/User/SSI.html#exec | 81 | $various = "<!--#exec cmd=" //http://www.w3.org/Jigsaw/Doc/User/SSI.html#exec |
| 83 | 82 | ||
| 84 | condition: | 83 | condition: |
