Scheduled Task Created or Deleted via Command Line
Detection of scheduled task creation or deletion via command-line, often used for persistence and privilege escalation by threat actors.
This brief focuses on the detection of scheduled task creation or deletion events triggered through command-line interfaces on Windows systems. While the provided document lacks specific details on a particular threat actor or campaign, the technique of creating and deleting scheduled tasks programmatically is a common tactic used by various threat actors for persistence, privilege escalation, and lateral movement. Attackers often leverage tools like schtasks.exe to automate malicious activities. Monitoring for these actions is crucial for detecting suspicious behavior, even without specific threat intelligence context. This generic but important technique helps identify anomalous system administration activities that could lead to further compromise.
Attack Chain
- Attacker gains initial access through an exploit or compromised credentials.
- Attacker uses
cmd.exeor PowerShell to execute commands. - The attacker utilizes
schtasks.exeto create a new scheduled task. - The scheduled task is configured to execute a malicious payload at a specific time or event.
- The malicious payload executes with the privileges of the account under which the task runs.
- The attacker may use the scheduled task to establish persistence on the system.
- The attacker may delete the task after execution to remove evidence.
- The attacker achieves their objective, which could include data theft, malware installation, or system compromise.
Impact
Successful exploitation could lead to persistent access within the environment. Attackers can use the scheduled tasks to execute malicious commands repeatedly, bypass security measures, and maintain control over the compromised system. This can result in data breaches, system instability, and significant operational disruption. If an attacker gains SYSTEM privileges through a scheduled task, they could compromise the entire domain.
Recommendation
- Enable process creation logging, specifically monitoring for
schtasks.exeexecution, to activate the rules below. - Deploy the Sigma rules in this brief to your SIEM to detect suspicious scheduled task activity.
Detection coverage 2
Scheduled Task Creation via Command Line
mediumDetects the creation of scheduled tasks using schtasks.exe via command line.
Scheduled Task Deletion via Command Line
lowDetects the deletion of scheduled tasks using schtasks.exe via command line.
Detection queries are available on the platform. Get full rules →