使Qmail体系支持RAR3.X压缩包病毒扫描
发表于:2007-07-04来源:作者:点击数:
标签:
#作者:Nanu #首发:China Unix #如需转载请注明作者,谢谢! 4月29日发布的Clamav0.48在其官方的ReleaseNote中已经声明支持RAR3编码的压缩包扫描。 一、升级Clamav =========== [color=red:ec81c4b618]注意:本升级过程仅适用于qmail+qmailscanner+clamav体
# 作者:Nanu
# 首发:China
Unix# 如需转载请注明作者,谢谢!
4月29日发布的Clamav0.48在其官方的Release Note中已经声明支持RAR3编码的压缩包扫描。
一、升级Clamav
===========
[color=red:ec81c4b618]注意:本升级过程仅适用于qmail + qmailscanner + clamav体系,并且仅适用于最初以源码包方式安装的Clamav。本文未涉及的操作最好不要做,否则可能会引起升级后Clamav不能正常工作。对于升级过程中的一些路径(例如:日志路径、病毒
数据库路径等,请按照您的具体系统环境进行修改)[/color:ec81c4b618]
1、停止Clamav
------------------
[quote:ec81c4b618]# killall clamd
# killall freshclam[/quote:ec81c4b618]
2、卸载旧版Clamav
-----------------------
[quote:ec81c4b618]# rm -f /usr/local/lib/*clam*
# mv /usr/local/etc/freshclam.conf /usr/local/etc/freshclam.conf.bak
# mv /usr/local/etc/clamd.conf /usr/local/etc/clamd.conf.bak[/quote:ec81c4b618]
3、下载Clamav0.84源码包
-------------------------------
[quote:ec81c4b618]# wget
http://switch.dl.sourceforge.net/sourceforge/clamav/clamav-0.84.tar.gz[/quote:ec81c4b618]4、安装Clamav0.84
------------------------
[quote:ec81c4b618]# tar xzvf clamav-0.84.tar.gz
# cd clamav-0.84
# ./configure
# make check
# make install[/quote:ec81c4b618]
二、配置Clamav0.84
==============
[quote:ec81c4b618]# vi /usr/local/etc/freshclam.conf[/quote:ec81c4b618]
[code:1:ec81c4b618]#Example (前面加上#)
UpdateLogFile /var/log/freshclam.log (去掉前面的#)
LogSyslog (去掉前面的#)[/code:1:ec81c4b618]
[quote:ec81c4b618]# vi /usr/local/etc/clamd.conf[/quote:ec81c4b618]
[code:1:ec81c4b618]#Example (前面加上#)
LogFile /var/log/clamav/clamd.log (去掉前面的#)
LogFileMaxSize 2M (去掉前面的#)
LogTime (去掉前面的#)
PidFile /var/run/clamd.pid (去掉前面的#)
DataDirectory /var/lib/clamav (去掉前面的#,并且修改路径为/usr/local/share/clamav)
LogSyslog (去掉前面的#)
ScanMail (去掉前面的#)
ScanArchive (去掉前面的#)
ScanRAR (去掉前面的#)[/code:1:ec81c4b618]
三、启动 & 测试
==========
1、启动Clamav0.84
------------------------
[quote:ec81c4b618]# /usr/local/sbin/clamd
# /usr/local/bin/freshclam -d -c 2 -l /var/log/freshclam.log[/quote:ec81c4b618]
2、测试Clamav0.84
------------------------
首先将一个或多个病毒样本用WinRAR3.XX打包,放到/home/virus.rar
[quote:ec81c4b618]# clamscan --recursive --log=/tmp/clamscan.log /home/virus.rar
# cat /tmp/clamscan.log[/quote:ec81c4b618]
查看是否检查出RAR包里的病毒。
然后,将virus.rar作为邮件的附件发送到您的邮件
服务器中的一个用户。
查看Postmaster是否有病毒报告。
四、附:Clamav启动脚本
======================
[quote:ec81c4b618]# vi /etc/rc.d/init.d/clamav[/quote:ec81c4b618]
[code:1:ec81c4b618]#!/bin/sh
#
# Startup / shutdown script for Clam Antivirus
case "$1" in
start)
/usr/local/sbin/clamd && echo -n 'Clamd started'
/usr/local/bin/freshclam -d -c 2 -l /var/log/freshclam.log
echo -n ' freshclam started'
;;
stop)
/usr/bin/killall clamd > /dev/null 2>&1 && echo -n 'Clamd stoped'
/usr/bin/killall freshclam > /dev/null 2>&1 && echo -n ' freshclam Stoped'
;;
*)
echo ""
echo "Usage: `basename $0` { start | stop }"
echo ""
exit 64
;;
esac[/code:1:ec81c4b618]
[quote:ec81c4b618]# chmod 755 /etc/rc.d/init.d/clamav[/quote:ec81c4b618]
如需开机起动,则加入到/etc/rc.d/rc.local中:
[quote:ec81c4b618]# echo /etc/rc.d/init.d/clamav start >> /etc/rc.d/rc.local[/quote:ec81c4b618]
KindGeorge 回复于:2005-05-07 18:15:42 |
好,收藏了,谢谢分享.
|
孙轩 回复于:2005-05-17 13:08:00 |
实际上是需要加--unrar才行,而且只能clamscan 不能clamdscan
|
红雨 回复于:2005-07-29 22:03:38 |
偶照此升级到0.86.2后,出现这样的现象:
# cat freshclam.log ERROR: Can't save PID to file /var/run/freshclam.pid: Permission denied freshclam daemon 0.86.2 (OS: linux-gnu, ARCH: i386, CPU: i686) ClamAV update process started at Fri Jul 29 17:17:11 2005 main.cvd is up to date (version: 33, sigs: 36102, f-level: 5, builder: tkojm) daily.cvd is up to date (version: 997, sigs: 1055, f-level: 5, builder: arnaud)
# cat clamav/clamd.log Fri Jul 29 17:13:36 2005 -> ERROR: Can't unlink the pid file /var/run/clamd.pid Fri Jul 29 17:17:10 2005 -> ERROR: Can't save PID in file /var/run/clamd.pid
如何解决,敬请赐教!
|
platinum 回复于:2005-07-29 23:01:19 |
ERROR: Can't save PID to file /var/run/freshclam.pid: [color=red:95acb172a7][b:95acb172a7]Permission denied[/color:95acb172a7] [/b:95acb172a7] 检查你的权限
|
红雨 回复于:2005-07-30 00:13:54 |
# dir /var/ -l drwxr-xr-x 10 root root 4096 7-29 23:07 run
究竟要什么样的权限呢?
|
我菜我怕谁 回复于:2005-07-30 08:40:16 |
777看看,哈哈
|
红雨 回复于:2005-07-30 08:54:10 |
[quote:fcb1147b85="我菜我怕谁"]777看看,哈哈[/quote:fcb1147b85] 不明白?
具体怎么操作,能说详细点么?
|
platinum 回复于:2005-07-30 09:30:53 |
# chmod 777 目录 or # chown xxx.xxx 目录
man chmod man chown
|
红雨 回复于:2005-07-30 10:12:07 |
搞定!
|
原文转自:http://www.ltesting.net