#!/bin/bash # Script "ClamAV Temps Réel", par HacKurx # http://hackurx.wordpress.com # Licence: GPL v3 # Dépendance: clamav-daemon inotify-tools # Recommandé pour PC de bureau: libnotify-bin DOSSIER=/home QUARANTAINE=/tmp LOG=$HOME/.clamav-tr.log inotifywait -q -m -r -e create,modify,access "$DOSSIER" --format '%w%f|%e' | sed --unbuffered 's/|.*//g' | while read FICHIER; do clamdscan --quiet --no-summary -i -m "$FICHIER" --move=$QUARANTAINE if [ "$?" == "1" ]; then echo "`date` - Malware trouvé dans le fichier '$FICHIER'. Le fichier a été déplacé dans $QUARANTAINE.">> $LOG echo -e "33[31mMalware trouvé!!!33[00m" "Le fichier '$FICHIER' a été déplacé en quarantaine." if [ -f /usr/bin/notify-send ]; then notify-send -u critical "ClamAV Temps Réel" "Malware trouvé!!! Le fichier '$FICHIER' a été déplacé en quarantaine." fi fi done