Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions crawler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)<input[^>]*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 "
Expand Down Expand Up @@ -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
Expand Down