ClamAV:Linux服务器杀毒扫描工具

news2024/10/5 19:12:19

        Clam AntiVirus(ClamAV)是免费而且开放源代码的防毒软件,软件与病毒码的更新皆由社群免费发布。ClamAV在命令行下运行,它不将杀毒作为主要功能,默认只能查出系统内的病毒,但是无法清除。需要用户自行对病毒文件进行处理。

在线安装

# ubuntu
sudo apt install clamav clamav-daemon -y

# centos
sudo yum install clamav clamav-update -y

离线安装

1、官网下载对应的软件包
ClamAVNeticon-default.png?t=N7T8https://www.clamav.net/downloads 

2、将下载的软件包上传到服务器后使用rpm/dpkg命令进行安装,软件包里面已经将相关依赖这些打包好了,直接安装就行。 

rpm -ivh --prefix=/usr/local/clamav clamav-1.3.0.linux.x86_64.rpm

dpkg -i  --instdir=/usr/local/clamav clamav-1.3.0.linux.x86_64.deb

 

手动更新病毒库
病毒库位置:/var/lib/clamav/*
1、暂时停止服务:sudo systemctl stop clamav-freshclam
2、运行freshclam:sudo freshclam 或者直接: /usr/bin/freshclam
3、重新启动服务:sudo systemctl start clamav-freshclam

注:

复制/usr/local/etc/freshclam.conf并注释掉:

#Example

使用说明:

1、clamscan用法

    clamscan [options] [file/directory/-]

    --help                -h             Show this help
    --version             -V             Print version number
    --verbose             -v             Be verbose
    --archive-verbose     -a             Show filenames inside scanned archives
    --debug                              Enable libclamav's debug messages
    --quiet                              Only output error messages
    --stdout                             Write to stdout instead of stderr. Does not affect 'debug' messages.
    --no-summary                         Disable summary at end of scanning
    --infected            -i             Only print infected files
    --suppress-ok-results -o             Skip printing OK files
    --bell                               Sound bell on virus detection

    --tempdir=DIRECTORY                  Create temporary files in DIRECTORY
    --leave-temps[=yes/no(*)]            Do not remove temporary files
    --gen-json[=yes/no(*)]               Generate JSON metadata for the scanned file(s). For testing & development use ONLY.
                                         JSON will be printed if --debug is enabled.
                                         A JSON file will dropped to the temp directory if --leave-temps is enabled.
    --database=FILE/DIR   -d FILE/DIR    Load virus database from FILE or load all supported db files from DIR
    --official-db-only[=yes/no(*)]       Only load official signatures
    --fail-if-cvd-older-than=days        Return with a nonzero error code if virus database outdated.
    --log=FILE            -l FILE        Save scan report to FILE
    --recursive[=yes/no(*)]  -r          Scan subdirectories recursively
    --allmatch[=yes/no(*)]   -z          Continue scanning within file after finding a match
    --cross-fs[=yes(*)/no]               Scan files and directories on other filesystems
    --follow-dir-symlinks[=0/1(*)/2]     Follow directory symlinks (0 = never, 1 = direct, 2 = always)
    --follow-file-symlinks[=0/1(*)/2]    Follow file symlinks (0 = never, 1 = direct, 2 = always)
    --file-list=FILE      -f FILE        Scan files from FILE
    --remove[=yes/no(*)]                 Remove infected files. Be careful!
    --move=DIRECTORY                     Move infected files into DIRECTORY
    --copy=DIRECTORY                     Copy infected files into DIRECTORY
    --exclude=REGEX                      Don't scan file names matching REGEX
    --exclude-dir=REGEX                  Don't scan directories matching REGEX
    --include=REGEX                      Only scan file names matching REGEX
    --include-dir=REGEX                  Only scan directories matching REGEX

    --bytecode[=yes(*)/no]               Load bytecode from the database
    --bytecode-unsigned[=yes/no(*)]      Load unsigned bytecode
                                         **Caution**: You should NEVER run bytecode signatures from untrusted sources.
                                         Doing so may result in arbitrary code execution.
    --bytecode-timeout=N                 Set bytecode timeout (in milliseconds)
    --statistics[=none(*)/bytecode/pcre] Collect and print execution statistics
    --detect-pua[=yes/no(*)]             Detect Possibly Unwanted Applications
    --exclude-pua=CAT                    Skip PUA sigs of category CAT
    --include-pua=CAT                    Load PUA sigs of category CAT
    --detect-structured[=yes/no(*)]      Detect structured data (SSN, Credit Card)
    --structured-ssn-format=X            SSN format (0=normal,1=stripped,2=both)
    --structured-ssn-count=N             Min SSN count to generate a detect
    --structured-cc-count=N              Min CC count to generate a detect
    --structured-cc-mode=X               CC mode (0=credit debit and private label, 1=credit cards only
    --scan-mail[=yes(*)/no]              Scan mail files
    --phishing-sigs[=yes(*)/no]          Enable email signature-based phishing detection
    --phishing-scan-urls[=yes(*)/no]     Enable URL signature-based phishing detection
    --heuristic-alerts[=yes(*)/no]       Heuristic alerts
    --heuristic-scan-precedence[=yes/no(*)] Stop scanning as soon as a heuristic match is found
    --normalize[=yes(*)/no]              Normalize html, script, and text files. Use normalize=no for yara compatibility
    --scan-pe[=yes(*)/no]                Scan PE files
    --scan-elf[=yes(*)/no]               Scan ELF files
    --scan-ole2[=yes(*)/no]              Scan OLE2 containers
    --scan-pdf[=yes(*)/no]               Scan PDF files
    --scan-swf[=yes(*)/no]               Scan SWF files
    --scan-html[=yes(*)/no]              Scan HTML files
    --scan-xmldocs[=yes(*)/no]           Scan xml-based document files
    --scan-hwp3[=yes(*)/no]              Scan HWP3 files
    --scan-onenote[=yes(*)/no]           Scan OneNote files
    --scan-archive[=yes(*)/no]           Scan archive files (supported by libclamav)
    --alert-broken[=yes/no(*)]           Alert on broken executable files (PE & ELF)
    --alert-broken-media[=yes/no(*)]     Alert on broken graphics files (JPEG, TIFF, PNG, GIF)
    --alert-encrypted[=yes/no(*)]        Alert on encrypted archives and documents
    --alert-encrypted-archive[=yes/no(*)] Alert on encrypted archives
    --alert-encrypted-doc[=yes/no(*)]    Alert on encrypted documents
    --alert-macros[=yes/no(*)]           Alert on OLE2 files containing VBA macros
    --alert-exceeds-max[=yes/no(*)]      Alert on files that exceed max file size, max scan size, or max recursion limit
    --alert-phishing-ssl[=yes/no(*)]     Alert on emails containing SSL mismatches in URLs
    --alert-phishing-cloak[=yes/no(*)]   Alert on emails containing cloaked URLs
    --alert-partition-intersection[=yes/no(*)] Alert on raw DMG image files containing partition intersections
    --nocerts                            Disable authenticode certificate chain verification in PE files
    --dumpcerts                          Dump authenticode certificate chain in PE files

    --max-scantime=#n                    Scan time longer than this will be skipped and assumed clean (milliseconds)
    --max-filesize=#n                    Files larger than this will be skipped and assumed clean
    --max-scansize=#n                    The maximum amount of data to scan for each container file (**)
    --max-files=#n                       The maximum number of files to scan for each container file (**)
    --max-recursion=#n                   Maximum archive recursion level for container file (**)
    --max-dir-recursion=#n               Maximum directory recursion level
    --max-embeddedpe=#n                  Maximum size file to check for embedded PE
    --max-htmlnormalize=#n               Maximum size of HTML file to normalize
    --max-htmlnotags=#n                  Maximum size of normalized HTML file to scan
    --max-scriptnormalize=#n             Maximum size of script file to normalize
    --max-ziptypercg=#n                  Maximum size zip to type reanalyze
    --max-partitions=#n                  Maximum number of partitions in disk image to be scanned
    --max-iconspe=#n                     Maximum number of icons in PE file to be scanned
    --max-rechwp3=#n                     Maximum recursive calls to HWP3 parsing function
    --pcre-match-limit=#n                Maximum calls to the PCRE match function.
    --pcre-recmatch-limit=#n             Maximum recursive calls to the PCRE match function.
    --pcre-max-filesize=#n               Maximum size file to perform PCRE subsig matching.
    --disable-cache                      Disable caching and cache checks for hash sums of scanned files.
--基本扫描
##扫描文件 
[root@localhost ~]# clamscan targetfile  

##递归扫描home目录,并且记录日志 
[root@localhost ~]# clamscan -r -i /home  -l /var/log/clamav.log  

##递归扫描home目录,将病毒文件删除,并且记录日志 
[root@localhost ~]# clamscan -r -i /home  --remove  -l /var/log/clamav.log  

##扫描指定目录,然后将感染文件移动到指定目录,并记录日志 

-----重点扫描目录
[root@localhost ~]# clamscan -r -i /home  --move=/tmp/clamav -l /var/log/clamav.log

clamscan -r  -i /etc --max-dir-recursion=5 -l /var/log/clamav-etc.log

clamscan -r  -i /bin --max-dir-recursion=5 -l /var/log/clamav-bin.log

clamscan -r  -i /usr --max-dir-recursion=5 -l /var/log/clamav-usr.log

clamscan -r  -i /var --max-dir-recursion=5 -l /var/log/clamav-var.log

重点扫描报告

---------- SCAN SUMMARY -----------
Known viruses: 9141451                  #已知病毒
Engine version: 0.102.4                 #软件版本
Scanned directories: 498                #扫描目录
Scanned files: 738                      #扫描文件
Infected files: 4                       #感染文件!!!
Data scanned: 530.25 MB                 #扫描数据
Data read: 14131.60 MB (ratio 0.04:1)   #数据读取
Time: 203.805 sec (3 m 23 s)            #扫描用时


 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1561456.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

AcWing刷题-游戏

游戏 DP l lambda: [int(x) for x in input().split()]n l()[0] w [0] while len(w) < n:w l()s [0] * (n 1) for i in range(1, n 1): s[i] s[i - 1] w[i]f [[0] * (n 1) for _ in range(n 1)]for i in range(1, n 1): f[i][i] w[i]for length in range(2, …

记Kubernetes(k8s)初始化报错:“Error getting node“ err=“node \“k8s-master\“ not found“

记Kubernetes&#xff08;k8s&#xff09;初始化报错&#xff1a;"Error getting node" err"node \"k8s-master\" not found" 1、报错详情2、问题排查3、尝试问题解决 &#x1f496;The Begin&#x1f496;点点关注&#xff0c;收藏不迷路&#…

2003-2022年分国家、分行业、各省对外直接投资流量/存量/OFDI流量/OFDI存量(三份数据合集)

2003-2022年分国家、分行业、各省对外直接投资流量/存量/OFDI流量/OFDI存量 1、时间&#xff1a;更新至2022年&#xff0c;具体时间如下&#xff1a; 2003-2022年各省对外直接投资存量、省对外直接投资流量、省OFDI流量、省OFDI存量数据 2003-2022年中国对外直接投资流量、O…

halcon图像膨胀

1、原理&#xff1a; 使用结构元素在图像上移动&#xff0c;如果结构元素中有任意一个像素和图像上的非零像素重叠&#xff0c;则保留此时结构元素中心所在位置&#xff0c;并将其像素值设置为非零。 2、halcon代码 其中圆形结构元素可设置半径&#xff0c;矩形结构元素设置…

书生·浦语大模型第二期实战营(2)笔记作业

大模型部署 链接: 文档 链接: internstudio 1.部署 InternLM2-Chat-1.8B 模型进行智能对话 2.部署实战营优秀作品 八戒-Chat-1.8B 模型 3.通过 InternLM2-Chat-7B 运行 Lagent 智能体 Demo 4.实践部署 浦语灵笔2 模型 5.熟悉 huggingface 下载功能 from huggingface_hub im…

微信小程序使用textarea默认字数限制以及高度自适应和默认高度设置

<textarea model:value"{{text}}" auto-height placeholder"请输入内容" maxlength"-1" /> auto-height 设置自适应高度 设置之后高度设置无效 maxlength"-1" 解决默认最大字数限制 css // 文本域 textarea { border:…

【软考】系统集成项目管理工程师(二十二)法律法规【2分】

一、合同法 1、内容 当事人的名称或者姓名和住所、标的、数量、质量、价款或者报酬&#xff1b;履行期限、地点和方式&#xff1b;违约责任和解决争议的方法 练一练 【例1-高16下】格式条款是当事人为了重复使用而预先拟定&#xff0c;并在订立合同时未与对方协商的…

Python入门(八)

引入 引入函数 为了减少代码的冗余&#xff0c;减轻我们的工作量&#xff0c;我们常常将代码分块编写&#xff0c;在Python中更是如此&#xff0c;那么我们怎么在一个新的程序文件中调用我们已经编写好程序文件的函数&#xff0c;我们使用import。我们先写一个first.py为例语…

5G PLMN相关概念

PLMN PLMN&#xff08;Public Land Mobile Network&#xff0c;公用陆地移动网络&#xff09;&#xff0c;是由政府或其批准的经营者为公众提供陆地移动通信业务而建立、经营的网络。PLMN与公众交换电话网&#xff08;PSTN&#xff09;互连&#xff0c;形成整个地区或国家规模…

Verilog基础【二】

3.1 Verilog 连续赋值 关键词&#xff1a;assign&#xff0c; 全加器 连续赋值语句是 Verilog 数据流建模的基本语句&#xff0c;用于对 wire 型变量进行赋值。&#xff1a; assign LHS_target RHS_expression &#xff1b;LHS&#xff08;left hand side&#xff09;…

java中:print与println的区别

目录 区别 区别 print是直接打印输出 println是输出后自动回车到下一行 例如 public class test {public static void main(String[] args){System.out.println("换行");System.out.print("不换行");System.out.println();}}——————————————…

STL容器的一些操作(常用的,不全)

目录 string 1.string的一些创建 2.string 的读入和输出&#xff1a; 3.string的一些操作 4.彻底清空string 容器的函数 vector 1.vector的一些创建&#xff1a; 2.vector的一些操作&#xff1a; 3.vector的彻底清空并释放内存&#xff1a; queue 循环队列&#xff1…

Mysql数据备份与恢复实战

文章目录 备份类型备份内容备份工具mysqldump备份 实战案例&#xff1a;恢复误删除的表准备工作2:30完全备份完全备份后更新数据表10:00误删students表需要恢复还原的状态开始还原恢复 为什么要备份&#xff1f; 备份是为了&#xff1a;灾难恢复&#xff1a;硬件故障、软件故障…

维安电子、费斯托中国等20+智能制造企业共探渠道管理数字化

近日&#xff0c;纷享销客新增长100人系列活动之制造业专场&#xff0c;我们有幸邀请维安电子、费斯托工具一起&#xff0c;共同探讨制造业渠道管理的新理念、新增长和新实践。 活动聚集了维安电子、费斯托工具、唐纳森、中科新松、斯可络、江浪科技、上海沪工等等20余位标杆制…

算法学习——LeetCode力扣动态规划篇9(1035. 不相交的线、53. 最大子数组和、392. 判断子序列、115. 不同的子序列)

算法学习——LeetCode力扣动态规划篇9 1035. 不相交的线 1035. 不相交的线 - 力扣&#xff08;LeetCode&#xff09; 描述 在两条独立的水平线上按给定的顺序写下 nums1 和 nums2 中的整数。 现在&#xff0c;可以绘制一些连接两个数字 nums1[i] 和 nums2[j] 的直线&#x…

针对 qt的sqlite加密数据库sqlitecipher插件QtCipherSqlitePlugin

&#x1f482; 个人主页:pp不会算法^ v ^ &#x1f91f; 版权: 本文由【pp不会算法v】原创、在CSDN首发、需要转载请联系博主 &#x1f4ac; 如果文章对你有帮助、欢迎关注、点赞、收藏(一键三连)和订阅专栏哦 文章目录 简介编译安装使用可视化工具查看完结 简介 在客户端存储…

【docker】基础操作命令

docker run:干两步&#xff0c;本地找一下有没有集装箱&#xff0c;有运行&#xff0c;没有远程仓库下载运行。还没有报错。 docker好处&#xff1a; 不需要进行物理层模拟&#xff0c;不需要hypervisor利用的内核是宿主机的内核&#xff0c;不需要重新加载Linux内核 镜像相关…

QT-飞机水平仪图标

QT-飞机水平仪图标 一、演示效果二、关键程序三、下载链接 一、演示效果 二、关键程序 #include <stdio.h> #include <stdlib.h> #include <string.h>#include <QtCore> #include <QtGui> #include <QDebug> #include <QTableWidget&g…

刷题之动态规划-路径问题

前言 大家好&#xff0c;我是jiantaoyab&#xff0c;开始刷动态规划的题目了&#xff0c;要特别注意初始化的时候给什么值。 动态规划5个步骤 状态表示 &#xff1a;dp数组中每一个下标对应值的含义是什么->dp[i]表示什么状态转移方程&#xff1a; dp[i] 等于什么1 和 2 是…

python毕业设计django宠物寄存系统fn62p

本文所设计的宠物寄存中心系统的设计与实现拥有前端和后端&#xff0c;前端使用Vue.js框架和创建&#xff0c;后端使用django框架创建&#xff0c;开发语言采用python&#xff0c;使用Mysql数据库对后台数据进行存储。将pcyahrm作为主要的开发工具。接着进行系统的需求分析、功…