diff options
| author | Julien "shaddai" Reveret | 2015-10-08 17:44:47 +0200 |
|---|---|---|
| committer | Mathieu Deous | 2015-10-29 14:55:04 +0100 |
| commit | ff0c609ce15299fcd0da5f5b471d3519495977ff (patch) | |
| tree | b217ff3ed047ad0f63c4e39b8f400eebafa0d1a3 /phpmalwarefinder | |
| parent | 1b88cf3b85d8e3225fb55526f53cbf4df75d9813 (diff) | |
reorganized git repo
Diffstat (limited to 'phpmalwarefinder')
| -rwxr-xr-x | phpmalwarefinder | 90 |
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 | |||
| 3 | YARA=$(type -P yara) | ||
| 4 | CONFIG_PATH='/etc/phpmalwarefinder/malwares.yara' | ||
| 5 | IONICE_BIN=$(type -P ionice) | ||
| 6 | NICE_BIN=$(type -P nice) | ||
| 7 | |||
| 8 | if [ ! -f "$YARA" ] | ||
| 9 | then | ||
| 10 | YARA='./yara' | ||
| 11 | fi | ||
| 12 | |||
| 13 | if [ ! -f "$CONFIG_PATH" ] | ||
| 14 | then | ||
| 15 | CONFIG_PATH='./malwares.yara' | ||
| 16 | fi | ||
| 17 | |||
| 18 | if [ -f "${IONICE_BIN}" ] | ||
| 19 | then | ||
| 20 | NICE=${IONICE_BIN} | ||
| 21 | NICE_OPTS="-c 3" | ||
| 22 | else | ||
| 23 | if [ -f "${NICE_BIN}" ] | ||
| 24 | then | ||
| 25 | NICE=${NICE_BIN} | ||
| 26 | NICE_OPTS="-n 20" | ||
| 27 | fi | ||
| 28 | fi | ||
| 29 | |||
| 30 | show_help() { | ||
| 31 | cat << EOF | ||
| 32 | Usage ${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 | ||
| 37 | EOF | ||
| 38 | } | ||
| 39 | |||
| 40 | OPTIND=1 | ||
| 41 | while 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 | ||
| 61 | done | ||
| 62 | shift "$((OPTIND-1))" | ||
| 63 | |||
| 64 | if [ ! -e ${YARA} ] | ||
| 65 | then | ||
| 66 | echo "Can't find yara. Did you installed it?" | ||
| 67 | exit 1 | ||
| 68 | fi | ||
| 69 | |||
| 70 | if [ ! -e ${CONFIG_PATH} ] | ||
| 71 | then | ||
| 72 | echo "${CONFIG_PATH} doesn't exist. Please give me a valid file." | ||
| 73 | exit 1 | ||
| 74 | fi | ||
| 75 | |||
| 76 | if [ -z $@ ] | ||
| 77 | then | ||
| 78 | show_help | ||
| 79 | exit 1 | ||
| 80 | fi | ||
| 81 | |||
| 82 | if [ ! -e ${NICE} ] | ||
| 83 | then | ||
| 84 | echo "No nice program available. Please install ionice or nice." | ||
| 85 | exit 1 | ||
| 86 | fi | ||
| 87 | |||
| 88 | OPTS="${OPTS} -r ${CONFIG_PATH}" | ||
| 89 | |||
| 90 | ${NICE} ${NICE_OPTS} $YARA $OPTS $@ | ||
