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.hqwc.cn/news/576865.html

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

相关文章

实验2:CLI的使用与IOS基本命令

1、实验目的 通过本实验可以掌握: CLI的各种工作模式个CLI各种编辑命令“?” 和【Tab】键使用方法IOS基本命令网络设备访问限制查看设备的相关信息 2、实验拓扑 CLI的使用与IOS基本命令使用拓扑如下图所示。 3、实验步骤 (1)CLI模式的切…

Leetcoder Day43| 单调栈2

503.下一个更大元素II 给定一个循环数组(最后一个元素的下一个元素是数组的第一个元素),输出每个元素的下一个更大元素。数字 x 的下一个更大的元素是按数组遍历顺序,这个数字之后的第一个比它更大的数,这意味着你应该…

【chemistry 5】糖化学、脂化学和糖代谢

🌞欢迎来到生物化学的世界 🌈博客主页:卿云阁 💌欢迎关注🎉点赞👍收藏⭐️留言📝 🌟本文由卿云阁原创! 📆首发时间:🌹2024年3月29日&…

Spring Cloud+Spring Alibaba笔记

Spring CloudSpring Alibaba 文章目录 Spring CloudSpring AlibabaNacos服务发现配置中心 OpenFeign超时机制开启httpclient5重试机制开启日志 SeataSentinel流量控制熔断降级热点控制规则持久化集成 OpenFeign集成 Gateway MicrometerZipKinGateway路由断言过滤器 Nacos 服务…

上海斯歌高级顾问付梁钊,受邀出席“2024企业数字化转型高峰论坛”并进行主题演讲

本文转载自公众号CIO时代网 今年政府工作报告提出,发展新质生产力,深入推进数字经济创新发展。以科技创新推动产业创新,加快推进新型工业化,提高全要素生产率,不断塑造发展新动能新优势,促进社会生产力实现…

HarmonyOS 应用开发之任务(Mission)管理场景介绍

任务(Mission)管理相关的基本概念如下: AbilityRecord:系统服务侧管理一个UIAbility实例的最小单元,对应一个应用侧的UIAbility组件实例。系统服务侧管理UIAbility实例数量上限为512个。MissionRecord:任务…

Postman中参数填写方式!

Postman中参数填写和请求方法有关,一般接口用例请求方法GET与POST常用,所以主要是这两种请求方法请求参数填写 一、GET请求方法参数填写 1、直接在URL中填写请求参数,如直接在URL中填写: http://www.example.com:8089/userapi?unamelisi&…

机器学习之聚类算法、随机森林

文章目录 随机森林决策树基础特征值问题? 聚类算法 随机森林 决策树 基础 概念:从根节点一步步走到叶子节点(决策); 组成:根节点第一个选择的节点;叶子节点最终的决策结果;非叶子…

基于CNN-RNN的动态手势识别系统实现与解析

一、环境配置 为了成功实现基于CNN-RNN的动态手势识别系统,你需要确保你的开发环境已经安装了以下必要的库和工具: Python:推荐使用Python 3.x版本,作为主要的编程语言。TensorFlow:深度学习框架,用于构建…

ensp中pc机访问不同网络的服务器

拓扑图如下,资源已上传 说明:pc通过2个路由访问server服务器 三条线路分别是192.168.1.0网段,192.168.2.0网段和192.168.3.0网段,在未配置的情况下,pc设备是访问不到server的 具体操作流程 第一;pc设备…

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

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

自动发卡平台源码优化版,支持个人免签支付

源码下载地址:自动发卡平台源码优化版.zip 环境要求: php 8.0 v1.2.6◂ 1.修复店铺共享连接时异常问题 2024-03-13 23:54:20 v1.2.5 1.[新增]用户界面硬币增款扣款操作 2.[新增]前台对接库存信息显示 3.[新增]文件缓存工具类[FileCache] 4.[新增]库存同…