Install Linux Malware Detect (LMD) on Linux machine

First of all, what is LMD – Linux Malware Detect – is a [easyazon-link asin=”159749268X” locale=”us”] malware [/easyazon-link] 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. This is great tool to have on your Linux running machine – local or hosted.

Features:
– MD5 file hash detection for quick threat identification
– HEX based pattern matching for identifying threat variants
– statistical analysis component for detection of obfuscated threats (e.g: base64)
– integrated detection of ClamAV to use as scanner engine for improved performance
– integrated signature update feature with -u|–update
– integrated version update feature with -d|–update-ver
– scan-recent option to scan only files that have been added/changed in X days
– scan-all option for full path based scanning
– checkout option to upload suspected malware to rfxn.com for review / hashing
– full reporting system to view current and previous scan results
– quarantine queue that stores threats in a safe fashion with no permissions
– quarantine batching option to quarantine the results of a current or past scans
– quarantine restore option to restore files to original path, owner and perms
– quarantine suspend account option to Cpanel suspend or shell revoke users
– cleaner rules to attempt removal of malware injected strings
– cleaner batching option to attempt cleaning of previous scan reports
– cleaner rules to remove base64 and gzinflate(base64 injected malware
– daily cron based scanning of all changes in last 24h in user homedirs
– daily cron script compatible with stock RH style systems, Cpanel & Ensim
– kernel based inotify real time file scanning of created/modified/moved files
– kernel inotify monitor that can take path data from STDIN or FILE
– kernel inotify monitor convenience feature to monitor system users
– kernel inotify monitor can be restricted to a configurable user html root
– kernel inotify monitor with dynamic sysctl limits for optimal performance
– kernel inotify alerting through daily and/or optional weekly reports
– e-mail alert reporting after every scan execution (manual & daily)
– path, extension and signature based ignore options
– background scanner option for unattended scan operations
– verbose logging & output of all actions

Installation is very simple and you can use this script or do it manually step by step. Switch to root user on your machine and copy the text bellow to lmd.sh, run chmod a+x lmd.sh and then you are ready to run it as a script ./lmd.sh – it will download the file, extract and install on your system. You will need just manually edit few things as outlined in the file if you wish to receive email upon completion of the scan of your system

!#/bin/sh
#################################
# INSTALL LMD on LINUX box
# ###############################
# Create TEMP directory and download the package
cd /
mkdir TEMP
cd TEMP
wget http://www.rfxn.com/downloads/maldetect-current.tar.gz
ls -l

# Extract the files and install it
tar -xzvf maldetect-current.tar.gz
cd maldetect-*
./install.sh

# Open file /usr/local/maldetect/conf.maldet and make changes according to your needs.

# email_alert : If you would like to receive email alerts, then it should be set to 1.
# email_subj : Set your email subject here.
# email_addr : Add your email address to receive malware alerts.
# quar_hits : The default quarantine action for malware hits, it should be set 1.
# quar_clean : Cleaing detected malware injections, must set to 1.
# quar_susp : The default suspend action for users wih hits, set it as per your requirements.
# quar_susp_minuid : Minimum userid that can be suspended.
# Run the scan on entire system

Once you edited the /usr/local/maldetect/conf.maldet  to your specification,you can now initiate update and full system scan with this command

su
maldet -u  (update the signature)
maldet -a  (checking the system) => check-all)

You can check more on the Linux Malware Detect on the author blog R-fx Networks

[easyazon-image align=”none” asin=”0124077498″ locale=”us” height=”160″ src=”http://ecx.images-amazon.com/images/I/41kJ00pF9HL._SL160_.jpg” width=”130″]

Leave a Reply