MITRE ATT&CK · T1053.005

Scheduled Task

MITRE · cited in 8 of our lessons

Explanation

What attackers do. Attackers create or modify Windows scheduled tasks to run malicious code at startup, at logon or on a timer, locally or on remote hosts. This serves Execution, Persistence and Privilege Escalation.

How to defend. Restrict who can create scheduled tasks, particularly remotely, and collect task creation and modification events from the security and task scheduler logs. Baseline the tasks normally present on your systems. Endpoint detection should flag tasks that run scripts or binaries from user-writable locations.

Signs to look for. Look for new tasks with random or system-like names, tasks running interpreters or encoded commands, tasks created remotely, and hidden tasks. A common gap is software that creates many legitimate tasks, hiding new malicious ones in the noise.

The official text
Adversaries may abuse the Windows Task Scheduler to perform task scheduling for initial or recurring execution of malicious code. There are multiple ways to access the Task Scheduler in Windows. The schtasks utility can be run directly on the command line, or the Task Scheduler can be opened through the GUI within the Administrator Tools section of the Control Panel. In some cases, adversaries have used a .NET wrapper for the Windows Task Scheduler, and alternatively, adversaries have used the Windows netapi32 library and Windows Management Instrumentation (WMI) to create a scheduled task. Adversaries may also utilize the Powershell Cmdlet `Invoke-CimMethod`, which leverages WMI class `PS_ScheduledTask` to create a scheduled task via an XML path. An adversary may use Windows Task Scheduler to execute programs at system startup or on a scheduled basis for persistence. The Windows Task Scheduler can also be abused to conduct remote Execution as part of Lateral Movement and/or to run a process under the context of a specified account (such as SYSTEM). Similar to System Binary Proxy Execution, adversaries have also abused the Windows Task Scheduler to potentially mask one-time execution under signed/trusted system processes. Adversaries may also create "hidden" scheduled tasks (i.e. Hide Artifacts) that may not be visible to defender tools and manual queries used to enumerate tasks. Specifically, an adversary may hide a task from `schtasks /query` and the Task Scheduler by deleting the associated Security Descriptor (SD) registry value (where deletion of this value must be completed using SYSTEM permissions). Adversaries may also employ alternate methods to hide tasks, such as altering the metadata (e.g., `Index` value) within associated registry keys.

© The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation (MITRE ATT&CK®).

Lessons that cite it

Real incidents where this item mattered.