Search our database

How to install Linux Malware Detect on CentOS

Linux Malware Detect (LMD) is a malware scanner for Linux released under the GNU GPLv2 license, that is designed around the threats faced in shared hosted environments. It uses threat data from network edge intrusion detection systems to extract malware that is actively being used in attacks and generates signatures for detection.

In addition, threat data is also derived from user submissions with the LMD checkout feature and from malware community resources. The signatures that LMD uses are MD5 file hashes and HEX pattern matches, they are also easily exported to any number of detection tools such as ClamAV.

Installation

Login or SSH to your server as a root and run

# cd /usr/local/src
# wget http://www.rfxn.com/downloads/maldetect-current.tar.gz
# tar -zxvf maldetect-current.tar.gz
# cd maldetect-1.4.2
# ./install.sh

After the installation gets completed, it will show

Linux Malware Detect v1.4.2
            (C) 2002-2013, R-fx Networks <proj@r-fx.org>
            (C) 2013, Ryan MacDonald <ryan@r-fx.org>
inotifywait (C) 2007, Rohan McGovern <rohan@mcgovern.id.au>
This program may be freely redistributed under the terms of the GNU GPL
 
installation completed to /usr/local/maldetect
config file: /usr/local/maldetect/conf.maldet
exec file: /usr/local/maldetect/maldet
exec link: /usr/local/sbin/maldet
exec link: /usr/local/sbin/lmd
cron.daily: /etc/cron.daily/maldet
 
maldet(328194): {sigup} performing signature update check...
maldet(328194): {sigup} local signature set is version 201205035915
maldet(328194): {sigup} new signature set (2014082316728) available
maldet(328194): {sigup} downloaded http://cdn.rfxn.com/downloads/md5.dat
maldet(328194): {sigup} downloaded http://cdn.rfxn.com/downloads/hex.dat
maldet(328194): {sigup} downloaded http://cdn.rfxn.com/downloads/rfxn.ndb
maldet(328194): {sigup} downloaded http://cdn.rfxn.com/downloads/rfxn.hdb
maldet(328194): {sigup} downloaded http://cdn.rfxn.com/downloads/maldet-clean.tgz
maldet(328194): {sigup} signature set update completed
maldet(328194): {sigup} 11788 signatures (9895 MD5 / 1893 HEX)

Configuration

Maldet can be configured by editing the file below

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

The default configuration should be as below

# [ EMAIL ALERTS ]
##
# The default email alert toggle
# [0 = disabled, 1 = enabled]
email_alert=1
 
# The subject line for email alerts
email_subj="maldet alert from $(hostname)"
 
# The destination addresses for email alerts
# [ values are comma (,) spaced ]
email_addr="youremail@yourdomain.com"
 
# Ignore e-mail alerts for reports in which all hits have been cleaned.
# This is ideal on very busy servers where cleaned hits can drown out
# other more actionable reports.
email_ignore_clean=0
 
##
# [ QUARANTINE OPTIONS ]
##
# The default quarantine action for malware hits
# [0 = alert only, 1 = move to quarantine & alert]
quar_hits=1
 
# Try to clean string based malware injections
# [NOTE: quar_hits=1 required]
# [0 = disabled, 1 = clean]
quar_clean=1
 
# The default suspend action for users wih hits
# Cpanel suspend or set shell /bin/false on non-Cpanel
# [NOTE: quar_hits=1 required]
# [0 = disabled, 1 = suspend account]
quar_susp=0
# minimum userid that can be suspended
quar_susp_minuid=500

You may edit the following values to configure Maldet to your needs