LINUX
AUDITD
CRON
CHMOD
DetectionBlue TeamSOCOctober 12, 2026•9 min read

Detecting Linux Ransomware: auditd, Cron and Mass Encryption

Linux servers hold the databases and file stores attackers want, and few run an EDR. A small set of auditd rules goes a long way.

Scroll

Ransomware on Linux targets file servers, web and application hosts, and hypervisors. The binary is often a small compiled encryptor that walks directories such as /home, /var, /srv and /opt, or a mount point supplied by the operator, then writes a note. The first step is usually unremarkable shell activity, so we cover the endpoint with auditd and watch the behaviours that give the encryptor away.

Signals at a Glance

SignalWhereATT&CK
One process renaming or rewriting thousands of files under /home, /var or /srvauditd, eBPF sensorT1486
Recursive chmod or chown sweeps across data directoriesauditd execveT1222.002
New cron, at or systemd timer entry running a binary from /tmp or /dev/shmauditd file watchesT1053.003
ELF binary executed from /tmp, /var/tmp or /dev/shmauditd execve, EDRT1059.004
Database or service stopped before the burstsystemd journal, auditdT1489
Backups or snapshots deletedProcess creation, storage logsT1490

auditd Coverage

These rules log the building blocks: execution from world-writable directories, changes to the scheduling mechanisms, and permission changes. Bulk rename volume is better computed from your EDR or a file-integrity tool than from raw auditd, which can be heavy on busy hosts, so scope file watches to directories with data worth protecting:

# /etc/audit/rules.d/ransomware.rules  (tune/validate before production)
# Execution from world-writable locations
-a always,exit -F arch=b64 -S execve -F dir=/tmp -k exec_tmp
-a always,exit -F arch=b64 -S execve -F dir=/var/tmp -k exec_tmp
-a always,exit -F arch=b64 -S execve -F dir=/dev/shm -k exec_tmp

# Scheduling persistence
-w /etc/crontab -p wa -k cron_change
-w /etc/cron.d/ -p wa -k cron_change
-w /var/spool/cron/ -p wa -k cron_change
-w /etc/systemd/system/ -p wa -k systemd_change

# Mass permission changes
-a always,exit -F arch=b64 -S chmod,fchmod,fchmodat,chown,fchownat -F auid>=1000 -F auid!=4294967295 -k perm_change

# Ransom-note style file creation in data directories (narrow to your paths)
-w /srv/ -p w -k data_write

Ship these events to your SIEM, and alert when perm_change or data_write keys spike for one process, or when a binary executed from the exec_tmp key then produces a flood of file events:

index=linux sourcetype=linux_audit key="perm_change" OR key="data_write" OR key="exec_tmp"
| bin _time span=5m
| stats count by host, exe, key, _time
| eventstats sum(count) as total by host, exe, _time
| where total > 500
| sort - total
# tune/validate: thresholds vary hugely by host role; start in report-only mode.

Process and Network Context

Vetted sources

Use the Linux auditd rule sets maintained by the community, SigmaHQ Linux rules, Elastic Linux endpoint rules, MITRE CAR analytics and CISA #StopRansomware advisories on Linux-targeting families. Baseline your own backup and rotation jobs before alerting on bulk file activity.

Build Detections That Fire

Mjolnir Security helps blue teams turn threat intelligence into high-fidelity detections across endpoint, network, identity and cloud telemetry.

Detection EngineeringManaged Detection & ResponseThreat HuntingIncident ResponsePurple Teaming
  • Detection Engineering We build and tune detections mapped to ATT&CK from your own telemetry.
  • Threat Hunting as a Service Hypothesis-driven hunts for the behaviours on this page.
  • 24/7 Incident Response Containment when a detection fires. Call +1 833 403 5875.
Written by: Mjolnir Threat Research (MTAC)  |  Published: October 12, 2026  |  Last reviewed: October 12, 2026