Detect it by monitoring changes to user and system crontabs, cron directories, and related service files, especially when modified by unexpected shells or temporary scripts. Compare scheduled tasks against a baseline and review for unusual execution times, new downloaders, or commands that start on reboot or periodically. Correlate with newly created files, privilege changes, and outbound connections.
What makes crontab persistence visible on Linux?
Crontab persistence becomes visible when scheduled execution changes diverge from the host’s normal job profile. The highest-signal indicators are new or altered user crontabs, system crontabs, or files under cron directories, especially when they point to unexpected shells, temporary paths, or one-shot scripts that re-create themselves.
Because cron is a legitimate automation path, the key is not the presence of scheduled work but the pattern of change. A persistent implant often arrives as a small edit that re-establishes execution after reboot, after logon, or on a recurring timer, so a baseline comparison is more useful than a raw list of jobs.
Which cron-related changes deserve the most attention?
Focus first on the places cron can actually consume: per-user crontabs, cron job persistence, and cron service files or directories where entries are stored and loaded. Changes in those locations are more meaningful than generic file churn because they can directly translate into recurring execution.
Look for jobs that call out to curl, wget, bash, sh, python, perl, or opaque scripts in writable paths, because those are common ways to stage or restore persistence. Also review unusual execution times, especially jobs that run very frequently, at system startup, or at odd intervals that do not match operational maintenance windows.
New cron entries are not the only clue. Unexpected modification times, ownership changes, permission drift, or a job that appears to be copied from a temporary directory can all indicate that an attacker is using cron as a re-entry mechanism rather than as a normal scheduler.
How should detection be operationalised without drowning in noise?
The most reliable pattern is to combine file monitoring, periodic configuration review, and execution correlation. A direct watch on crontab files and cron directories catches change events, while diffing against a known-good baseline tells you whether the scheduled task itself is new, altered, or simply rewritten in a different form.
That review should be paired with host telemetry so the job can be tied to process creation, newly dropped files, privilege changes, and outbound connections. If a cron change is followed by a downloader, privilege escalation, or an external callback, the cron entry is likely part of a persistence chain rather than a harmless maintenance task.
For Linux estates, a good approach is to standardise what “normal” looks like per host role. Build servers, jump hosts, database servers, and workstations often have very different cron profiles, so the same job may be expected in one environment and suspicious in another.
Risk and Threat Considerations
Crontab persistence is risky because it is simple, durable, and easy to hide inside expected automation. Attackers use it to regain execution after reboot or process termination, and defenders often miss it when they monitor only binaries and not scheduled execution surfaces.
Failure mechanism: A malicious actor with write access to a crontab, cron directory, or related service file can schedule a command that repeatedly restores malware, downloads payloads, or re-establishes access after cleanup.
Impact: The host may appear remediated while the persistence mechanism silently reintroduces the intrusion, extending dwell time and increasing the chance of lateral movement or credential theft.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
MITRE ATT&CK addresses the attack and risk surface, while CIS Controls v8 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| MITRE ATT&CK | T1053.003 — Scheduled Task/Job: Cron | Cron persistence is an ATT&CK scheduled-job technique on Linux. |
| Recommendation — Hunt for T1053.003 activity and validate every unexpected cron entry against host baselines. | ||
| CIS Controls v8 | CIS-8 — Audit Log Management | Change detection for cron persistence depends on logs and monitored file activity. |
| Recommendation — Centralise and review cron-related file and process telemetry to spot unauthorized persistence. | ||
| NIST SP 800-53 Rev 5 | AU-2 — Event Logging | Cron persistence detection relies on logging scheduled task changes and related execution events. |
| CM-5 — Access Restrictions for Change | Restrict who can modify cron jobs and service files that enable persistence. | |
| SI-4 — System Monitoring | Host monitoring is needed to detect suspicious cron modifications and their effects. | |
| Recommendation — Log cron file changes, job execution, and related process activity for review and correlation. Limit cron and cron-directory changes to approved administrators and change paths. Monitor cron-related file changes and correlate them with process, file, and network activity. | ||
Practitioner Guidance
What to verify: Confirm that every scheduled task has an owner, a business justification, and a predictable path to its script or binary. Anything launched from writable locations, temporary directories, or user-controlled profiles should be treated as suspicious until proven otherwise.
Decision rule: If a cron change is paired with a new downloader, a new privileged process, or an unexplained outbound connection, prioritise containment and persistence removal before spending time on cosmetic changes in the job name or schedule.
Practitioner takeaway: Treat cron as a durable execution surface, not just a scheduler, and validate it by behaviour over time, not by whether the entry looks routine in isolation.
Related resources from NHI Mgmt Group
- How do you detect malicious Kubernetes CronJobs used for persistence?
- How do you detect Outlook forms and home page persistence used by attackers?
- Why do secrets stay dangerous even when they are no longer actively used?
- How should security teams detect Linux malware that uses masquerading, persistence, and kernel rootkits instead of relying only on hashes?
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on October 20, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org