Detect Cron in CrowdStrike LogScale
Adversaries may abuse the cron utility to perform task scheduling for initial or recurring execution of malicious code. The cron utility is a time-based job scheduler for Unix-like operating systems. The crontab file contains the schedule of cron entries to be run and the specified times for execution. Adversaries use cron in Linux, macOS, and ESXi environments to execute programs at system startup or on a scheduled basis for persistence, privilege escalation, or execution. Real-world malware families including Kinsing, Skidmap, GoldMax, NKAbuse, Rocke, and Anchor have all leveraged cron for persistence. In ESXi environments, cron jobs must be created directly via the crontab file (e.g., /var/spool/cron/crontabs/root).
MITRE ATT&CK
- Technique
- T1053 Scheduled Task/Job
- Sub-technique
- T1053.003 Cron
- Canonical reference
- https://attack.mitre.org/techniques/T1053/003/
LogScale Detection Query
// T1053.003 - Cron Persistence Detection
// Pattern 1: crontab process execution with suspicious indicators
#event_simpleName = ProcessRollup2
| CommandLine = /(?i)crontab/
| CommandLine = /(?i)(wget|curl|nc\s|ncat|netcat|\/dev\/tcp|base64\s+-d|openssl\s+enc|bash\s+-i|python\s+-c|perl\s+-e|\/tmp\/|\/dev\/shm\/|chmod\s+\+x|chmod\s+777|\.sh|@reboot)/
| groupBy([aid, ComputerName, UserName, FileName, CommandLine, ParentBaseFileName, ParentCommandLine], function=count(aid, as=event_count))
| sort(event_count, order=desc)
// Pattern 2: file writes to cron directories from suspicious parent processes
// (Run as separate query or union)
#event_simpleName = SyntheticProcessRollup2 OR #event_simpleName = ProcessRollup2
| TargetFileName = /(?i)(\/etc\/crontab|\/var\/spool\/cron|\/etc\/cron\.d\/|\/etc\/cron\.(daily|hourly|weekly|monthly)|\/var\/cron\/tabs)/
| NOT FileName IN ["dpkg", "apt", "apt-get", "yum", "rpm", "ansible", "puppet", "chef-client"]
| eval cron_path = TargetFileName
| eval has_tmp_write = if(TargetFileName = /\/tmp\/|\/dev\/shm\//, "true", "false")
| eval is_crontab_cmd = if(FileName = "crontab", "true", "false")
| eval has_download_tool = if(CommandLine = /wget|curl|\/dev\/tcp|base64\s+-d/, "true", "false")
| eval has_shell_payload = if(CommandLine = /bash\s+-i|python\s+-c|perl\s+-e|sh\s+-c/, "true", "false")
| eval suspicion_score =
if(is_crontab_cmd = "true", 1, 0) +
if(has_download_tool = "true", 1, 0) +
if(has_shell_payload = "true", 1, 0) +
if(has_tmp_write = "true", 1, 0)
| where suspicion_score > 0
| eval risk_level = if(suspicion_score >= 3, "CRITICAL",
if(suspicion_score >= 2, "HIGH",
if(suspicion_score >= 1, "MEDIUM", "LOW")))
| table([timestamp, ComputerName, UserName, FileName, CommandLine, ParentBaseFileName, cron_path, has_download_tool, has_shell_payload, suspicion_score, risk_level])
| sort(suspicion_score, order=desc) Detects T1053.003 cron persistence in CrowdStrike Falcon LogScale via two correlated patterns: (1) ProcessRollup2 events where the command line references crontab combined with suspicious payload indicators (download tools, reverse shells, temp paths, chmod), and (2) file writes targeting cron directories from processes that are not known package managers. Applies a suspicion scoring model and risk classification. Covers Linux and macOS hosts reporting to Falcon.
Data Sources
Required Tables
False Positives & Tuning
- Legitimate DevOps engineers running crontab -e interactively on Linux servers during scheduled maintenance windows
- Automated provisioning scripts executed by cloud-init or userdata on newly launched Linux instances that configure application cron jobs
- Monitoring and observability agents that use cron scheduling for metric collection and may reference paths in /tmp/ for temporary data storage
Other platforms for T1053.003
Testing Methodology
Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Add Persistent Cron Job via crontab Command
Expected signal: Auditd: syscall write/open on /var/spool/cron/crontabs/<username>. Syslog/cron log: CMD (/tmp/argus_test.sh) entries every minute. Process creation event for crontab command. File creation event for /tmp/argus_test.sh.
- Test 2Add @reboot Persistence Entry to Crontab
Expected signal: Auditd: write to /var/spool/cron/crontabs/<username> with @reboot content. Syslog: crontab modification event. Process creation for crontab command. File creation for /tmp/argus_backdoor_test.sh with chmod +x.
- Test 3Direct Write to /etc/cron.d/ for System-Wide Persistence
Expected signal: Auditd: file creation syscall on /etc/cron.d/argus-test-job. File creation event with initiating process bash/sudo. Syslog: within 5 minutes, CRON execution of curl command will appear in /var/log/cron or /var/log/syslog.
- Test 4Cron Job with Base64-Encoded Payload Download
Expected signal: File creation event on /etc/cron.d/argus-encoded-test. Cron execution logs showing base64 and bash commands. If wget succeeds (requires listener), process creation for wget and the payload. Auditd syscall records for file write.
References (13)
- https://attack.mitre.org/techniques/T1053/003/
- https://www.cloudsek.com/blog/analysis-of-files-used-in-esxiargs-ransomware-attack-against-vmware-esxi-servers
- https://labs.sentinelone.com/20-common-tools-techniques-used-by-macos-threat-actors-malware/
- https://research.checkpoint.com/2019/speakup-a-new-undetected-backdoor-linux-threat/
- https://blog.aquasec.com/threat-alert-kinsing-malware-container
- https://www.trendmicro.com/en_us/research/19/i/skidmap-linux-malware-uses-rootkit-capabilities-to-hide-cryptocurrency-mining-payload.html
- https://blog.talosintelligence.com/2018/08/rocke-champion-of-monero-miners.html
- https://www.crowdstrike.com/blog/carbon-spider-skeleton-spider-target-esxi-servers-with-novel-ransomware/
- https://www.welivesecurity.com/2022/01/11/signed-sealed-delivered-securing-operational-technology/
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1053.003/T1053.003.md
- https://github.com/SigmaHQ/sigma/tree/master/rules/linux/auditd
- https://linux.die.net/man/5/crontab
- https://www.sans.org/white-papers/1693/
Unlock Pro Content
Get the full detection package for T1053.003 including response playbook, investigation guide, and atomic red team tests.