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.
Switches
Creates a new scheduled task.
MediumDeletes a task. Deleting a defender or logging task can be evasion.
MediumRuns a task immediately.
MediumChanges an existing task, for example its action or run-as account.
MediumLists tasks. Used for discovery of existing persistence.
LowTask name. Names that imitate Windows tasks are a red flag.
LowTask action: the program and arguments the task runs.
HighSchedule type, for example onlogon, onstart, minute or once.
LowRun-as account. SYSTEM gives the task SYSTEM privileges.
HighPassword for the run-as account, in clear text.
HighTarget computer. A remote target means remote task creation.
MediumAccount for the remote connection.
MediumPassword for the remote connection, in clear text.
MediumCreates the task from an XML definition file.
MediumCommand 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 regex
schtasks(\.exe)?\s+.*\/create\b.*\/ru\s+"?(system|nt authority\\system)"? - 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 regex
schtasks(\.exe)?\s+.*\/create\b.*\/tr\s+"?[^"]*(powershell|cmd|rundll32|mshta|wscript|cscript|regsvr32|\\temp\\|\\appdata\\)
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.
- HighDelete 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)
- HighDelete 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)
- HighDisable 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
- HighExecution via stordiag.exe
Detects the use of stordiag.exe to execute schtasks.exe systeminfo.exe and fltmc.exe
T1218by Austin Songer (@austinsonger)
- HighHackTool - Default PowerSploit/Empire Scheduled Task Creation
Detects the creation of a schtask via PowerSploit or Empire Default Configuration.
T1053.005T1059.001by Markus Neis, @Karneades
- HighHTML 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)
- HighPotential 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
- HighPotential 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
- HighPotentially Suspicious Child Process Of Regsvr32
Detects potentially suspicious child processes of "regsvr32.exe".
T1218.010by elhoim, Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems)
- HighRenamed 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)
- HighScheduled 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)
- HighScheduled 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)
- HighSchtasks 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)
- HighSchtasks From Suspicious Folders
Detects scheduled task creations that have suspicious action command and folder combinations
T1053.005by Florian Roth (Nextron Systems)
- HighScript Event Consumer Spawning Process
Detects a suspicious child process of Script Event Consumer (scrcons.exe).
T1047by Sittikorn S
- HighSuspicious 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)
- HighSuspicious Child Process Of Manage Engine ServiceDesk
Detects suspicious child processes of the "Manage Engine ServiceDesk Plus" Java web service
T1102by Florian Roth (Nextron Systems)
- HighSuspicious 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)
- HighSuspicious 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
- HighSuspicious 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)
- HighSuspicious 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)
- HighSuspicious 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
- HighSuspicious 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
- HighSuspicious Processes Spawned by WinRM
Detects suspicious processes including shells spawnd from WinRM host process
T1190by Andreas Hunkeler (@Karneades), Markus Neis
- HighSuspicious 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)
- HighSuspicious 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)
- HighSuspicious Schtasks Schedule Types
Detects scheduled task creations or modification on a suspicious schedule type
T1053.005by Nasreddine Bencherchali (Nextron Systems)
- HighSuspicious 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)
- HighSuspicious 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
- HighSuspicious Shells Spawn by Java Utility Keytool
Detects suspicious shell spawn from Java utility keytool process (e.g. adselfservice plus exploitation)
by Andreas Hunkeler (@Karneades)
- HighSuspicious Spool Service Child Process
Detects suspicious print spool service (spoolsv.exe) child processes.
T1203T1068by Justin C. (@endisphotic), @dreadphones (detection), Thomas Patzke (Sigma rule)
- HighSystem 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)
- HighUncommon 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)
- HighWebshell 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
- HighWindows 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
- MediumPotential 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
- MediumPotentially Suspicious Child Process Of ClickOnce Application
Detects potentially suspicious child processes of a ClickOnce deployment application
by Nasreddine Bencherchali (Nextron Systems)
- MediumSchedule 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)
- MediumScheduled 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)
- MediumScheduled 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)
- MediumSuspicious 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)
- MediumSuspicious Scheduled Task Name As GUID
Detects creation of a scheduled task with a GUID like name
T1053.005by Nasreddine Bencherchali (Nextron Systems)
- MediumSuspicious 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)
- LowScheduled 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.