summaryrefslogtreecommitdiff
path: root/phpmalwarefinder
diff options
context:
space:
mode:
authorJulien "shaddai" Reveret2015-10-08 17:44:47 +0200
committerMathieu Deous2015-10-29 14:55:04 +0100
commitff0c609ce15299fcd0da5f5b471d3519495977ff (patch)
treeb217ff3ed047ad0f63c4e39b8f400eebafa0d1a3 /phpmalwarefinder
parent1b88cf3b85d8e3225fb55526f53cbf4df75d9813 (diff)
reorganized git repo
Diffstat (limited to 'phpmalwarefinder')
-rwxr-xr-xphpmalwarefinder90
1 files changed, 0 insertions, 90 deletions
diff --git a/phpmalwarefinder b/phpmalwarefinder
deleted file mode 100755
index c49a7bd..0000000
--- a/phpmalwarefinder
+++ /dev/null
@@ -1,90 +0,0 @@
1#!/usr/bin/env bash
2
3YARA=$(type -P yara)
4CONFIG_PATH='/etc/phpmalwarefinder/malwares.yara'
5IONICE_BIN=$(type -P ionice)
6NICE_BIN=$(type -P nice)
7
8if [ ! -f "$YARA" ]
9then
10 YARA='./yara'
11fi
12
13if [ ! -f "$CONFIG_PATH" ]
14then
15 CONFIG_PATH='./malwares.yara'
16fi
17
18if [ -f "${IONICE_BIN}" ]
19then
20 NICE=${IONICE_BIN}
21 NICE_OPTS="-c 3"
22else
23 if [ -f "${NICE_BIN}" ]
24 then
25 NICE=${NICE_BIN}
26 NICE_OPTS="-n 20"
27 fi
28fi
29
30show_help() {
31 cat << EOF
32Usage ${0##*/} [-cfhw] <file|folder> ...
33 -c Optional path to a configuration file
34 -f Fast mode
35 -h Show this help message
36 -v Verbose mode
37EOF
38}
39
40OPTIND=1
41while getopts "c:fhv" opt; do
42 case "$opt" in
43 h)
44 show_help
45 exit 0
46 ;;
47 f)
48 OPTS="${OPTS} -f"
49 ;;
50 c)
51 CONFIG_PATH=${OPTARG}
52 ;;
53 v)
54 OPTS="${OPTS} -s"
55 ;;
56 '?')
57 show_help
58 exit 1
59 ;;
60 esac
61done
62shift "$((OPTIND-1))"
63
64if [ ! -e ${YARA} ]
65then
66 echo "Can't find yara. Did you installed it?"
67 exit 1
68fi
69
70if [ ! -e ${CONFIG_PATH} ]
71then
72 echo "${CONFIG_PATH} doesn't exist. Please give me a valid file."
73 exit 1
74fi
75
76if [ -z $@ ]
77then
78 show_help
79 exit 1
80fi
81
82if [ ! -e ${NICE} ]
83then
84 echo "No nice program available. Please install ionice or nice."
85 exit 1
86fi
87
88OPTS="${OPTS} -r ${CONFIG_PATH}"
89
90${NICE} ${NICE_OPTS} $YARA $OPTS $@