前言:
ClamAV是Linux平台上领先的开源病毒扫描程序,如果你要为Linux桌面或服务器找到一个好的病毒扫描程序,这个应用程序应该是你的首选。它在命令行中运行,可以在Linux服务器和台式机上使用,并且可以很好地消除大量不同类型的恶意软件,包括恶意软件,电子邮件服务器漏洞,病毒,甚至是Windows漏洞利用程序。
值得注意的问题有:
ClamAV是一个以命令行为中心的应用程序,它占用内存和CPU并不高。
ClamAV可以检测各种不同的病毒,包括恶意软件,电子邮件服务器漏洞,病毒甚至Windows漏洞。
该软件适用于服务器和Linux桌面。
ClamAV的电子邮件病毒扫描功能支持各种文件类型,包括流行的存档格式,可执行文件,MS Office文档,HTML文件,PDF等。
ClamAV的病毒定义数据库每4小时更新一次,确保你始终拥有最新的漏洞利用信息。
一、安装:
更新epel仓库源,yum下载clamav
yum -y install epel-release
yum install –y clamav clamav-update
二、病毒库更新:
更新病毒库(定期执行,将病毒库更新至最新)
[root@localhost ~]# freshclam
ClamAV update process started at Tue Mar 10 11:49:11 2020
WARNING: Your ClamAV installation is OUTDATED!
WARNING: Local version: 0.101.5 Recommended version: 0.102.2
DON'T PANIC! Read https://www.clamav.net/documents/upgrading-clamav
nonblock_recv: recv timing out (30 secs)
WARNING: getfile: Download interrupted: Operation now in progress (IP: 104.16.218.84)
WARNING: Can't download main.cvd from database.clamav.net
Trying again in 5 secs...
WARNING: Your ClamAV installation is OUTDATED!
WARNING: Local version: 0.101.5 Recommended version: 0.102.2
DON'T PANIC! Read https://www.clamav.net/documents/upgrading-clamav
Downloading main.cvd [100%]
main.cvd updated (version: 59, sigs: 4564902, f-level: 60, builder: sigmgr)
Downloading daily.cvd [100%]
daily.cvd updated (version: 25746, sigs: 2212842, f-level: 63, builder: raynman)
Downloading bytecode.cvd [100%]
bytecode.cvd updated (version: 331, sigs: 94, f-level: 63, builder: anvilleg)
Database updated (6777838 signatures) from database.clamav.net (IP: 104.16.218.84)
[root@localhost ~]#
三、使用说明:
扫描病毒
[root@localhost ~]# clamscan –ri / -l clamscan.log --remove
–ri: No such file or directory
WARNING: –ri: Can't access file
/bin: Symbolic link
/sbin: Symbolic link
/lib: Symbolic link
/lib64: Symbolic link
----------- SCAN SUMMARY -----------
Known viruses: 6767433
Engine version: 0.101.5
Scanned directories: 1
Scanned files: 0
Infected files: 0 //被感染的文件数
Data scanned: 0.00 MB
Data read: 0.00 MB (ratio 0.00:1)
Time: 17.038 sec (0 m 17 s)
[root@localhost ~]# ls
anaconda-ks.cfg clamscan.log
[root@localhost ~]# vi clamscan.log
[root@localhost ~]#
会打印出扫描结果,并记录到clamscan.log中
----------- SCAN SUMMARY ----------- Known viruses: 8153447 Engine version: 0.102.3 Scanned directories: 1 Scanned files: 1 Infected files: 0 #被感染的文件数量 Data scanned: 0.00 MB Data read: 0.00 MB (ratio 0.00:1) Time: 22.294 sec (0 m 22 s)
额外的帮助:
使用帮助如下:
clamscan –ri / -l clamscan.log –remove 这里递归扫描根目录 / ,发现感染文件立即删除
-r 递归扫面子文件
–i 只显示被感染的文件
-l 指定日志文件
–remove 删除被感染文件
–move隔离被感染文件
Comodo Antivirus
附:
批量分发安装clamav:
ansible server -m copy -a "src=/home/ansible/test.tar.gz dest=/home/ansible/test.tar.gz mode=664" -i testhost
ansible server -m shell -a "cd /home/ansible && tar -zxvf test.tar.gz && chmod +x test.sh && ./test.sh" -i testhost
ansible server -m shell -a "sudo nohup clamscan -r / -l /home/ansible/scan.log &" -i testhost
ansible server -m shell -a "sudo tail -n 10 /home/ansible/scan.log" -i testhost
[server]
192.168.0.172
192.168.0.173
192.168.0.174
192.168.0.175
192.168.0.176
192.168.0.177
192.168.0.178
192.168.0.179
192.168.0.180
[server:vars]
ansible_ssh_user=ansible
ansible_ssh_port=22
最新评论