Skip to content

Commit

Permalink
added find writeable files or folders
Browse files Browse the repository at this point in the history
  • Loading branch information
DyanGalih committed Dec 22, 2023
1 parent 1d9670b commit 209bf10
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion scan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,18 @@ for string in "${search_strings[@]}"; do
done < <(grep -Rlw "$path" -e "$string")
done

echo "==================================================================================================="
echo "suspect file list:"

# Remove duplicates from the array grep_results
readarray -t unique_grep_results < <(printf '%s\n' "${grep_results[@]}" | sort -u)

# Display the unique results
printf '%s\n' "${unique_grep_results[@]}"

echo "==================================================================================================="
echo "backdoor suspect list:"

# Check if unique_grep_results is not empty
if [ ${#unique_grep_results[@]} -ne 0 ]; then
# Loop through each file in unique_grep_results
Expand All @@ -57,4 +63,9 @@ if [ ${#unique_grep_results[@]} -ne 0 ]; then
echo "The file $file is not backdoor, please inform this script author for next investigation."
fi
done
fi
fi

echo "==================================================================================================="
echo "writeable file or folder list:"

find $path -type d,f -perm /u=w,g=w,o=w

0 comments on commit 209bf10

Please sign in to comment.