summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xphp-malware-finder/phpmalwarefinder22
1 files changed, 20 insertions, 2 deletions
diff --git a/php-malware-finder/phpmalwarefinder b/php-malware-finder/phpmalwarefinder
index 02f7594..de25a36 100755
--- a/php-malware-finder/phpmalwarefinder
+++ b/php-malware-finder/phpmalwarefinder
@@ -106,6 +106,18 @@ one_line_trick() {
106 106
107} 107}
108 108
109needle_in_haystack() {
110
111 needle=$(mktemp)
112 egrep '(PasswordProtection|Websites|TooShort|NonPrintableChars)' $1 > $needle
113 if [ ! "$(wc -l $needle)" = "0" ]; then
114 echo "================================================="
115 echo "You should take a look at the files listed below:"
116 cat $needle
117 fi;
118 rm $needle
119}
120
109show_help() { 121show_help() {
110 cat << EOF 122 cat << EOF
111Usage ${0##*/} [-cfhtvl] <file|folder> ... 123Usage ${0##*/} [-cfhtvl] <file|folder> ...
@@ -181,8 +193,9 @@ then
181fi 193fi
182 194
183 195
184if [ ! -e "${LONG_LINES}" ] 196if [ -e "${LONG_LINES}" ]
185then 197then
198 echo long lines checked
186one_line_trick "$@" 199one_line_trick "$@"
187fi 200fi
188 201
@@ -190,5 +203,10 @@ fi
190CONFIG_PATH=${CONFIG_PATH%/*}/ 203CONFIG_PATH=${CONFIG_PATH%/*}/
191OPTS="${OPTS} -r ${CONFIG_PATH}${FORMAT}.yar" 204OPTS="${OPTS} -r ${CONFIG_PATH}${FORMAT}.yar"
192 205
206# Copy outpout to temporary file
207output=$(mktemp)
193# Execute rules 208# Execute rules
194${NICE} ${NICE_OPTS} $YARA $OPTS "$@" 209${NICE} ${NICE_OPTS} $YARA $OPTS "$@" |tee $output
210
211needle_in_haystack $output
212rm $output # comment this if you want to keep output