summaryrefslogtreecommitdiff
path: root/phpmalwarefinder
diff options
context:
space:
mode:
authorJulien Voisin2015-03-24 10:59:18 +0100
committerJulien Voisin2015-03-24 10:59:18 +0100
commit155add4d398ae8a4a610d78b8284a0ccd3eb86cf (patch)
treeed4cb52775c01d985cb077b4584673a8a8711d80 /phpmalwarefinder
parenta113aa63fa45497b6393ed3cc87f6f1ef35c8e6e (diff)
Add a script to run the thingy
Diffstat (limited to 'phpmalwarefinder')
-rwxr-xr-xphpmalwarefinder54
1 files changed, 54 insertions, 0 deletions
diff --git a/phpmalwarefinder b/phpmalwarefinder
new file mode 100755
index 0000000..66cdb92
--- /dev/null
+++ b/phpmalwarefinder
@@ -0,0 +1,54 @@
1#!/bin/bash
2
3YARA=$(which yara)
4CONFIG_PATH='/etc/phpmalwarefinder/malwares.yara'
5
6show_help() {
7 cat << EOF
8Usage ${0##*/} [-dhw]
9 -c Optional path to a configuration file
10 -f Fast mode
11 -h Show this help message
12 -v Verbose mode
13EOF
14}
15
16OPTIND=1
17while getopts "c:fhv" opt; do
18 case "$opt" in
19 h)
20 show_help
21 exit 0
22 ;;
23 f)
24 OPTS="${OPTS} -f"
25 ;;
26 c)
27 CONFIG_PATH=${OPTARG}
28 ;;
29 v)
30 OPTS="${OPTS} -s"
31 ;;
32 '?')
33 show_help
34 exit 1
35 ;;
36 esac
37done
38shift "$((OPTIND-1))"
39
40if [ ! -e ${YARA} ]
41then
42 echo "Can't find yara. Did you installed it?"
43 exit 1
44fi
45
46if [ ! -e ${CONFIG_PATH} ]
47then
48 echo "${CONFIG_PATH} doesn't exist. Please give me a valid file."
49 exit 1
50fi
51
52OPTS="${OPTS} -r ${CONFIG_PATH}"
53
54$YARA $OPTS $@ \ No newline at end of file