You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[10. Hook Scanning & Service Integration](#10-hook-scanning--service-integration)
63
-
-[11. License](#11-license)
64
-
-[12. Support Information](#12-support-information)
75
+
-[10. Hook Scanning](#10-hook-scanning)
76
+
-[Integration](#integration)
77
+
-[License](#license)
78
+
-[Support](#support)
65
79
66
80
---
67
81
@@ -94,6 +108,8 @@ maldet -u
94
108
95
109
## 1. Introduction
96
110
111
+
LMD's architecture, detection stages, and supported platforms.
112
+
97
113
Linux Malware Detect (LMD) is a malware scanner for Linux released under the GNU GPLv2 license, 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 derived from user submissions with the LMD checkout feature and from malware community resources.
98
114
99
115
LMD focuses on the malware classes that traditional AV products frequently miss: PHP shells, JavaScript injectors, base64-encoded backdoors, IRC bots, and other web-application-layer threats that target shared hosting user accounts rather than operating system internals.
@@ -151,6 +167,8 @@ LMD runs on any Linux distribution with bash and standard GNU utilities. Tested
151
167
152
168
## 2. Installation
153
169
170
+
Installing, upgrading, and removing LMD from a system.
171
+
154
172
The included `install.sh` script handles all installation tasks. Previous installations are automatically backed up.
155
173
156
174
```bash
@@ -177,6 +195,8 @@ Previous installs are saved to `/usr/local/maldetect.bk{PID}` with a `maldetect.
177
195
178
196
## 3. Configuration
179
197
198
+
All user-facing settings and their defaults. See `man maldet`(1) for the complete reference.
199
+
180
200
The main configuration file is `/usr/local/maldetect/conf.maldet`. All options are commented for ease of configuration. Options use `0`/`1` for disable/enable unless otherwise noted.
181
201
182
202
Configuration can also be overridden at runtime using the `-co` flag:
@@ -356,7 +376,9 @@ Later sources override earlier values:
356
376
357
377
---
358
378
359
-
## 4. CLI Usage
379
+
## 4. Usage
380
+
381
+
Command-line interface, exit codes, and common examples. See `man maldet`(1) for the complete option reference.
360
382
361
383
```
362
384
usage: maldet [OPTION] [ARGUMENT]
@@ -407,7 +429,13 @@ OTHER:
407
429
-h, --help show detailed help
408
430
```
409
431
410
-
**Exit codes:**`0` = success / no hits, `1` = error or all scan paths non-existent, `2` = malware hits found.
Real-time file monitoring with kernel inotify, digest alerts, and supervisor management.
554
+
521
555
Real-time file monitoring uses the kernel inotify subsystem to detect file creation, modification, and move events. Requires a kernel with `CONFIG_INOTIFY_USER` (standard on all modern kernels).
522
556
523
557
```bash
@@ -559,6 +593,8 @@ When using the `users` mode, only subdirectories matching `inotify_docroot` (def
559
593
560
594
## 8. Signature System
561
595
596
+
Signature types, naming conventions, updates, and custom rule files.
597
+
562
598
LMD ships with five signature types:
563
599
564
600
| Type | File | Format | Count |
@@ -628,6 +664,8 @@ Remote import URLs can be configured for automatic download during signature upd
628
664
629
665
## 9. Quarantine & Cleaning
630
666
667
+
Isolating, restoring, and cleaning malware-infected files.
668
+
631
669
Quarantined files are stored under `/usr/local/maldetect/quarantine/` with permissions set to `000`. Original path, owner, permissions, and modification time are recorded in `/usr/local/maldetect/sess/quarantine.hist` for full restoration.
632
670
633
671
```bash
@@ -662,7 +700,9 @@ The cleaner is a sub-function of quarantine — files must be quarantined (or us
662
700
663
701
---
664
702
665
-
## 10. Hook Scanning & Service Integration
703
+
## 10. Hook Scanning
704
+
705
+
Service hook API for ModSecurity, FTP, Exim, and custom integrations.
666
706
667
707
LMD provides real-time file scanning for multiple services via the unified `hookscan.sh` API. A single script handles mode dispatch for ModSecurity, pure-ftpd, ProFTPD, Exim, and generic (custom) integrations.
668
708
@@ -801,7 +841,40 @@ For administrators replacing CXS with LMD:
801
841
802
842
---
803
843
804
-
## 11. License
844
+
## Integration
845
+
846
+
Connecting LMD with external tools, automation pipelines, and third-party scanners.
847
+
848
+
### ClamAV
849
+
850
+
LMD signatures are automatically symlinked to ClamAV data directories by `install.sh`, providing dual-engine coverage. Set `scan_clamscan=auto` (default) for automatic ClamAV detection. See [3.7 ClamAV Integration](#37-clamav-integration) for engine selection and signature validation.
851
+
852
+
### ELK Stack
853
+
854
+
Enable `enable_statistic=1` with `elk_host`, `elk_port`, and `elk_index` to stream scan events to Elasticsearch. See [3.9 ELK Integration](#39-elk-integration).
855
+
856
+
### Alerting Channels
857
+
858
+
LMD supports four alert delivery channels beyond email: Slack (Block Kit), Telegram (MarkdownV2), Discord (webhook embeds), and SMTP relay for environments without a local MTA. See [3.2 Alerting](#32-alerting) for configuration.
859
+
860
+
### JSON Reports
861
+
862
+
Machine-readable scan output for CI/CD and automation:
863
+
864
+
```bash
865
+
maldet --format json -e SCANID # JSON report to stdout
866
+
maldet --json-report list # list all scans as JSON
867
+
```
868
+
869
+
See `man maldet`(1) for the v1.0 JSON schema.
870
+
871
+
### Hosting Panel Detection
872
+
873
+
The daily cron auto-detects 12+ hosting control panels and adjusts scan paths. See [6. Cron Daily](#6-cron-daily) for the full panel matrix.
874
+
875
+
---
876
+
877
+
## License
805
878
806
879
LMD is developed and supported on a volunteer basis by Ryan MacDonald [ryan@rfxn.com].
807
880
@@ -812,7 +885,7 @@ required under GNU GPL.
812
885
813
886
---
814
887
815
-
## 12. Support Information
888
+
## Support
816
889
817
890
The LMD source repository is at: https://github.com/rfxn/linux-malware-detect
0 commit comments