summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xphp-malware-finder/phpmalwarefinder11
1 files changed, 8 insertions, 3 deletions
diff --git a/php-malware-finder/phpmalwarefinder b/php-malware-finder/phpmalwarefinder
index 9853e94..f226a85 100755
--- a/php-malware-finder/phpmalwarefinder
+++ b/php-malware-finder/phpmalwarefinder
@@ -72,8 +72,6 @@ determine_format() {
72 fi 72 fi
73} 73}
74 74
75# before starting yara, check if the file
76# TODO (too heavy)
77one_line_trick() { 75one_line_trick() {
78 76
79 if [ -z "$FORMAT" ]; then 77 if [ -z "$FORMAT" ]; then
@@ -115,12 +113,13 @@ Usage ${0##*/} [-cfhtvl] <file|folder> ...
115 -t Specify the number of threads to use (8 by default) 113 -t Specify the number of threads to use (8 by default)
116 -v Verbose mode 114 -v Verbose mode
117 -l Set language ('asp', 'php') 115 -l Set language ('asp', 'php')
116 -L Check long lines
118 -u update rules 117 -u update rules
119EOF 118EOF
120} 119}
121 120
122OPTIND=1 121OPTIND=1
123while getopts "c:fht:vl:u" opt; do 122while getopts "c:fht:vl:Lu" opt; do
124 case "$opt" in 123 case "$opt" in
125 h) 124 h)
126 show_help 125 show_help
@@ -141,6 +140,9 @@ while getopts "c:fht:vl:u" opt; do
141 l) 140 l)
142 FORMAT=${OPTARG} 141 FORMAT=${OPTARG}
143 ;; 142 ;;
143 L)
144 LONG_LINES=1
145 ;;
144 u) 146 u)
145 update_rules 147 update_rules
146 exit 0 148 exit 0
@@ -177,7 +179,10 @@ then
177fi 179fi
178 180
179 181
182if [ ! -e "${LONG_LINES}" ]
183then
180one_line_trick "$@" 184one_line_trick "$@"
185fi
181 186
182# Include correct yara rule 187# Include correct yara rule
183CONFIG_PATH=${CONFIG_PATH%/*}/ 188CONFIG_PATH=${CONFIG_PATH%/*}/