From 209bf106d16396f9b4f67e96869014eee962598c Mon Sep 17 00:00:00 2001 From: Dyan Galih Date: Fri, 22 Dec 2023 14:56:46 +0700 Subject: [PATCH] added find writeable files or folders --- scan.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scan.sh b/scan.sh index 622e368..94134ea 100644 --- a/scan.sh +++ b/scan.sh @@ -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 @@ -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 \ No newline at end of file +fi + +echo "===================================================================================================" +echo "writeable file or folder list:" + +find $path -type d,f -perm /u=w,g=w,o=w \ No newline at end of file