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

        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.rpmdpkg -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.logclamscan -r  -i /etc --max-dir-recursion=5 -l /var/log/clamav-etc.logclamscan -r  -i /bin --max-dir-recursion=5 -l /var/log/clamav-bin.logclamscan -r  -i /usr --max-dir-recursion=5 -l /var/log/clamav-usr.logclamscan -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.mzph.cn/news/785609.shtml

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

相关文章

每周编辑精选|免费使用 Sora 平替、在线运行 Python 基础教程、MCFEND 中国假新闻检测数据集上线

继 ChatGPT 后,OpenAI 又发布了爆炸级产品——Sora 文生视频模型,当其他模型还在努力突破几秒内的连贯性问题时,Sora 已经将视频时长拉到了 60s。不过,目前 Sora 模型仅对小部分研究人员和创意人士开放访问权限。 别担心&#xf…

linux 创建py文件自启动服务

1、新建Python文件 test.py文件内容 print("test service ") 2、新建启动文件 testservice.sh #!/bin/shpython3 test.py 3、新建启动服务 /usr/lib/systemd/system/testservice.service [Unit] Descriptiontestservice Afternetwork.target[Service] ExecSt…

C语言之位段

1.位段的声明 位段的声明和结构是类似的,有两个不同: 1.位段的成员必须是 int、unsigned int 或signed int 。 2.位段的成员名后边有一个冒号和一个数字。 比如: struct A {int _a:2;int _b:5;int _c:10;int _d:30; }; A 就是一个位段类型…

【上海大学计算机组成原理实验报告】二、数据传送实验

一、实验目的 了解在模型机中算术、逻辑运算单元的控制方法。学习机器语言程序的运行过程。通过人工译码,加深对译码器基本工作原理的理解。 二、实验原理 根据实验指导书的相关内容,本次实验所要用的CP226实验仪在手动方式下,运算功能通过…

LeetCode-热题100:160. 相交链表

给你两个单链表的头节点 headA 和 headB ,请你找出并返回两个单链表相交的起始节点。如果两个链表不存在相交节点,返回 null 。 图示两个链表在节点 c1 开始相交: 题目数据 保证 整个链式结构中不存在环。 注意,函数返回结果后&…

centos7 安装 mysql

命令记录,未整理; 1. 下载mysql5.7的安装包,上传到linux系统某个目录中 2. 使用tar -xvf 解压 tar包 tar -xvf mysql-5.7.35-1.el7.x86_64.rpm-bundle.tar 3. 使用 rpm -ivh 安装 mysql rpm -ivh mysql-community-common-5.7.35-1.el7.x8…

数据库学习案例2024-MySQL参数解析总结

MySQL参数log_bin_trust_function_creators介绍 简单介绍一下,当二进制日志启用后,这个变量就会启用。它控制是否可以信任存储函数创建者,不会创建写入二进制日志引起不安全事件的存储函数。如果设置为0(默认值)&#…

python 三层架构思想写代码。

在 Python 中实现数据库操作的三层架构一般包括以下三层: 数据访问层(Data Access Layer):负责与数据库进行交互,执行 SQL 查询和更新操作。 业务逻辑层(Business Logic Layer):处理…

视频号小店在哪里登录?入驻的时候需要什么资质?

我是电商珠珠 视频号小店距离现在发展了不过一年多的时间,作为一个新平台就代表着很多机会、红利。所以有很多商家都看准了,准备往这个平台上发展。作为新手来说,还不知道视频号小店登录注册入口以及入驻的时候需要什么资质,接下…

Go语言学习Day6:数组与切片

名人说:莫愁千里路,自有到来风。 ——钱珝 创作者:Code_流苏(CSDN)(一个喜欢古诗词和编程的Coder😊) 目录 1. 数组① 什么是数组② 数组的声明③ 初始化数组的几种方式④ 遍历数组元素⑤ 数组为值类型⑥ 数…

禁止软件访问外网

WINDOWS平台上,在特殊情况下我们要防止一些软件偷偷访问外网,比如ResEdit.exe一联网就当掉,只要把WINDOWS的防火墙功能打印,将下面脚本保存为rbt_runas_admin_firewall_block_exe_in_dir.cmd ::runas /user:administrator cmd echo 右击以管理员方式运行 cd /d %~dp0 for /r …

pytest教程-21-失败重跑插件-pytest-rerunfailures

领取资料,咨询答疑,请➕wei: June__Go 上一小节我们学习了pytest插件的基本使用方法,本小节我们讲解一下pytest用例失败重跑插件pytest-rerunfailures。 测试环境不稳定偶发接口超时(和服务无关,纯粹是环境问题&…

【C语言】带你完全理解指针(四)函数指针的应用sqort函数的实现

前言: 本文主要是函数指针的重要应用,介绍qsort函数以及模拟实现这样一个不限制使用数据类型的快速排序函数。 回调函数 函数指针有一个非常大的作用就是实现回调函数。非常重要 回调函数就是一个通过函数指针调用的函数。如果你把函数的指针&#xf…

python如何画奥运五环

绘制奥运五环主要涉及到Python中的turtle绘图库运用: 程序源代码为: import turtle turtle.width(10) turtle.color(black) turtle.circle(50) turtle.penup() turtle.goto(120,0) turtle.pendown() turtle.color(red) turtle.circle(50) turtle.penup()…

基于springboot酒店管理平台

摘 要 随着科学技术的飞速发展,各行各业都在努力与现代先进技术接轨,通过科技手段提高自身的优势;对于酒店管理平台系统当然也不能排除在外,随着网络技术的不断成熟,带动了酒店管理平台系统,它彻底改变了过…

深入理解 React 中的 children props 和 render props

深入理解 React 中的 children props 和 render props 在 React 中,children props 和 render props 是两种常见的组件复用模式,它们都可以帮助我们更好地组织和复用组件代码。虽然它们的实现方式有所不同,但都能够有效地实现组件之间的数据…

坚持刷题|分发饼干

文章目录 题目思路代码实现实现总结主要步骤时间复杂度 扩展问题 Hello,大家好,我是阿月。坚持刷题,老年痴呆追不上我,今天刷第一个贪心算法:分发饼干 题目 455.分发饼干 思路 要解决这个问题,可以使用…

世界上有那么多条条框框,就是告诉你不用格格都入

在我们的生活、工作和学习中,总是充斥着各种各样的规则和标准。这些条条框框,有时候像是一座座无形的墙,将我们限制在一个狭小的空间里。然而,如果我们换一个角度来看待这些规则,就会发现它们实际上是在告诉我们&#…

Autodesk Maya 2025 mac玛雅三维动画特效软件

Autodesk Maya 2025 for Mac是一款功能强大、操作简便的三维动画软件,适用于电影、电视、游戏、建筑、工业设计、虚拟现实和动画等领域。无论是专业设计师还是初学者,都可以通过Maya 2025实现自己的创意和想法,创作出高质量的三维作品。 软件…

MySQL数据库优化和MySQL故障

一、MySQL数据库优化 硬件优化 CPU:推荐使用S.M.P.架构的多路对称CPU 内存:4GB以上的物理内存 磁盘:RAID-01磁盘阵列或固态硬盘 MySQL配置文件优化 调整配置项 SQL优化 尽量使用索引进行查询 优化分页 GROUP BY优化 MySQL架构优化 架构选择:主从、主主、一主多从、多主多…