diff --git a/clamav-weekly.sh b/clamav-weekly.sh index 2208f3ea1643d5866b948be5ff8c6f9483ddfe19..7f812acbc5a65fd460d614da163d6cf8c8cea55a 100755 --- a/clamav-weekly.sh +++ b/clamav-weekly.sh @@ -17,7 +17,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. -LOGFILE="/tmp/clamav-$(date +'%Y-%m-%d').log"; +LOGFILE="/var/log/clamav.log"; EMAIL_TO="root"; DIRTOSCAN="/var/www /home"; @@ -31,9 +31,10 @@ do_sendmail(){ echo "To: $EMAIL_TO"; echo "Content-Type: text/plain; charset=UTF-8"; echo ""; - echo -e "${message}") | sendmail -t + echo -e "${message}") | sendmail -t $EMAIL_TO } +echo "" > $LOGFILE for S in ${DIRTOSCAN}; do DIRSIZE=$(du -sh "$S" 2>/dev/null | cut -f1); @@ -52,10 +53,5 @@ then message="Une menace a été detecté sur votre serveur.\n Merci de vous référer au log ci dessous et si besoin de contacter vos administrateur.rice système." -else - subject="Aucune menace detectée" - message="Aucune menace detectée durant l'analyse hebdomadaire de votre serveur." + do_sendmail fi - -do_sendmail -rm $LOGFILE diff --git a/installBase.sh b/installBase.sh index 65692fa42877af3b3e7f5cebe7a918a392774390..bcb7cab74ef205093d4ff7b1152bb3915cd4bd0e 100644 --- a/installBase.sh +++ b/installBase.sh @@ -69,6 +69,7 @@ DEBIAN_FRONTEND='noninteractive' apt-get -qq install \ php-mcrypt \ php-mysql \ postfix \ + rkhunter \ openssh-server \ tar \ tmux \ diff --git a/upgradeAll.sh b/upgradeAll.sh index 63eab3cf2051c09689ac0bb5a89894bccffc0939..970571462d00452811b5ae9baa0ecec4c4b2b1be 100644 --- a/upgradeAll.sh +++ b/upgradeAll.sh @@ -44,6 +44,12 @@ if [ -f "$customfile" ] then /bin/bash $customfile fi +if [ -z "`which rkhunter`" ] +then + aptitude install rkhunter +fi +rkhunter --sk -c +less /var/log/clamav.log services="`checkrestart | awk '/^service/{print $2} /^systemctl/{print $3}'` \ $EXTRAS_SERVICES_TO_RESTART" [ ! -z "$services" ] && systemctl restart $services