ClamAV update process started at Mon May 5 14:29:28 2014
main.cvd is up to date (version: 55, sigs: 2424225, f-level: 60, builder: neo)
WARNING: getfile: daily-18354.cdiff not found on remote server (IP: 211.10.155.48)
WARNING: getpatch: Can't download daily-18354.cdiff from db.jp.clamav.net
Trying host db.jp.clamav.net (203.212.42.128)...
WARNING: getfile: daily-18354.cdiff not found on remote server (IP: 203.212.42.128)
WARNING: getpatch: Can't download daily-18354.cdiff from db.jp.clamav.net
Trying host db.jp.clamav.net (219.94.128.99)...
WARNING: getfile: daily-18354.cdiff not found on remote server (IP: 219.94.128.99)
WARNING: getpatch: Can't download daily-18354.cdiff from db.jp.clamav.net
WARNING: Incremental update failed, trying to download daily.cvd
Downloading daily.cvd [100%]
daily.cvd updated (version: 18924, sigs: 929974, f-level: 63, builder: neo)
Downloading bytecode.cvd [100%]
bytecode.cvd updated (version: 236, sigs: 43, f-level: 63, builder: dgoddard)
Database updated (3354242 signatures) from db.jp.clamav.net (IP: 120.29.176.126)
/root/eicarcom2.zip: Eicar-Test-Signature FOUND ← ウィルス検知
/root/eicarcom2.zip: Removed ← ウィルス削除
/root/eicar.com.txt: Eicar-Test-Signature FOUND ← ウィルス検知
/root/eicar.com.txt: Removed ← ウィルス削除
/root/eicar_com.zip: Eicar-Test-Signature FOUND ← ウィルス検知
/root/eicar_com.zip: Removed ← ウィルス削除
/root/eicar.com: Eicar-Test-Signature FOUND ← ウィルス検知
/root/eicar.com: Removed ← ウィルス削除
以下省略
#!/bin/bash
PATH=/usr/bin:/bin
# clamd update yum -y update clamd > /dev/null 2>&1
# excludeopt setup
excludelist=/root/clamscan.exclude
if [ -s $excludelist ]; then
for i in `cat $excludelist`
do
if [ $(echo "$i"|grep \/$) ]; then
i=`echo $i|sed -e 's/^\([^ ]*\)\/$/\1/p' -e d`
excludeopt="${excludeopt} --exclude-dir=^$i"
else
excludeopt="${excludeopt} --exclude=^$i"
fi
done
fi
# virus scan
CLAMSCANTMP=`mktemp`
clamscan --recursive --remove ${excludeopt} / > $CLAMSCANTMP 2>&1
[ ! -z "$(grep FOUND$ $CLAMSCANTMP)" ] && \
# report mail send
grep FOUND$ $CLAMSCANTMP | mail -s "Virus Found in `hostname`" root
rm -f $CLAMSCANTMP