From 077359976a23322a8f9f085ddc7df5d7aea5fe5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20S=C3=89RIE?= Date: Tue, 17 Mar 2015 16:38:45 +0100 Subject: [PATCH] Redirect stderr of wc to /dev/null due to vanished files. --- evomalware.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evomalware.sh b/evomalware.sh index b44b553..732acaf 100644 --- a/evomalware.sh +++ b/evomalware.sh @@ -65,7 +65,7 @@ while read file; do elif [[ "$file" =~ "wp-content/uploads/" ]]; then echo "PHP file in a non-PHP folder detected: $file" # Count the length of the longest line and search if suspect php functions are used. - elif [[ $($wc -L "$file" | cut -d' ' -f1) -gt 10000 ]]; then + elif [[ $($wc -L "$file" 2>/dev/null | cut -d' ' -f1) -gt 10000 ]]; then grep -q -E "$suspect" "$file" if [[ $? -eq 0 ]]; then echo "Suspect file! More than 10000 characters in one line (and suspect PHP functions): $file." @@ -104,4 +104,4 @@ if ( $aggressive ); then $grep -r 'eval(' . $grep -r '\x..\x..' . $grep -r 'chr(rand(' . -fi \ No newline at end of file +fi