Skip to content
WETNav

Persistence · Windows

schtasks.exe

Scheduled Tasks command line

Creates, queries, runs and deletes scheduled tasks, locally or on a remote host. Tasks are a very common persistence and remote execution method, so creation and run are high-value to triage.

Legitimate use

Admins and installers use it to schedule maintenance and background jobs.

Worst caseHigh

Switches

/create

Creates a new scheduled task.

Medium
/delete

Deletes a task. Deleting a defender or logging task can be evasion.

Medium
/run

Runs a task immediately.

Medium
/change

Changes an existing task, for example its action or run-as account.

Medium
/query

Lists tasks. Used for discovery of existing persistence.

Low
/tn<value>

Task name. Names that imitate Windows tasks are a red flag.

Low
/tr<value>

Task action: the program and arguments the task runs.

High
/sc<value>

Schedule type, for example onlogon, onstart, minute or once.

Low
/ru<value>

Run-as account. SYSTEM gives the task SYSTEM privileges.

High
/rp<value>

Password for the run-as account, in clear text.

High
/s<value>

Target computer. A remote target means remote task creation.

Medium
/u<value>

Account for the remote connection.

Medium
/p<value>

Password for the remote connection, in clear text.

Medium
/xml<value>

Creates the task from an XML definition file.

Medium

Command lines to worry about

  • High

    Task created to run as SYSTEM

    A new task set to run as SYSTEM gives persistence with the highest privileges. Check the /tr action and the task name.

    Detection regexschtasks(\.exe)?\s+.*\/create\b.*\/ru\s+"?(system|nt authority\\system)"?

    T1053.005

  • High

    Remote scheduled task creation

    A task is created on another computer. This is a lateral movement and remote execution method. Check the target and the account.

    Detection regexschtasks(\.exe)?\s+.*\/create\b.*\/s\s+\S+

    T1053.005T1021.002

  • High

    Task action runs a script host or payload

    The task's action launches a shell, script host or a binary from a writable path. Treat as likely persistence.

    Detection regexschtasks(\.exe)?\s+.*\/create\b.*\/tr\s+"?[^"]*(powershell|cmd|rundll32|mshta|wscript|cscript|regsvr32|\\temp\\|\\appdata\\)

    T1053.005

Where it is recorded

  • Security4688Process creation with the full command line, when command-line auditing is enabled.
  • Sysmon1Process creation with command line, hashes and parent process.
  • Security4698A scheduled task was created, with the task name and the XML definition that holds the action.
  • Security4702A scheduled task was updated.
  • Security4699A scheduled task was deleted.
  • Task Scheduler106Task registered, in the Task Scheduler operational log.
  • Task Scheduler200Task action started, confirming what the task ran.

Community detections

44 SigmaHQ rules for schtasks.exe. The explainer checks every pasted command line against all of them.

  • High
    Delete All Scheduled Tasks

    Detects the usage of schtasks with the delete flag and the asterisk symbol to delete all tasks from the schedule of the local computer, including tasks scheduled by other users.

    T1489by Nasreddine Bencherchali (Nextron Systems)

  • High
    Delete Important Scheduled Task

    Detects when adversaries stop services or processes by deleting their respective scheduled tasks in order to conduct data destructive activities

    T1489by Nasreddine Bencherchali (Nextron Systems)

  • High
    Disable Important Scheduled Task

    Detects when adversaries stop services or processes by disabling their respective scheduled tasks in order to conduct data destructive activities

    T1489by frack113, Nasreddine Bencherchali (Nextron Systems), X__Junior

  • High
    Execution via stordiag.exe

    Detects the use of stordiag.exe to execute schtasks.exe systeminfo.exe and fltmc.exe

    T1218by Austin Songer (@austinsonger)

  • High
    HackTool - Default PowerSploit/Empire Scheduled Task Creation

    Detects the creation of a schtask via PowerSploit or Empire Default Configuration.

    T1053.005T1059.001by Markus Neis, @Karneades

  • High
    HTML Help HH.EXE Suspicious Child Process

    Detects a suspicious child process of a Microsoft HTML Help (HH.exe)

    T1047T1059.001T1059.003T1059.005by Maxim Pavlunin, Nasreddine Bencherchali (Nextron Systems)

  • High
    Potential Process Injection Via Msra.EXE

    Detects potential process injection via Microsoft Remote Asssistance (Msra.exe) by looking at suspicious child processes spawned from the aforementioned process. It has been a target used by many threat actors and used for discovery and persistence tactics

    T1055by Alexander McDonald

  • High
    Potential SSH Tunnel Persistence Install Using A Scheduled Task

    Detects the creation of new scheduled tasks via commandline, using Schtasks.exe. This rule detects tasks creating that call OpenSSH, which may indicate the creation of reverse SSH tunnel to the attacker's server.

    T1053.005by Rory Duncan

  • High
    Potentially Suspicious Child Process Of Regsvr32

    Detects potentially suspicious child processes of "regsvr32.exe".

    T1218.010by elhoim, Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems)

  • High
    Renamed Schtasks Execution

    Detects the execution of renamed schtasks.exe binary, which is a legitimate Windows utility used for scheduling tasks. One of the very common persistence techniques is schedule malicious tasks using schtasks.exe. Since, it is heavily abused, it is also heavily monitored by security products. To evade detection, threat actors may rename the schtasks.exe binary to schedule their malicious tasks.

    T1036.003T1053.005by Swachchhanda Shrawan Poudel (Nextron Systems)

  • High
    Scheduled Task Creation Masquerading as System Processes

    Detects the creation of scheduled tasks that involve system processes, which may indicate malicious actors masquerading as or abusing these processes to execute payloads or maintain persistence.

    T1053.005T1036.004T1036.005by Swachchhanda Shrawan Poudel (Nextron Systems)

  • High
    Scheduled Task Executing Encoded Payload from Registry

    Detects the creation of a schtask that potentially executes a base64 encoded payload stored in the Windows Registry using PowerShell.

    T1053.005T1059.001by pH-T (Nextron Systems), @Kostastsale, TheDFIRReport, X__Junior (Nextron Systems), Nasreddine Bencherchali (Nextron Systems)

  • High
    Schtasks Creation Or Modification With SYSTEM Privileges

    Detects the creation or update of a scheduled task to run with "NT AUTHORITY\SYSTEM" privileges

    T1053.005by Nasreddine Bencherchali (Nextron Systems)

  • High
    Schtasks From Suspicious Folders

    Detects scheduled task creations that have suspicious action command and folder combinations

    T1053.005by Florian Roth (Nextron Systems)

  • High
    Script Event Consumer Spawning Process

    Detects a suspicious child process of Script Event Consumer (scrcons.exe).

    T1047by Sittikorn S

  • High
    Suspicious BitLocker Access Agent Update Utility Execution

    Detects the execution of the BitLocker Access Agent Update Utility (baaupdate.exe) which is not a common parent process for other processes. Suspicious child processes spawned by baaupdate.exe could indicate an attempt at lateral movement via BitLocker DCOM & COM Hijacking.

    T1218T1021.003by andrewdanis, Swachchhanda Shrawan Poudel (Nextron Systems)

  • High
    Suspicious Child Process Of Manage Engine ServiceDesk

    Detects suspicious child processes of the "Manage Engine ServiceDesk Plus" Java web service

    T1102by Florian Roth (Nextron Systems)

  • High
    Suspicious Command Patterns In Scheduled Task Creation

    Detects scheduled task creation using "schtasks" that contain potentially suspicious or uncommon commands

    T1053.005by Florian Roth (Nextron Systems)

  • High
    Suspicious Microsoft Office Child Process

    Detects a suspicious process spawning from one of the Microsoft Office suite products (Word, Excel, PowerPoint, Publisher, Visio, etc.)

    T1047T1204.002T1218.010by Florian Roth (Nextron Systems), Markus Neis, FPT.EagleEye Team, Vadim Khrykov, Cyb3rEng, Michael Haag, Christopher Peacock @securepeacock, @scythe_io

  • High
    Suspicious Microsoft OneNote Child Process

    Detects suspicious child processes of the Microsoft OneNote application. This may indicate an attempt to execute malicious embedded objects from a .one file.

    T1566T1566.001by Tim Rauch (Nextron Systems), Nasreddine Bencherchali (Nextron Systems), Elastic (idea)

  • High
    Suspicious Modification Of Scheduled Tasks

    Detects when an attacker tries to modify an already existing scheduled tasks to run from a suspicious location Attackers can create a simple looking task in order to avoid detection on creation as it's often the most focused on Instead they modify the task after creation to include their malicious payload

    T1053.005by Nasreddine Bencherchali (Nextron Systems)

  • High
    Suspicious Outlook Child Process

    Detects a suspicious process spawning from an Outlook process.

    T1204.002by Michael Haag, Florian Roth (Nextron Systems), Markus Neis, Elastic, FPT.EagleEye Team

  • High
    Suspicious Processes Spawned by Java.EXE

    Detects suspicious processes spawned from a Java host process which could indicate a sign of exploitation (e.g. log4j)

    by Andreas Hunkeler (@Karneades), Florian Roth

  • High
    Suspicious Processes Spawned by WinRM

    Detects suspicious processes including shells spawnd from WinRM host process

    T1190by Andreas Hunkeler (@Karneades), Markus Neis

  • High
    Suspicious Scheduled Task Creation Involving Temp Folder

    Detects the creation of scheduled tasks that involves a temporary folder and runs only once

    T1053.005by Florian Roth (Nextron Systems)

  • High
    Suspicious Schtasks Execution AppData Folder

    Detects the creation of a schtask that executes a file from C:\Users\<USER>\AppData\Local

    T1053.005T1059.001by pH-T (Nextron Systems), Nasreddine Bencherchali (Nextron Systems)

  • High
    Suspicious Schtasks Schedule Types

    Detects scheduled task creations or modification on a suspicious schedule type

    T1053.005by Nasreddine Bencherchali (Nextron Systems)

  • High
    Suspicious Serv-U Process Pattern

    Detects a suspicious process pattern which could be a sign of an exploited Serv-U service

    T1555by Florian Roth (Nextron Systems)

  • High
    Suspicious ShellExec_RunDLL Call Via Ordinal

    Detects suspicious call to the "ShellExec_RunDLL" exported function of SHELL32.DLL through the ordinal number to launch other commands. Adversary might only use the ordinal number in order to bypass existing detection that alert on usage of ShellExec_RunDLL on CommandLine.

    T1218.011by Swachchhanda Shrawan Poudel

  • High
    Suspicious Shells Spawn by Java Utility Keytool

    Detects suspicious shell spawn from Java utility keytool process (e.g. adselfservice plus exploitation)

    by Andreas Hunkeler (@Karneades)

  • High
    Suspicious Spool Service Child Process

    Detects suspicious print spool service (spoolsv.exe) child processes.

    T1203T1068by Justin C. (@endisphotic), @dreadphones (detection), Thomas Patzke (Sigma rule)

  • High
    System File Execution Location Anomaly

    Detects the execution of a Windows system binary that is usually located in the system folder from an uncommon location.

    T1036by Florian Roth (Nextron Systems), Patrick Bareiss, Anton Kutepov, oscd.community, Nasreddine Bencherchali (Nextron Systems)

  • High
    Uncommon One Time Only Scheduled Task At 00:00

    Detects scheduled task creation events that include suspicious actions, and is run once at 00:00

    T1053.005by pH-T (Nextron Systems)

  • High
    Webshell Detection With Command Line Keywords

    Detects certain command line parameters often used during reconnaissance activity via web shells

    T1505.003T1018T1033T1087by Florian Roth (Nextron Systems), Jonhnathan Ribeiro, Anton Kutepov, oscd.community, Chad Hudson, Matt Anderson

  • High
    Windows Shell/Scripting Processes Spawning Suspicious Programs

    Detects suspicious child processes of a Windows shell and scripting processes such as wscript, rundll32, powershell, mshta...etc.

    T1059.005T1059.001T1218by Florian Roth (Nextron Systems), Tim Shelton

  • Medium
    Potential Persistence Via Microsoft Compatibility Appraiser

    Detects manual execution of the "Microsoft Compatibility Appraiser" task via schtasks. In order to trigger persistence stored in the "\AppCompatFlags\TelemetryController" registry key.

    T1053.005by Sreeman

  • Medium
    Potentially Suspicious Child Process Of ClickOnce Application

    Detects potentially suspicious child processes of a ClickOnce deployment application

    by Nasreddine Bencherchali (Nextron Systems)

  • Medium
    Schedule Task Creation From Env Variable Or Potentially Suspicious Path Via Schtasks.EXE

    Detects Schtask creations that point to a suspicious folder or an environment variable often used by malware

    T1053.005by Florian Roth (Nextron Systems)

  • Medium
    Scheduled Task Creation with Curl and PowerShell Execution Combo

    Detects the creation of a scheduled task using schtasks.exe, potentially in combination with curl for downloading payloads and PowerShell for executing them. This facilitates executing malicious payloads or connecting with C&C server persistently without dropping the malware sample on the host.

    T1053.005T1218T1105by Swachchhanda Shrawan Poudel (Nextron Systems)

  • Medium
    Scheduled Task Executing Payload from Registry

    Detects the creation of a schtasks that potentially executes a payload stored in the Windows Registry using PowerShell.

    T1053.005T1059.001by X__Junior (Nextron Systems), Nasreddine Bencherchali (Nextron Systems)

  • Medium
    Suspicious Scheduled Task Creation via Masqueraded XML File

    Detects the creation of a scheduled task using the "-XML" flag with a file without the '.xml' extension. This behavior could be indicative of potential defense evasion attempt during persistence

    T1036.005T1053.005by Swachchhanda Shrawan Poudel, Elastic (idea)

  • Medium
    Suspicious Scheduled Task Name As GUID

    Detects creation of a scheduled task with a GUID like name

    T1053.005by Nasreddine Bencherchali (Nextron Systems)

  • Medium
    Suspicious Schtasks Schedule Type With High Privileges

    Detects scheduled task creations or modification to be run with high privileges on a suspicious schedule type

    T1053.005by Nasreddine Bencherchali (Nextron Systems)

  • Low
    Scheduled Task Creation Via Schtasks.EXE

    Detects the creation of scheduled tasks by user accounts via the "schtasks" utility.

    T1053.005by Florian Roth (Nextron Systems)

Rules from SigmaHQ (rules/windows/process_creation), Detection Rule License (DRL) 1.1. Each rule links to its source and credits its authors.