Skip to content

Instantly share code, notes, and snippets.

@altmas5
Created October 21, 2012 23:02
Show Gist options
  • Save altmas5/3928850 to your computer and use it in GitHub Desktop.
Save altmas5/3928850 to your computer and use it in GitHub Desktop.
Ejecución de ClamAV en busca de shells, backdoors y otras MALAS hierbas
#!/bin/bash
resultado="/home/altmas5/scan.txt"
clamscan -r /www/ | grep FOUND > $resultado;
sed -i '/LibClamAV/ d' $resultado;
#guardando size del archivo para evitar correos vacios
TAM=$(stat --printf="%s" $resultado);
if [ "$TAM" != "0" ] #importante el espacio entre if-[-"-"-!=-"-"]
then
echo $resultado | /usr/bin/mail -s "Resultado de antivirus clamAV en servidor web" vos@tudominio.com
else
echo no hay shells;
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment