在 CentOS 7/RHEL 7 上安装 Linux 恶意软件检测

[ad_1]

Linux恶意软件检测 (LMD) 或干脆 马尔代 是免费的 恶意软件扫描器 设计的 适用于 Linux 机器 在 GNU GPLv2 下发布。 它是专门针对共享托管环境中的威胁而设计的。 LMD 使用来自网络边缘入侵检测系统的威胁数据来获取攻击中使用的实际恶意软件,并生成各种签名进行检测。
除了这些功能之外,还可以使用 LMD 中的结帐功能从用户提交的文件中提取 LMD 威胁数据。 恶意软件资源. 它使用诸如 HEX 模式和 MD5 文件哈希之类的签名。 它们也可以从包括 ClamAV 在内的各种检测工具中提取。
在本文中,我们将解释如何安装和配置 Linux恶意软件检测 随着 ClamAV 在 RHEL 7.0/CentOS 7.0 中。

在 CentOS 7 / RHEL 7 上安装 LMD

LMD 在 CentOS 官方存储库中没有作为预构建包提供,但可以从 LMD 项目网站以 tarball 的形式提供。 使用以下命令下载最新版本的 LMD。

# cd /tmp/
# curl -O https://www.rfxn.com/downloads/maldetect-current.tar.gz

打开已经下载的 Linux 恶意软件文件:

# tar -zxvf maldetect-current.tar.gz
# cd maldetect*

运行解压目录中的安装脚本 install.sh。

# bash install.sh

配置 Linux 恶意软件检测

Linux Malware Detect 配置文件是/usr/local/maldetect/conf.maldet,可以按照以下要求修改:

# vi /usr/local/maldetect/conf.maldet

以下是一些您应该在系统上进行的重要设置,以便成功检测和删除威胁。

# Enable Email Alerting
email_alert="1"

# Email Address in which you want to receive scan reports
email_addr="[email protected]"

# Use with ClamAV
scan_clamscan="1"

# Enable scanning for root owned files. Set 1 to disable.
scan_ignore_root="0"

# Move threats to quarantine
quarantine_hits="1"

# Clean string based malware injections
quarantine_clean="1"

# Suspend user if malware found.
quarantine_suspend_user="1"

# Minimum userid value that be suspended
quarantine_suspend_user_minuid="500"

在 RHEL/CentOS 7.0 上安装 ClamAV

LMD 在使用 ClamAV 扫描大型文件集时表现更好。 ClamAV(Clam Antivirus)是一种开源防病毒解决方案,用于检测病毒、恶意软件、木马和其他恶意程序。
ClamAV 在 EPEL 存储库中可用,因此请在您的 CentOS / RHEL 机器上配置它。

# rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

使用 YUM 命令安装 ClamAV。

# yum -y install clamav clamav-devel clamav-update inotify-tools

现在,使用以下命令更新 ClamAV 病毒数据库。

# freshclam

LMD 不需要额外的配置,因为 ClamAV 和 LMD 的使用默认是启用的。

笔记: 这些只是安装 ClamAV 以便将其与 LMD 集成的基本说明。 我们不会详细讨论 ClamAV 设置,因为正如我们之前所说,LMD 签名仍然是检测和清除威胁的基础。

测试 Linux 恶意软件检测

现在是时候测试我们最近的 LMD / ClamAV 安装了。 我们将不使用真正的恶意软件,而是使用 EICAR 测试文件,可从 EICAR 网站下载。

# cd /tmp/
# wget https://www.eicar.org/download/eicar_com.zip 
# wget https://www.eicar.org/download/eicarcom2.zip

现在,扫描恶意软件的目录:

# maldet --scan-all /tmp

从输出中,您可以看到 LMD 正在使用 ClamAV 扫描程序引擎执行扫描并导致发现两个恶意软件命中。

Linux 恶意软件检测器扫描报告

LMD 将扫描报告存储在 /usr/local/maldetect/sess/ 下。 使用带有 SCAN ID 的 maldet 命令查看详细的扫描报告。

 maldet --report 181202-1700.3530
LMD扫描报告

您可以看到这两个文件现在都被隔离了。

更新 Linux 恶意软件检测

使用以下命令更新您的 LMD。

# maldet -d

要更新 LMD 签名,请运行:

# maldet -u

结论

恭喜,LMD现在已经安装在CentOS 7系统中,可以使用了。 按照以下步骤进行必要的编辑以根据您的需要配置 LMD。

[ad_2]

Related Posts