summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxarkes2016-04-11 11:22:01 +0200
committerJulien (jvoisin) Voisin2016-04-11 17:09:34 +0200
commit3854653c8686cf9ff9bbab13f09d1566682efb5e (patch)
tree4615cb15e9c81428068ae3a3f13faf10cc426e0d
parentb1f5377f011ff1eeab9bec96261667ed566c6fbe (diff)
Fixed debian package + readme
Diffstat (limited to '')
-rw-r--r--.travis.yml6
-rw-r--r--Makefile10
-rw-r--r--README.md5
-rw-r--r--debian/nbs-phpmalwarefinder.install4
-rw-r--r--php-malware-finder/php.yara1
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 @@
1language: c 1language: c
2 2
3addons:
4 apt:
5 packages:
6 - devscripts
7
3install: 8install:
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
12script: 17script:
13 - make tests 18 - make tests
19 - make package
diff --git a/Makefile b/Makefile
index c57ef4d..ddf79b7 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
1VERSION=1.0 1VERSION=1.0
2DEBVER := $(shell cut -d'.' -f1 < /etc/debian_version) 2DEBVER := $(shell sed 's,[/\.].*,,' < /etc/debian_version)
3 3
4tests: 4tests:
5 @cd ./php-malware-finder && bash ./tests.sh 5 @cd ./php-malware-finder && bash ./tests.sh
@@ -10,14 +10,16 @@ clean:
10 10
11extract: 11extract:
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
15set_distribution: 17set_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
18check_distribution: 20check_distribution:
19ifeq ($(DEBVER),6) 21ifeq ($(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
21endif 23endif
22 24
23package: clean extract set_distribution check_distribution 25package: clean extract set_distribution check_distribution
diff --git a/README.md b/README.md
index 5778d06..7ed97d3 100644
--- a/README.md
+++ b/README.md
@@ -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
49Detection is performed by crawling the filesystem and testing files against a 49Detection 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 )
51of [YARA](https://plusvic.github.io/yara/) rules. Yes, it's that simple! 51of [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> ...
67Or if you prefer to use `yara`: 67Or 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
73Please keep in mind that you should use at least YARA 3.4 because we're using 74Please 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 @@
1malwares.yara etc/phpmalwarefinder 1common.yara etc/phpmalwarefinder
2php.yara etc/phpmalwarefinder
3asp.yara etc/phpmalwarefinder
2whitelist.yara etc/phpmalwarefinder 4whitelist.yara etc/phpmalwarefinder
3phpmalwarefinder usr/bin/ 5phpmalwarefinder usr/bin/
4docroot-check.sh usr/bin/ 6docroot-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: