In this article, we will show you the Maldet (LMD) commands and some of the examples. Before we start, do you know
What is Maldet? (LMD)
Maldet is a malware detector which is mainly used in Linux based servers. To remove malware that is actively used in attacks and produces signatures for detection, it utilizes threat information from network edge intrusion detection systems.
It will be very useful for those who are managing shared Linux hosting servers. As many a time, an account is compromised with infected files and some malware files are there in it. You can readily identify the files by using Maldet and can also remove or quarantine those files.
A lot of switches and options are available with Maldet. Let us check all the switches/options of maldet with the example.
1). -b, 每background :
This command will execute operations in the background. It is suitable for large scans
Example:
[root@hoststud?~]# maldet -b -r /home/hostuser/
2). -u, 每update :
This command will update malware detection signatures from rfxn.com
3). -d, 每update-ver
This command will update the installed version from rfxn.com
Example:
[root@hoststud?~]# maldet -d
4). -m, 每monitor USERS|PATHS|FILE
This command will run maldet with inotify kernel level file create/modify monitoring
Example:
[root@hoststud?~]# maldet -m /home/hostuser/
5). -k, 每kill
This command will terminate inotify monitoring service
Example:
[root@hoststud?~]# maldet -k
6). -r, 每scan-recent PATH DAYS
This command scans created / modified files over the last X days (default: 7d, wildcard:?)
e.g: maldet -r /home/?/public_html 2
7). -a, 每scan-all PATH
This command will scan all files in path (default: /home, wildcard: ?)
e.g: maldet -a /home/?/public_html
8). -c, 每checkout FILE
This command will upload suspected malware to rfxn.com for review & hashing into signatures
9). -l, 每log
This command will view maldet log file events.
Example:
[root@hoststud?~]# maldet -l
10). -e, 每report SCANID email
This command will view scan report of most recent scan or of a specific SCANID and optionally e-mail the report to a supplied e-mail address.
11). -s, 每restore FILE|SCANID
This command will restore file from quarantine queue to orginal path or restore all items from a specific SCANID
e.g: maldet 每restore /usr/local/maldetect/quarantine/config.php.23754
e.g: maldet 每restore 08594-19634.85478
12). -q, 每quarantine SCANID
This command will quarantine all malware from report SCANID
e.g: maldet 每quarantine 08594-19634.85478
13). -n, 每clean SCANID
This command will try to clean & restore malware hits from report SCANID
e.g: maldet 每clean 08594-19634.85478
14). -U, 每user USER
This command will set execution under specified user, ideal for restoring from user quarantine or to view user reports.
e.g: maldet 每user nobody 每report
e.g: maldet 每user nobody 每restore 08594-19634.85478
15). -p, 每purge
This command will clear logs, quarantine queue, session and temporary data.
Now you learned about some Maldet (LMD) commands and the examples. For more articles on the topic CentOS, please click here.