环境搭建可以参考clamav doc
首先下载安装包,链接 下载链接
可以是压缩包或者msi 文件
我使用的是msi,这个比较简单,直接默认安装。
接下来就是环境配置
参考clamav的配置文档:配置文档
找到对应的Windows的相关配置
进入安装好的路径(例如 C:\Program Files\ClamAV)
输入cmd,执行下面两条命令:
copy .\conf_examples\freshclam.conf.sample .\freshclam.conf
copy .\conf_examples\clamd.conf.sample .\clamd.conf
将提供的例子配置文件拷贝到当前目录。
然后执行:
write.exe .\freshclam.conf
这个会打开写字板,Windows系统默认自带的工具。将里面的Example这一行注释掉或删除。
然后执行:
write.exe .\clamd.conf
也是将里面的Example这一行注释掉或删除。
最后就是注册表,和相关目录的创建。
Config files path search order:
The content of the registry key: "HKEY_LOCAL_MACHINE/Software/ClamAV/ConfDir"
The directory where libclamav.dll is located: "C:\Program Files\ClamAV"
"C:\ClamAV"
Database files path search order:
The content of the registry key: "HKEY_LOCAL_MACHINE/Software/ClamAV/DataDir"
The directory "database" inside the directory where libclamav.dll is located: "C:\Program Files\ClamAV\database"
"C:\ClamAV\db"
然后配置环境变量path:
%SystemRoot%\system32;%SystemRoot%;C:\Program Files\ClamAV
增加clamav的执行目录,这样就能在任意的cmd命令行执行clamav的程序。
接着执行freshclam.exe,它会下载最新的病毒库,创建database并下载病毒库到其中。
接着执行clamd.exe,启动没问题后,就可以执行扫描程序clamscan.exe进行扫描
例如