From 52a3dbe9223766f7df4c656f989b7405e6c05c20 Mon Sep 17 00:00:00 2001 From: Anoop P Alias Date: Wed, 31 Jan 2018 17:00:24 +0530 Subject: [PATCH] fix maldet not scanning addon/subdomain not in public_html path in cPanel --- cron.daily | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/cron.daily b/cron.daily index 6ceb68a..7197ed6 100755 --- a/cron.daily +++ b/cron.daily @@ -69,37 +69,40 @@ if [ "$(ps -A --user root -o "cmd" | grep -E maldetect | grep -E inotifywait)" ] else if [ -d "/home/virtual" ] && [ -d "/usr/lib/opcenter" ]; then # ensim - $inspath/maldet -b -r /home/virtual/?/fst/var/www/html/,/home/virtual/?/fst/home/?/public_html/ $scan_days >> /dev/null 2>&1 + $inspath/maldet -b -r /home/virtual/?/fst/var/www/html/,/home/virtual/?/fst/home/?/public_html/ $scan_days >> /dev/null 2>&1 elif [ -d "/etc/psa" ] && [ -d "/var/lib/psa" ]; then # psa $inspath/maldet -b -r /var/www/vhosts/?/ $scan_days >> /dev/null 2>&1 - elif [ -d "/usr/local/directadmin" ]; then - # DirectAdmin - $inspath/maldet -b -r /home?/?/domains/?/public_html/,/var/www/html/?/ $scan_days >> /dev/null 2>&1 + elif [ -d "/usr/local/directadmin" ]; then + # DirectAdmin + $inspath/maldet -b -r /home?/?/domains/?/public_html/,/var/www/html/?/ $scan_days >> /dev/null 2>&1 elif [ -d "/var/www/clients" ]; then # ISPConfig - $inspath/maldet -b -r /var/www/clients/?/web?/web,/var/www/clients/?/web?/subdomains,/var/www $scan_days >> /dev/null 2>&1 + $inspath/maldet -b -r /var/www/clients/?/web?/web,/var/www/clients/?/web?/subdomains,/var/www $scan_days >> /dev/null 2>&1 elif [ -d "/etc/webmin/virtual-server" ]; then # Virtualmin - $inspath/maldet -b -r /home/?/public_html/,/home/?/domains/?/public_html/ $scan_days >> /dev/null 2>&1 + $inspath/maldet -b -r /home/?/public_html/,/home/?/domains/?/public_html/ $scan_days >> /dev/null 2>&1 elif [ -d "/usr/local/ispmgr" ]; then # ISPmanager $inspath/maldet -b -r /var/www/?/data/,/home/?/data/ $scan_days >> /dev/null 2>&1 elif [ -d "/var/customers/webs" ]; then # froxlor $inspath/maldet -b -r /var/customers/webs/ $scan_days >> /dev/null 2>&1 - elif [ -d "/usr/local/vesta" ]; then - # VestaCP - $inspath/maldet -b -r /home/?/web/?/public_html/,/home/?/web/?/public_shtml/,/home/?/tmp/,/home/?/web/?/private/ $scan_days >> /dev/null 2>&1 - elif [ -d "/usr/share/dtc" ]; then - # DTC - if [ -f /var/lib/dtc/saved_install_config ]; then - . /var/lib/dtc/saved_install_config - fi - $inspath/maldet -b -r ${conf_hosting_path:-/var/www/sites}/?/?/subdomains/?/html/ $scan_days >> /dev/null 2>&1 + elif [ -d "/usr/local/vesta" ]; then + # VestaCP + $inspath/maldet -b -r /home/?/web/?/public_html/,/home/?/web/?/public_shtml/,/home/?/tmp/,/home/?/web/?/private/ $scan_days >> /dev/null 2>&1 + elif [ -d "/usr/share/dtc" ]; then + # DTC + if [ -f /var/lib/dtc/saved_install_config ]; then + . /var/lib/dtc/saved_install_config + fi + $inspath/maldet -b -r ${conf_hosting_path:-/var/www/sites}/?/?/subdomains/?/html/ $scan_days >> /dev/null 2>&1 + elif [ -d "/var/cpanel" ];then + # cpanel + $inspath/maldet -b -r /home?/?/public_html/,$(cat /etc/userdatadomains|awk -F '==' '{print $5}'|grep -v 'public_html')/var/www/html/,/usr/local/apache/htdocs/ $scan_days >> /dev/null 2>&1 else # cpanel, interworx and other standard home/user/public_html setups - $inspath/maldet -b -r /home?/?/public_html/,/var/www/html/,/usr/local/apache/htdocs/ $scan_days >> /dev/null 2>&1 + $inspath/maldet -b -r /home?/?/public_html/,/var/www/html/,/usr/local/apache/htdocs/ $scan_days >> /dev/null 2>&1 fi fi