From d3cb2e3407166f4bcb997c247cb02845d7aea915 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 21 Jan 2025 22:55:31 +0530 Subject: [PATCH] U002: find exploitable vulnerabilities --- crawler.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/crawler.sh b/crawler.sh index c949843..0d1516d 100644 --- a/crawler.sh +++ b/crawler.sh @@ -79,6 +79,32 @@ check_vulnerabilities() { echo } +# Function to check for directory listing vulnerability +detect_directory_listing() { + local url="$1" + echo "Checking for Directory Listing Vulnerability:" + response=$(curl -s -I "$url") + if [[ "$response" == *"200 OK"* ]]; then + echo "- Directory listing might be enabled on $url" + else + echo "- Directory listing not detected." + fi +} + +# Function to detect file upload endpoints +check_file_upload_vulnerability() { + local html="$1" + echo "Checking for File Upload Vulnerabilities:" + echo "$html" | grep -oP '(?i)]*type="file"' | sed 's/^/- File upload field detected: /' +} + +# Function to detect sensitive information exposure +check_sensitive_information() { + local html="$1" + echo "Checking for Sensitive Information Exposure:" + echo "$html" | grep -oP '(?i)(password|api_key|secret)[^<>]*' | sed 's/^/- Sensitive information detected: /' +} + # Main function main() { echo " @@ -113,6 +139,9 @@ main() { # Check vulnerabilities check_vulnerabilities "$html" "$url" + detect_directory_listing "$url" + check_file_upload_vulnerability "$html" + check_sensitive_information "$html" } # Run the script