Adversaries may abuse the cron
utility to perform task scheduling for initial or recurring execution of malicious code.[1] 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. Any crontab
files are stored in operating system-specific file paths.
An adversary may use cron
in Linux or Unix environments to execute programs at system startup or on a scheduled basis for persistence.
ID | Name | Description |
---|---|---|
S0504 | Anchor | |
G0082 | APT38 |
APT38 has used cron to create pre-scheduled and periodic background jobs on a Linux system.[3] |
S0401 | Exaramel for Linux |
Exaramel for Linux uses crontab for persistence if it does not have root privileges.[4][5] |
S0163 | Janicab | |
S0599 | Kinsing |
Kinsing has used crontab to download and run shell scripts every minute to ensure persistence.[7] |
S0198 | NETWIRE | |
S0587 | Penquin |
Penquin can use Cron to create periodic and pre-scheduled background jobs.[9] |
G0106 | Rocke |
Rocke installed a cron job that downloaded and executed files from the C2.[10][11][12] |
S0468 | Skidmap | |
S0374 | SpeakUp | |
S0341 | Xbash |
Xbash can create a cronjob for persistence if it determines it is on a Linux system.[15] |
ID | Mitigation | Description |
---|---|---|
M1047 | Audit |
Review changes to the |
M1018 | User Account Management |
|
ID | Data Source | Data Component |
---|---|---|
DS0017 | Command | Command Execution |
DS0022 | File | File Modification |
DS0009 | Process | Process Creation |
DS0003 | Scheduled Job | Scheduled Job Creation |
Monitor scheduled task creation from common utilities using command-line invocation. Legitimate scheduled tasks may be created during installation of new software or through system administration functions. Look for changes to tasks that do not correlate with known software, patch cycles, etc.
Suspicious program execution through scheduled tasks may show up as outlier processes that have not been seen before when compared against historical data. Data and events should not be viewed in isolation, but as part of a chain of behavior that could lead to other activities, such as network connections made for Command and Control, learning details about the environment through Discovery, and Lateral Movement.