How To Install Maldet On Linux Mint: Complete Malware Detection Guide

How To Install Maldet On Linux Mint: Complete Malware Detection Guide

5 Steps for Installing Maldet - Packt SecPro

Securing your Linux Mint system against modern digital threats requires implementing robust, signature-based security layers like Linux Malware Detect, commonly known as Maldet. This deployment strategy guides you through installing, configuring, and optimizing Maldet on Linux Mint to rapidly identify and isolate malicious threats. By integrating Maldet with ClamAV, you establish an enterprise-grade local security posture capable of executing high-speed, automated daily scans across your entire file system.

Pre-Installation System Audit & Security Benchmarks

Before deploying Linux Malware Detect on your Linux Mint workstation or server, you must ensure your operating system meets the baseline configuration requirements. Maldet is designed to run silently in the background, but its extraction, file-indexing, and signature-matching phases demand specific system utilities and storage allocations. Preparing your environment beforehand prevents compile-time errors and avoids stalling your administrative terminal.



System Readiness and Resource Allocation Checklist



  • Operating System Target: Linux Mint 21.x (Vanessa, Vera, Victoria) or Linux Mint 22 (Wilma), built on Ubuntu LTS codebases.
  • Privileged Credentials: Root access or an administrator account assigned to the sudo wheel group.
  • Essential Storage Overhead: A minimum of 500 MB of unallocated space on the primary partition to hold quarantine directory buffers, log repositories, and signature databases.
  • Hardware Compute Thresholds: At least 1 GB of system RAM (2 GB recommended if integrating ClamAV for signature processing) and a modern multi-core processor.
  • Pre-requisite Software Utilities: Standard system binaries including wget (for source retrieval), tar (for archive decompression), and nano or vim (for file configuration tasks).
  • Expected Deployment Window: Approximately 10 to 15 minutes of hands-on administrative configuration.

Deploying Linux Malware Detect on Linux Mint

This procedural runbook walks you through the manual compilation, installation, configuration, and integration of Linux Malware Detect (LMD) on your Linux Mint system. Because Maldet is not distributed via standard Ubuntu or Linux Mint Software Manager repositories, compiling from the official upstream developer source ensures you receive the most secure, authentic, and up-to-date program binaries.



Step 1: Upgrading Local System Repositories

Before pulling the installation packages, you must refresh your local package index and update any outdated binaries. This step ensures that your development utilities and networking packages are fully aligned with the upstream security repositories.

Open your terminal emulator and execute the system update command by typing sudo apt update && sudo apt upgrade -y and pressing Enter. Enter your administrative password when prompted. This operation synchronizes your package cache and applies any outstanding security updates to your Linux Mint kernel and base utilities.



Step 2: Installing Essential Archive Utilities

Maldet is distributed as a compressed tarball archive. To fetch and extract this program, you must ensure that your system has the curl, wget, and tar utilities installed.

Execute the command sudo apt install wget tar curl build-essential -y in your terminal. If these utilities are already installed, the package manager will simply verify their presence and exit. The inclusion of build-essential provides additional compilation headers that aid in underlying system calls.



Step 3: Fetching the Latest Maldet Source Archive

The developer of Maldet, R-FX Networks, hosts the official tarball on their secure staging servers. You will download the tarball file directly to your system's temporary directory to keep your home folder clean.

Navigate to your system's temporary file directory by executing cd /tmp. Once inside this directory, pull the official, uncorrupted Maldet package by entering wget http://www.rfxn.com/downloads/maldetect-current.tar.gz and pressing Enter. Wait for the download progress bar to reach completion.



Step 4: Extracting the Maldet Installation Directory

With the archive downloaded, you must unpack the tarball to expose the shell installation scripts and supporting security signatures.

Type tar -xvf maldetect-current.tar.gz and press Enter. This command unpacks the compressed contents into a new directory. To find the exact name of the newly created directory, run the list command ls in your terminal. You will see a directory named with the format maldetect- followed by the current version number, such as maldetect-1.6.4. Enter this directory by typing cd maldetect- followed by the specific version number, for example, cd maldetect-1.6.4 and hitting Enter.



Step 5: Executing the Maldet Installation Script

Inside the extracted source folder is an automated shell script that configures the system directories, sets up background cron jobs, and places binary symlinks.

Begin the installation process by typing sudo ./install.sh and hitting Enter. The script will run automatically, building the configuration tree at the directory path /usr/local/maldetect. It will also create a daily cron job at /etc/cron.daily/maldet, establish standard system command paths, and install the native detection engine. Upon successful completion, the script outputs a confirmation notice indicating that the installation is complete.



Step 6: Deploying ClamAV for High-Speed Scan Integration

While Maldet works perfectly as a standalone engine, it relies on standard bash-based scanning, which can be computationally slow and resource-heavy for large directories. Integrating ClamAV as Maldet's underlying processing engine allows Maldet to use ClamAV's specialized C-based scanning structures, decreasing scan times by up to 400 percent.

To install ClamAV and its background daemon, run the command sudo apt install clamav clamav-daemon -y in your terminal. Once the package manager completes the setup, update your ClamAV signature database to ensure it catches the newest threats by running sudo freshclam. Note that you may need to temporarily stop the freshclam daemon if it runs automatically; do this using sudo systemctl stop clamav-freshclam prior to running the manual update, and restart it afterward using sudo systemctl start clamav-freshclam.



Step 7: Optimizing the Maldet Configuration Profile

With both Maldet and ClamAV successfully residing on your machine, you must modify Maldet's configuration file to activate automated remediation, toggle email reporting, and force ClamAV engine integration.

To begin editing the main configuration file, run sudo nano /usr/local/maldetect/conf.maldet in your terminal.

Scroll down through the file to locate the following configuration keys and modify their values to match these recommended production security settings:

First, look for the email alert option by finding the variable email_alert="0" and changing it to email_alert="1" to enable automated message notifications upon threat discovery. Directly below, update the email_addr="you@domain.com" field, replacing the placeholder with your actual administrative email address.

Next, configure how Maldet treats identified malware hits. Locate quarantine_hits="0" and change this value to quarantine_hits="1". This ensures that any discovered security threats are immediately stripped of their execution privileges and moved to the secure quarantine directory at /usr/local/maldetect/quarantine.

Following this, change the quarantine_clean="0" variable to quarantine_clean="1". This setting authorizes Maldet to attempt to clean out injected malware headers, web shells, and malicious code blocks from otherwise legitimate system files.

To ensure Maldet uses the ClamAV binary to accelerate scanning, locate the scan engine preference parameter. Ensure that the line clamav_scan="1" is active (set to 1 instead of 0). This tells Maldet's background scanner to query ClamAV's library when executing broad file checks.

Once these configurations have been set, write the changes to the disk in Nano by pressing Ctrl+O, hitting Enter to confirm the file name, and then exiting the editor by pressing Ctrl+X.



Step 8: Performing Your Initial Security Scan

Now that Maldet is installed and tailored to your system specifications, you should run an initial baseline scan on a critical target path, such as your user home directories or public web storage folders.

To update Maldet's internal signatures to the absolute latest version before scanning, execute the command maldet --update-sigs or maldet -u in your terminal.

Once updated, initiate an active scan of your user folder by executing sudo maldet --scan-all /home or choosing a specific web folder by running sudo maldet --scan-all /var/www. The terminal will update as it indexes the directories and begins its search.

Pro-Tip: If you need to run a system-wide scan in the background without locking up your active terminal session, append the background flag to your execution command like this: sudo maldet --background --scan-all /home. You can monitor the background execution progress at any time by running tail -f /usr/local/maldetect/logs/event_log.

Once the scan concludes, Maldet will output a scanning report ID code, which resembles a string like 241108-1245.5412. To view the full security report detailing any found threats, execute the command sudo maldet --report 241108-1245.5412, substituting this string with your actual report ID.


Fix your Windows PC by Installing Linux Mint

Fix your Windows PC by Installing Linux Mint

Maldet Configuration Parameter Matrix

This configuration matrix outlines the critical parameters within the /usr/local/maldetect/conf.maldet file. Understanding these directives allows you to adjust the system's security response based on your server's hardware limits or personal security needs.



Configuration Directive Default Setting Recommended Setting Operational Security Impact
email_alert 0 (Disabled) 1 (Enabled) Triggers automated email dispatches to system administrators immediately after any malware detection event.
email_subj malware alert malware alert on Linux Mint Customizes the subject header of outgoing alert emails to prevent them from being caught in spam filters.
email_addr root admin@yourdomain.com Designates the specific destination address where security reports and system alerts are routed.
quarantine_hits 0 (Disabled) 1 (Enabled) Automatically moves detected threats to a secure directory and changes file permissions to 000.
quarantine_clean 0 (Disabled) 1 (Enabled) Instructs the cleaner engine to try to remove malicious code signatures from compromised files.
quarantine_suspend_user 0 (Disabled) 0 (Disabled) Suspends a user account if hits are detected in their space; keep at 0 on single-user workstations to avoid self-lockout.
clamav_scan 1 (Enabled) 1 (Enabled) Tells Maldet to look for the local ClamAV binary to speed up the filesystem indexing process.
scan_max_size 15728640 20971520 Sets the maximum file size the engine will scan; increasing this to 20MB covers larger compressed archives.

Securing Maldet: Common Execution Failures & Remediation

When running Maldet on Linux Mint, custom security rules, system directory structures, or missing package dependencies can occasionally trigger operational faults. Use the following troubleshooting scenarios to diagnose and repair issues with your malware scanner.



Scanner Execution Timeouts or Excessive CPU Usage



  • Root Cause: Maldet is running without ClamAV integration, forcing the bash-based engine to scan deep directory trees. This leads to high CPU usage and long wait times.
  • Actionable Fix: First, verify that the ClamAV scanning daemon is active by typing sudo systemctl status clamav-daemon. If it is stopped, start it by running sudo systemctl start clamav-daemon. Next, open the /usr/local/maldetect/conf.maldet configuration file and make sure the variable clamav_scan="1" is uncommented and enabled. Running maldet with ClamAV active offloads resource-heavy scanning to the optimized C-binary engine, dropping CPU usage and speeding up scans.


Missing Email Notifications on Threat Detection



  • Root Cause: The local system does not have an active Mail Transfer Agent (MTA) like Postfix or Sendmail configured to route local mail to external mail networks.
  • Actionable Fix: To allow Maldet to dispatch outbound emails, install a lightweight mail forwarding utility by running sudo apt install postfix mailutils -y in your terminal. During installation, select "Internet Site" and set your system domain name. Once installed, test outbound mailing capabilities by typing echo "Test Email Body" | mail -s "Test Subject" your-email@domain.com to verify that your network routing path is open.


Maldet Signature Update Connection Errors



  • Root Cause: A local firewall configuration, such as Uncomplicated Firewall (UFW), is blocking outbound HTTP or HTTPS request headers on ports 80 and 443, preventing updates from fetching files from rfxn.com.
  • Actionable Fix: Temporarily disable the firewall by running sudo ufw disable and try to run sudo maldet -u again. If the signature update succeeds, re-enable your firewall security layer and open outbound web traffic ports by executing sudo ufw allow out 80/tcp and sudo ufw allow out 443/tcp, followed by turning the firewall back on using sudo ufw enable.

Frequently Asked Questions



Does Linux Malware Detect run in real-time on Linux Mint?

Maldet supports real-time monitoring on Linux Mint using the inotify kernel subsystem. You can monitor file alterations in specific target folders in real-time by running the monitoring command maldet --monitor /var/www or maldet --monitor /home. This spins up a background process that watches your designated directories for changes and quarantines threats as they write to disk.



Where are the quarantined malware files stored, and are they safe?

Any threat captured by Maldet is stripped of its execution rights (permissions set to 000) and moved to the storage directory /usr/local/maldetect/quarantine/. Because execution rights are removed and the file is isolated from user-accessible directories, the quarantined code cannot run or impact your Linux Mint system.



How do I restore a false positive file that Maldet quarantined?

If Maldet isolates a benign file that you know is safe, you can restore it using its original path. To do this, locate your quarantine log file, find the filename, and run the command maldet --restore filename.ext or use the direct target argument maldet --restore /usr/local/maldetect/quarantine/filename.ext. This will return the file to its original directory with its original file permissions.



Is Maldet safe to run alongside other Linux Mint security tools like Timeshift?

Maldet is fully compatible with Timeshift and other backup software. Because Maldet focuses on scanning static system file directories and active RAM buffers, it does not interfere with system-state snapshot utilities like Timeshift. In fact, running a quick Maldet scan before creating a Timeshift restore point ensures your backup snapshots remain clean and threat-free.

Elevating Your Linux Mint Security Strategy

To ensure your system remains resilient against emerging threats, supplement your signature scans with robust network filtering. For more information on securing your connection, consider setting up a dedicated firewall to block inbound attack traffic before it ever hits your local file system.


How To Install Wine 10 on Linux Mint 22 [Guide]

How To Install Wine 10 on Linux Mint 22 [Guide]

Read also: Exploring the Charm and Value: A Deep Dive into Homes for Sale in Crawfordsville Indiana for 2024
close