Learn how to install Maldet on cPanel fast and easy. Linux Malware Detector (aka Maldet) is a tool written by Rfxnetworks. It’s a simple but effective way to inspect and scan system and user files against malware or virus.
Maldet Main Features
- MD5 file hash detection
- HEX based pattern matching
- Integration with ClamAV if available, to use it as Scan Engine
- Fast and easy signature update
- Integrated version update
- Scan only files changed/added recently in the last X days-recent option to scan only filesthat have been added/changed in X days
- Scan individual directories or the entire server
- Send scan reportes over email
Install Maldet on cPanel
Run the following commands as root to download, extract and install Maldet on cPanel servers:
cd /root/ wget http://www.rfxn.com/downloads/maldetect-current.tar.gz tar -xvf maldetect-current.tar.gz cd maldet* ./install.sh
At this point Maldet should be ready to use.
Running Maldet on Linux
Before running Maldet, let’s update it to get the latest malware database:
maldet -d && maldet -u
Output example:
[[email protected]:~]maldet -d && maldet -u Linux Malware Detect v1.4.2 (C) 2002-2013, R-fx Networks <[email protected]> (C) 2013, Ryan MacDonald <[email protected]> inotifywait (C) 2007, Rohan McGovern <[email protected]> This program may be freely redistributed under the terms of the GNU GPL v2 maldet(544672): {update} checking for available updates... maldet(544672): {update} hashing install files and checking against server... maldet(544672): {update} version check shows latest but hash check failed, forcing update... maldet(544672): {update} completed update v1.4.2 => v1.5, running signature updates... maldet(544968): {sigup} performing signature update check... maldet(544968): {sigup} local signature set is version 201608309492 maldet(544968): {sigup} latest signature set already installed maldet(544672): {update} update and config import completed. [[email protected]:~]
Scan an indiviual cPanel home user account
maldet -a /home/user
Scan all the server public_html user directories and send it to background:
maldet --scan-all -b /home?/?/public_?
List all available reports:
maldet --report list
Show details for each report:
maldet --report SCAN_ID
Replace SCAN_ID with your Maldet real scan ID.
Some important options like quarantine are disabled by default, you can eanble this and also tweak maldet further by editing maldet main configuration file:
/usr/local/maldetect/conf.maldet
Conclusion
As you can see, the steps to install Maldet on cPanel are pretty simple, and can be done within 1 minute. Make sure you read the full app documentation to understand how it works, that way your malware scans will be much effective if you use the right options for each Linux system you manage.
Important: Maldet is a great free tool for your linux & cpanel malware scans, however, it is not the best and not the only one that you should use in your daily SysAdmin job. CXS is in our opinion, the best malware scan tool for cPanel servers, it’s commercial but the most effective so far.
Further reading: