October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk6 min

How Linux Malware Persists Across Reboots: systemd, Cron, and Kernel Modules

Linux persistence can live in systemd units, cron schedules, timers, or kernel-module loading arrangements. Learn what each does and how to investigate without mistaking an unfamiliar artifact for proof of malware.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Linux malware can survive a reboot by arranging to start a systemd service, run a command through cron or a systemd timer, or load a malicious kernel module. The first two mechanisms are user-space configuration; a kernel module runs with kernel privileges and can make the compromised machine’s own reports less trustworthy. An unfamiliar startup entry is a lead to investigate, not proof of malware.

How do these persistence mechanisms differ?

Each mechanism gives code a way to run again after a restart or at a later time, but they differ in when they run, which account runs them, and how reliable local inspection is if the host is compromised.

Mechanism Scope and trigger Execution and configuration Downtime behavior and inspection limits
systemd service May be system-wide or associated with a user manager. Starts when activated through boot targets, dependencies, or other unit relationships. systemd supervises a process described by a plain-text unit; the unit’s command and related configuration determine what runs. Inspect unit files, drop-ins, enablement links, and the executable path. systemd.unit(5) and systemd.service(5) document unit configuration and services. A service activated at boot can run after each boot. Its persistence does not depend on a missed schedule being caught up. Inspection remains in user space unless the host is compromised at a deeper level.
cron job Can be per-user or system-wide. Runs commands according to a time-and-date schedule. A user crontab runs commands as its owner; system-wide cron formats can specify a user. Check the crontab and the command or script it invokes. Runs when its schedule is due, subject to the cron implementation and host availability. The reviewed implementation checks /etc/crontab, /etc/cron.d/, /var/spool/cron, and /etc/anacrontab; these are inspection examples, not guaranteed paths on every distribution.
systemd timer Can activate a system or user unit according to a timer schedule. A timer activates a named unit; if Unit= is absent, it defaults to a same-named service. Inspect the timer and the unit it activates. With Persistent=true on a calendar timer, systemd records the last trigger and can run missed work after downtime. That catch-up behavior is distinct from a service configured to start at every boot.
Kernel module Typically system-level. A module may be loaded during startup through the host’s module-loading arrangements, but modules can also be loaded without rebooting. Runs in kernel context, rather than as an ordinary user-space process. Module files and installation conventions are kernel-version- and distribution-dependent. A compromised module may hide or tamper with user-space inspection results. Local output alone may not be reliable when kernel compromise is plausible.

On many distributions, systemd runs as PID 1 during boot and maintains user-space services; separate user managers also run for logged-in users. Unit enablement is not simply a property of one file: enablement links, dependencies, drop-ins, and, less commonly, generators can affect activation. The [Install] section is acted on during enablement, while dependency relationships can connect units to startup targets. See MITRE ATT&CK’s systemd service technique page for the technique context.

How do I find malware that starts on boot in Linux?

Start by establishing what is normal for this machine. Paths and defaults depend on the distribution, init system, installed packages, and version; system-wide configuration and a logged-in user’s configuration are separate scopes. A service or job can be legitimate even if its name or location is unfamiliar, so investigate its provenance and behavior rather than treating one clue as a verdict.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
  1. Record the host context. Note the distribution, kernel version, init system, user and session scope, and the timing of the suspected incident. These details help distinguish expected package and administrator configuration from unexpected changes.
  2. Inventory systemd services and user services. Review active and enabled state, unit contents, drop-ins, dependencies, and relevant links beneath target .wants and .requires directories. A service need not have an obvious enablement link in the location you first check if another dependency activates it.
  3. Trace the command a unit runs. Follow the executable or script path referenced by the service configuration. Check its owner, permissions, package or other source, and modification history. Pay attention to new names that imitate familiar services, commands in temporary or user-writable locations, unexpected execution users, and unrelated changes to a legitimate unit. These are reasons to investigate, not proof of maliciousness.
  4. Correlate configuration changes with boot activity. Compare unit changes with process behavior during boot, logs, network activity, package history, and external telemetry. MITRE ATT&CK’s detection guidance recommends correlating systemd unit changes with outlier process behavior during boot.

How do I check cron jobs for malware?

Review both per-user schedules and system-wide cron configuration. A command in a user’s crontab runs under that crontab owner’s account; a system-wide cron file may specify a different user. Record the account that will run the command before judging what access it has.

  • Inspect the relevant user crontabs and system cron locations used by the host. The reviewed implementation includes /etc/crontab, /etc/cron.d/, /var/spool/cron, and /etc/anacrontab, but those paths are not a universal guarantee across distributions.
  • Read the complete command, then inspect any referenced script or executable. Check ownership, permissions, timestamps, provenance, and whether the file matches expected package or administrator activity.
  • Compare the schedule and execution account with the host’s duties. An unexpected user, non-standard interval, or a schedule paired with unusual process behavior deserves closer review, but none establishes maliciousness on its own.

Also inspect systemd timers; checking cron alone misses that scheduler. A timer activates a unit, and Persistent=true on a calendar timer can cause a missed run to be caught up after the machine was off. It does not mean that every timer behaves like a service that starts on every boot.

Can a Linux rootkit survive a reboot?

Yes. Malware can arrange for a kernel module to load during startup, so rebooting does not necessarily remove it. A loadable module extends kernel functionality and may be loaded or unloaded without restarting the machine. Because its code runs in kernel context, a malicious module can interfere with what ordinary tools report; it need not hide every artifact for local results to be suspect.

Do not assume that every unfamiliar .ko file is malicious. External modules are built against the relevant kernel build artifacts, and the kernel’s kbuild documentation gives /lib/modules/<kernel_release>/updates/ as a default installation directory; distribution and package conventions can differ. Validate module provenance against trusted package records or known-good records for the matching kernel. ATT&CK’s kernel module and extension technique page includes Drovorub and REPTILE as examples associated with this kind of persistence.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If kernel-level compromise is plausible, preserve evidence and corroborate host-local findings using trusted offline methods or external telemetry. A kernel compromise can undermine the reliability of the very tools used to inspect it, so one local inventory should not be treated as conclusive.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What should you do if you find a suspicious startup artifact?

  1. Preserve context. Record the artifact’s location, relevant configuration, owner, timestamps, and the host and account scope. Avoid treating a name or timestamp alone as proof.
  2. Trace what it runs and who runs it. Follow service commands, cron commands, timer targets, and module provenance to their source and execution context.
  3. Correlate independent evidence. Compare configuration changes with process behavior, logs, network activity, package history, and telemetry that does not depend solely on the possibly compromised host.
  4. Contain and preserve evidence if compromise is indicated. Follow the organization’s incident-response process. Removing one startup entry does not establish that the host is clean; more than one persistence mechanism may coexist.

MITRE ATT&CK documents scheduled-task and service techniques as behaviors defenders can use to organize detection and investigation, not as a prevalence measure. The available technical references do not establish that any one of these mechanisms is universally more common or stealthier than the others.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.