diff --git a/modules/security/malware-scanner.sh b/modules/security/malware-scanner.sh index fc7088c..fdf34c2 100755 --- a/modules/security/malware-scanner.sh +++ b/modules/security/malware-scanner.sh @@ -817,7 +817,27 @@ for scanner in "${AVAILABLE_SCANNERS[@]}"; do LAST_SCAN="" TOTAL_FILES_SCANNED=0 - for path in "${SCAN_PATHS[@]}"; do + # ImunifyAV has built-in exclusions that skip /usr, /opt, /var system directories + # When scanning "/", expand to comprehensive paths for better coverage + local IMUNIFY_SCAN_PATHS=() + if [ "${#SCAN_PATHS[@]}" -eq 1 ] && [ "${SCAN_PATHS[0]}" = "/" ]; then + log_message "ImunifyAV: Expanding / to comprehensive scan paths" + # Scan all major directories that might contain malware + IMUNIFY_SCAN_PATHS=( + "/home" # All user home directories + "/var/www" # Web content + "/usr/local" # Locally installed software + "/opt" # Optional software packages + "/var/lib" # Variable state information + "/tmp" # Temporary files + "/var/tmp" # Persistent temp files + "/root" # Root user home + ) + else + IMUNIFY_SCAN_PATHS=("${SCAN_PATHS[@]}") + fi + + for path in "${IMUNIFY_SCAN_PATHS[@]}"; do if [ -d "$path" ]; then log_message "ImunifyAV: Scanning $path" echo "" @@ -1968,8 +1988,8 @@ show_scan_menu() { echo "" echo -e "${CYAN}Create New Scan:${NC}" - echo " 1. Scan entire server" - echo " 2. Scan specific user" + echo " 1. Scan entire server (full system - all directories)" + echo " 2. Scan specific user account" echo " 3. Scan specific domain" echo " 4. Scan custom path" echo ""