Linux Malware Detect (LMD) is a malware scanner for Linux distribution, Which is released under the GNU GPLv2 license. LMD v1.5 has been released after 2 Years & 7 months with huge bug fixs, changes & added new features on September 19, 2015.
That is especially designed to find the threats in shared hosted environments because in shared environment thousand plus users are sharing the resources. Each and every user will upload different things and script, etc.., 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.
1) Install Linux Malware Detect (LMD)
There is no .rpm, .dep or PPA is available to install LMD on your system, Also its not included in any of the distro official repository. The only option is left for us to install manual method from source. Here I’m going to show you about LMD installation.
2) Configure LMD
The configuration of LMD is handled through /usr/local/maldetect/conf.maldet and all options are well commented for ease of configuration. By default LMD has the auto-qurantine of files disabled and you need to enable it. Also make below changes to make it easier and more efficient to use LMD.
3) Scan The system
To scan the system using LMD, use maldet followed by directory which you want to scan.
The above command will scan entire support.2daygeek.comm directory. It may take time depending upon no of files in that directory.
4) Printing Scan Report
To view scan report, use maldet command followed by SCAN ID which you got from previous output. Output stored under /usr/local/maldetect/sess/ directory.
5) Removing injected files
In my causes no injection file is there. If you got output with malware injection on your system, use the below commands to remove it.
6) LMD & signatures Update to latest
Use below both command to update your LMD version & virus signatures to latest.
7) Live Monitoring
If you want to actively monitor specific directories for malware infection, you can run maldet as a daemon like below. This can be clubbed with inotify-tools, so you have to install the package to run live monitor.
Use the tail command with above log location to view live monitor.
8) Automatic Scan
While installing LMD, it will drop the auto scan file to /etc/cron.daily/maldet which will perform a daily update of signatures and keep the session, temp and quarantine data upto 14 days. Also run a daily scan of recent file system changes.