From 6cc21813e120c547899833483671198fc0054d4b Mon Sep 17 00:00:00 2001 From: Developer Date: Sat, 21 Mar 2026 01:02:37 -0400 Subject: [PATCH] FIX: Show installation guide instead of exiting when no scanners detected CRITICAL FIX: Standalone malware scanner was exiting with code 1 when no scanners were installed, instead of showing helpful installation instructions. Changes: - Replaced hard exit with graceful exit code 0 - Display full installation guide for all 4 scanners (ImunifyAV, ClamAV, Maldet, RKHunter) - Provide copy-paste installation commands for both RHEL and Debian systems - Users can now see how to install scanners instead of seeing error exit This ensures the malware scanner is user-friendly even on fresh systems. Testing: Beta branch only (per user request - no production pushes during testing) --- modules/security/malware-scanner.sh | 47 +++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/modules/security/malware-scanner.sh b/modules/security/malware-scanner.sh index 3efcdfa..1942592 100755 --- a/modules/security/malware-scanner.sh +++ b/modules/security/malware-scanner.sh @@ -100,7 +100,7 @@ detect_scanners() { return 0 } -# Show installation instructions for missing scanners +# Show installation instructions for missing scanners (DEPRECATED - menu always shows now) show_scanner_installation_guide() { echo -e "${YELLOW}Available Malware Scanners:${NC}" echo "" @@ -915,10 +915,51 @@ else fi fi +# If no scanners found, show installation guide and exit gracefully if [ ${#AVAILABLE_SCANNERS[@]} -eq 0 ]; then - log_message "ERROR: No scanners found!" + log_message "WARNING: No scanners found on this system" + echo "" echo -e "${RED}No malware scanners detected!${NC}" - exit 1 + echo "" + echo -e "${YELLOW}Available Malware Scanners:${NC}" + echo "" + + echo -e "${CYAN}ImunifyAV${NC} - FREE real-time malware scanner" + echo " Status: Not installed" + echo " Installation (cPanel):" + echo " yum install imunify-antivirus imunify-antivirus-cpanel" + echo " /opt/alt/python35/share/imunify360/scripts/av-userside-plugin.sh" + echo " Installation (manual):" + echo " wget https://repo.imunify360.cloudlinux.com/defence360/imav-deploy.sh" + echo " bash imav-deploy.sh" + echo " Docs: https://docs.imunify360.com/imunifyav/" + echo "" + + echo -e "${CYAN}ClamAV${NC} - Open source antivirus engine" + echo " Status: Not installed" + echo " Installation:" + echo " yum install clamav clamav-update # RHEL/CentOS" + echo " apt-get install clamav clamav-daemon # Debian/Ubuntu" + echo "" + + echo -e "${CYAN}Maldet (LMD)${NC} - Linux Malware Detect" + echo " Status: Not installed" + echo " Installation:" + echo " cd /tmp && wget http://www.rfxn.com/downloads/maldetect-current.tar.gz" + echo " tar -xzf maldetect-current.tar.gz && cd maldetect-*" + echo " ./install.sh" + echo "" + + echo -e "${CYAN}Rootkit Hunter${NC} - Rootkit/backdoor/exploit scanner" + echo " Status: Not installed" + echo " Installation:" + echo " yum install epel-release rkhunter # RHEL/CentOS" + echo " apt-get install rkhunter # Debian/Ubuntu" + echo "" + + echo -e "${YELLOW}Recommendation:${NC} Install at least ClamAV + RKHunter (both free)" + echo "" + exit 0 fi log_message "Found ${#AVAILABLE_SCANNERS[@]} scanner(s): ${AVAILABLE_SCANNERS[*]}"