
Cybersecurity / Malware
Malware on Linux
Malware targeting Linux systems ranges from backdoors embedded in trojanized services to stealthy rootkits, kernel-level implants, shared-library injection via LD_PRELOAD, and threats to containerized and server environments — each leveraging Linux's prevalence in infrastructure, cloud, and IoT.
Linux malware exploits the operating system's widespread use in servers, cloud infrastructure, and embedded devices. Threats include backdoors in legitimate services, kernel-mode rootkits that conceal activity, LD_PRELOAD-based injection to hijack program execution, and campaigns targeting Docker containers and Kubernetes clusters for cryptojacking or data theft.
Overview and context
Linux's dominance in server markets, cloud infrastructure, and embedded systems makes it a prime target for malware actors seeking persistent access, resource hijacking, or data exfiltration. Unlike Windows-focused malware, Linux threats often prioritize stealth and longevity due to the operating system's role in critical infrastructure. Documented campaigns show malware authors compromising Linux systems to install backdoors in services like OpenSSH or Apache, deploy kernel rootkits to hide processes and network connections, abuse LD_PRELOAD to inject malicious shared libraries, and target container orchestration platforms for cryptojacking worm propagation.
The diversity of Linux malware reflects the variety of Linux deployments: from internet-facing web servers and database servers to containerized microservices and IoT gateways. Common objectives include establishing persistent backdoors for credential theft, hijacking computing resources for cryptocurrency mining, and using compromised Linux hosts as pivot points for lateral movement into internal networks. Defenses focus on minimizing attack surfaces, monitoring for anomalous library loading, verifying container image integrity, and enforcing least privilege principles.
Technical and feature breakdown
Backdoors & Trojanized Services
Backdoors in Linux systems frequently involve trojanizing legitimate network services to provide covert access while maintaining expected functionality. The most extensively documented campaign is Ebury (also known as Windigo), which compromised over 400,000 Linux and BSD servers since 2009 through credential stealing and exploitation of vulnerabilities in hosting providers. Ebury installs backdoored OpenSSH clients and servers to steal credentials, and trojanizes Apache and Nginx modules (HelimodSteal, HelimodRedirect, HelimodProxy) to exfiltrate form data, redirect traffic, or proxy raw TCP connections for spam distribution. Additional trojanized services include modified libc functions via LD_PRELOAD to hide malicious activity from system utilities like ps, netstat, and lsof.
Initial access vectors for Linux backdoors include credential stuffing using stolen SSH keys, exploitation of vulnerabilities in web hosting control panels (such as CVE-2021-45467 in Control Web Panel), and adversary-in-the-middle attacks against SSH traffic using ARP spoofing and iptables redirection. Once established, these backdoors enable long-term access: Ebury operators maintained persistent connections to compromised servers for years, regularly collecting credentials and deploying monetization modules like cryptominers or adware. The stealth of trojanized services lies in their dual nature — they continue to serve legitimate requests while silently performing malicious actions, making detection reliant on behavioral analysis rather than signature scanning.
Rootkits & Kernel Modules
Linux kernel rootkits operate as loadable kernel modules (LKMs) or through direct kernel modification to conceal malware presence and maintain privileged access. Documented rootkits demonstrate a range of techniques: traditional system call table hooking (e.g., Diamorphine, Knark), inline function prologue modification (Suterusu), and modern eBPF/ftrace-based hooks (Umbra, TripleCross). Capabilities consistently include hiding processes, files, network connections, and kernel modules themselves from administrative tools. For example, the Suterusu rootkit modifies function prologues to redirect execution, allowing it to hide files by hooking readdir/filldir functions in procfs and conceal network connections by manipulating /proc/net/tcp reads.
Persistence mechanisms for kernel rootkits vary from installing to /etc/modules or creating udev rules to more stealthy approaches like modifying initramfs or embedding in firmware. Communication channels range from simple backdoors listening on TCP ports to sophisticated protocols like VENOM's port-knocking trigger (requiring three specific TCP packets where Source Port + Sequence Number equals 1221) followed by RC4-encrypted command execution. Detection challenges arise because rootkits subvert the very tools used to find them; effective defense requires cross-verification of system state (e.g., comparing /proc listings with sysfs queries) and memory forensics using specialized tools like Volatility plugins that detect hooked function pointers or hidden modules.
Shared-Library Injection
Shared-library injection in Linux environments most commonly abuses the LD_PRELOAD mechanism, which specifies shared objects to load before all others when executing dynamically linked programs. Malware leverages this to intercept libc functions (such as execve, read, write, or readdir) and modify their behavior — hiding files, processes, or network connections; stealing credentials; or installing persistent backdoors. The Jynx rootkit exemplifies this technique by hooking over a dozen libc functions to conceal files and processes based on GID or magic strings, while providing an SSL-encrypted backdoor with password protection. Similarly, the Symbiote malware uses LD_PRELOAD to hook libc's read function for SSH session credential harvesting and PAM functions for authentication bypass.
Attackers typically gain the ability to modify LD_PRELOAD through prior compromise (e.g., via a backdoor or exploited vulnerability) that allows writing to /etc/ld.so.preload or injecting malicious shared objects into trusted library directories. Once active, the injected library runs with the privileges of the executed program, enabling privilege escalation if hooked programs run as root. Defensive strategies include monitoring for unexpected entries in /etc/ld.so.preload, verifying library integrity through package managers, and employing runtime protection that blocks unauthorized LD_PRELOAD modifications. Notably, LD_PRELOAD only affects dynamically linked programs; statically linked binaries and those executing via syscall remain unaffected, providing natural segmentation for critical utilities.
Container & Server Malware
Container and server malware targets Linux environments where workloads are increasingly orchestrated through platforms like Docker and Kubernetes, exploiting misconfigurations to establish footholds for cryptojacking, data theft, or future ransomware deployment. The primary infection vector is exposed Docker daemon APIs (typically TCP port 2375/2376) accessible without authentication, allowing attackers to instruct the Docker Engine to run malicious containers. Campaigns such as Graboid (the first cryptojacking worm observed spreading via Docker Hub in 2019) and Kinsing (active since 2020 with evolving TTPs) demonstrate worm-like propagation: scanning for exposed Docker APIs, deploying containers that download cryptominers and lateral movement tools, and maintaining persistence through cron jobs or startup scripts.
Beyond initial access, container malware often escalates to compromise the host filesystem by mounting bind mounts or abusing privileged containers. Kubernetes-specific threats include scanning for open kubelet API ports (10250) to deploy additional malware and forcing compromised nodes to join attacker-controlled clusters. Cryptojacking remains the dominant payload, with malware like the Dero miner worm autonomously propagating through exposed Docker APIs without requiring command-and-control infrastructure. Defenses center on securing container orchestration platforms: never exposing Docker daemon APIs to the internet without TLS and authentication, using Unix sockets or SSH for remote management, implementing network policies to restrict inter-container communication, and regularly scanning container images for known vulnerabilities and malicious content.
The Linux malware example, annotated
This document's working example demonstrates LD_PRELOAD-based shared-library injection for educational purposes only — it safely intercepts libc's execve function to log executed commands without modifying behavior, illustrating how malware could hide malicious executions. The example consists of two components: a malicious shared library that hooks execve via LD_PRELOAD, and a test program that executes commands to demonstrate the hook in action. Read against the design above, the logger records every execve call, showing how an attacker could monitor for sensitive commands like those used to download further payloads or establish persistence.
The example also highlights the limitations of LD_PRELOAD: it only affects dynamically linked programs executed after the library is loaded, and careful hooking is required to avoid crashing legitimate processes. In practice, malware would combine this technique with persistence mechanisms such as modifying /etc/ld.so.preload or installing malicious system services to ensure the injected library loads across reboots and user sessions. Detection approaches include monitoring for unexpected LD_PRELOAD entries, verifying the integrity of system libraries, and employing endpoint detection and response (EDR) solutions that library load anomalies.
Logger shared library — intercepts execve to log executed commands; compiles with -fPIC and -shared for LD_PRELOAD use.
/* logger.c: LD_PRELOAD shared library to log execve calls */
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <dlfcn.h>
static int (*real_execve)(const char *, char * const *, char * const *) = NULL;
void __attribute__((constructor)) init(void) {
real_execve = dlsym(RTLD_NEXT, "execve");
if (!real_execve) {
fprintf(stderr, "Error in `dlsym`: %s\n", dlerror());
exit(EXIT_FAILURE);
}
}
int execve(const char *filename, char * const *argv, char * const *envp) {
fprintf(stderr, "EXECVE LOG: %s with args: ", filename);
for (int i = 0; argv && argv[i]; i++) {
fprintf(stderr, "%s ", argv[i]);
}
fprintf(stderr, "\n");
return real_execve(filename, argv, envp);
}
Test program — executes commands to demonstrate the LD_PRELOAD hook; educational use only.
/* test.c: Simple program to exec shell commands */
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
if (argc < 2) {
fprintf(stderr, "Usage: %s [args...]\n", argv[0]);
return EXIT_FAILURE;
}
return execve(argv[1], &argv[1], NULL);
}
Comparative data and specs
The table below presents documented Linux malware families across four threat categories, highlighting key characteristics from public analyses and incident reports. Values reflect observed behaviors in real-world campaigns, with ranges indicating variation across samples or deployment contexts.
Interpretation reveals evolutionary trends in Linux malware sophistication. Early backdoors like Ebury (2009-present) focused on credential theft and service trojanization, while rootkits evolved from basic system call table hooking (Diamorphine, 2013) to advanced eBPF-based techniques (Umbra, 2021). Shared-library injection via LD_PRELOAD remains persistent due to its effectiveness and stealth, as seen in Jynx (2012) and Symbiote (2022). Container threats emerged with Docker API exposure, progressing from simple cryptominers (Graboid, 2019) to autonomous worms (Dero miner, 2025) that scan for vulnerabilities without command-and-control infrastructure. The steady progression indicates maturing tradecraft where attackers combine multiple techniques for comprehensive access: initial infection via backdoor or vulnerability, privilege escalation through kernel exploits or LD_PRELOAD abuse, persistence via service trojanization or kernel modules, and monetization through cryptojacking or data exfiltration.
Reading — the three documented container campaigns (Graboid, Kinsing, Dero) span five years of the record; the sources document their mechanics and scale, and the analyst derives magnitudes — this page carries only what the record states.
Family, technique, and the check that surfaces it — the same table read from the defensive side.
| Family | Technique | Check |
|---|---|---|
| Ebury | Trojanized OpenSSH and web modules | Package and binary integrity |
| Diamorphine, Suterusu, Umbra | Kernel hooking and hiding | Cross-view process comparison |
| Jynx, Symbiote | LD_PRELOAD interception | ld.so.preload and library-load audit |
| Graboid, Kinsing, Dero | Docker API abuse and cryptomining | Daemon exposure and image scanning |
# Group the families by where they hide
user space -> kernel -> loader -> container
Reading — the hiding place determines the check, so the family names matter less than the layer each one occupies.
Documented Linux malware families — the comparison table from the section above, given the full page width so every column stays readable.
| Malware Family | Type | Key Characteristics | Observed In |
|---|---|---|---|
| Ebury/Windigo | Backdoor/Trojanized Service | Credential theft, OpenSSH/Apache/Nginx trojans, Helimod modules | 2009-present |
| Diamorphine | Kernel Rootkit | System call table hooking, process hiding, LPE | 2013 |
| Jynx | LD_PRELOAD Rootkit | Libc function hiding, SSL backdoor, netstat evasion | 2012 |
| Suterusu | Kernel Rootkit | Inline function hooking, x86/ARM support, procfs hiding | 2013 |
| Symbiote | LD_PRELOAD Backdoor | SSH credential harvesting, PAM bypass, libpcap hooking | 2022 |
| Umbra | Kernel Rootkit (eBPF) | Netfilter backdoor, ftrace/eBPF hiding, LPE | 2021 |
| Graboid | Container Worm | Docker Hub propagation, Monero mining, Docker API scanning | 2019 |
| Kinsing | Container Malware | Docker API exploitation, cryptominer, SSH lateral movement | 2020-present |
| Dero Miner Worm | Autonomous Container Worm | Docker API scanning, Dero cryptocurrency mining, no C2 | 2025 |
Documented Linux malware families with observed characteristics from public analyses.
Actionable steps for analysts
-
Monitor library loading anomalies
Deploy endpoint detection that monitors for unexpected LD_PRELOAD entries in /etc/ld.so.preload and anomalous shared library loads in process memory. Legitimate LD_PRELOAD usage is rare in production environments; sudden appearances often indicate compromise. Combine with file integrity monitoring to detect unauthorized modifications to system library directories.
-
Secure container orchestration platforms
Never expose Docker daemon APIs (TCP 2375/2376) to the internet without mutual TLS authentication. Use Unix sockets or SSH for remote container management. Implement network policies to restrict inter-container communication and prevent lateral movement. Regularly scan container images for vulnerabilities and malicious content using tools like Trivy or Clair.
-
Verify service integrity and authenticity
Employ cryptographic signing and verification for critical system services (e.g., OpenSSH, Apache, Nginx) to detect trojanized binaries. Utilize tools like Tripwire or AIDE to monitor for unauthorized modifications to service binaries and configuration files. Cross-check service version strings against package manager records to identify discrepancies indicating compromise.
-
Employ cross-view detection for rootkits
Use cross-view comparisons to detect kernel-level concealment: compare process lists from /proc with those obtained via direct sysfs queries (/sys/class/...) or through instrumentation tools like eBPF. Discrepancies between views often indicate hooking or hiding techniques. Memory forensics with specialized Volatility plugins (linux_check_fop, linux_check_syscall) remains effective against known rootkit techniques.
-
Conduct regular credential rotation and monitoring
Assume SSH credentials are compromised on any Linux system showing anomalous behavior. Rotate SSH keys and passwords periodically, especially for privileged accounts. Monitor authentication logs for impossible travel or unusual geographic locations. Deploy honeytoken credentials that trigger alerts when used, indicating potential credential theft via backdoors like Ebury.
Where each check looks — the five steps arranged by the Linux layer they inspect.
| Check | Layer inspected | Signal |
|---|---|---|
| Library loading | Loader and preload path | Unexpected ld.so.preload entry |
| Container orchestration | Docker and Kubernetes | Exposed daemon API on 2375/2376 |
| Service integrity | Binaries and packages | Mismatch with package-manager records |
| Cross-view detection | Kernel and procfs | Disagreement between process lists |
| Credential rotation | Accounts and logs | Honeytoken use; impossible travel |
# First look
cat /etc/ld.so.preload; ls /sys/class; ss -lntp
Reading — the first and fourth checks catch concealment, while the second, third, and fifth catch the accessible paths an operator uses before hiding.
Additional context — the evolving Linux threat landscape
The Linux malware threat landscape continues to evolve alongside the operating system's expanding role in cloud-native architectures and edge computing. While traditional server malware remains prevalent, increasing attention is turning to specialized threats targeting container runtimes, serverless functions, and IoT gateways running Linux variants. Notably, the convergence of techniques seen in Windows malware — such as process injection, code signing bypasses, and living-off-the-land binaries (LOLBAS) — is appearing in Linux threats through equivalent mechanisms like LD_PRELOAD abuse, signed kernel module loading, and exploitation of legitimate Linux utilities.
Regulatory and industry responses reflect this evolution: frameworks like NIST's Secure Software Development Framework (SSDF) and the EU's Cyber Resilience Act now explicitly address supply chain risks in open-source components, including shared libraries and container images. The shift toward software bills of materials (BOMs) and provenance tracking (e.g., SLSA, Sigstore) aims to mitigate risks from compromised build pipelines — a growing concern after incidents like the XZ Utils backdoor (CVE-2024-3094) demonstrated how trusted compression libraries could be weaponized. For defenders, staying current requires monitoring not only for established malware families but also for novel combinations of techniques that leverage Linux's extensibility against itself.
Where the Linux threat is moving — the section's trends, paired with the Linux mechanism each one resembles.
| Trend | Linux mechanism | Defensive focus |
|---|---|---|
| Container and serverless targets | Runtime and orchestration APIs | Configuration and image integrity |
| Living-off-the-land tradecraft | LD_PRELOAD and legitimate utilities | Behavioral command-line analysis |
| Signed module abuse | Kernel module loading | Signature and provenance control |
| Supply-chain compromise | Shared libraries and build pipelines | SBOM and provenance tracking |
Reading — the trends are not new techniques so much as Windows tradecraft translated into Linux mechanisms, which is why the same behavioral controls carry over.
The standards named in the text — what each one asks for, and the risk it addresses.
| Framework | Asks for | Addresses |
|---|---|---|
| NIST SSDF | Secure development practices | Build and dependency risk |
| EU Cyber Resilience Act | Supply-chain security obligations | Open-source components |
| SBOM | A complete component inventory | Unknown dependencies |
| SLSA and Sigstore | Build provenance and signing | Compromised build pipelines |
# Supply-chain question
can I name and verify every library in this build?
Reading — the XZ Utils backdoor is the text's illustration of why these controls matter: a trusted compression library became the attack surface.
Quick reference — the rules at a glance
Linux malware on this page hides at four layers. Backdoors and trojanized services live in user space, where a modified OpenSSH client or Apache module keeps serving legitimate requests while stealing credentials. Rootkits live in the kernel, where they hide processes, files, and connections from the very tools an administrator would use to look. Shared-library injection lives in the loader, where LD_PRELOAD or ld.so.preload makes every dynamically linked program load the attacker's code first. Container and server malware lives in orchestration, where an exposed Docker daemon turns a misconfiguration into a cryptomining worm.
The defensive rule follows the layer. For user space, verify binaries against package records. For the kernel, do not trust the live system's own reports; compare views and examine memory offline. For the loader, watch the preload path and library loads. For containers, close the daemon API, scan images, and restrict inter-container traffic. Credentials cut across all four: assume SSH keys are compromised on any host that behaves anomalously.
The emerging picture adds supply chain to the list. Shared libraries and build pipelines are now targets in their own right, which is why software bills of materials and provenance tracking appear alongside the older controls.
Layer, technique, and control — the page's four hiding places with the check that reaches each one.
| Layer | Technique | Control |
|---|---|---|
| User space | Trojanized services | Package and binary integrity |
| Kernel | Rootkit hooking | Cross-view and memory analysis |
| Loader | LD_PRELOAD injection | Preload-path and library audit |
| Orchestration | Docker API abuse | Authenticated API and image scanning |
| Supply chain | Compromised libraries | SBOM and provenance tracking |
Each layer needs its own check because a rootkit can falsify the evidence used at the layer above it.
Failure modes and their warning signs — the shortcuts that leave a layer unwatched.
| Failure mode | Warning sign | Response |
|---|---|---|
| Trusting live process lists | Disagreement with sysfs | Memory or offline examination |
| Exposed Docker API | Port 2375 or 2376 reachable | Close it or enforce mutual TLS |
| Unchecked preload | Unexpected ld.so.preload entry | Audit and remove |
| Stale SSH keys | Old keys still authorized | Rotate and use honeytokens |
# Coverage rule
verify binaries, distrust the kernel, watch the loader, close the daemon
The four checks map one-to-one onto the four layers, so a host that passes all four has no unwatched hiding place from this page's record.
- CISA Linux Security Guidance
- MITRE ATT&CK® Technique T1574: Hijack Execution Flow
- MITRE ATT&CK® Technique T1059: Command and Scripting Interpreter
- MITRE ATTACK® Technique T1078: Valid Accounts
- MITRE ATTACK® Technique T1190: Exploit Public-Facing Application
- MITRE ATTACK® Software S0446: Ryuk
- MITRE ATTACK® Software S0575: Conti
- ESET: An in-depth analysis of Linux/Ebury
- Unit 42: Graboid: First-Ever Cryptojacking Worm Found in Images on Docker Hub
- Aqua Security: Threat Alert: Kinsing Malware Attacks Targeting Container Environments
- Figure source: Suricata IDS/IPS interface (Wikimedia Commons)
- Figure source: Damn Vulnerable Linux screenshot (Wikimedia Commons)
- Figure source: Linux kernel architecture diagram (Wikimedia Commons)
- Figure source: ELF file format structure (Wikimedia Commons)
- Figure source: Docker logo (Wikimedia Commons)