Process
schtasks.exe
schtasks.exe is the command-line interface to the Windows Task Scheduler. It creates, runs, queries, changes, and deletes scheduled tasks, programs set to run on a trigger like a time, a logon, or system boot. Administrators use it for routine automation. Attackers use it as one of the most reliable ways to gain persistence and to run code on remote machines.
File identity
Not observed.
Not observed.
Not observed.
Not observed.
Execution context
Not observed.
Not observed.
Not observed.
Not observed.
Not observed.
Not observed.
Ancestry
Not observed.
Not observed.
Not observed.
Not observed.
Behavior
Not observed.
Not observed.
Not observed.
Not observed.
schtasks /create /sc minute /mo 1 /tn "Reverse shell" /tr "{CMD}"Execute · Create a recurring task to keep reverse shell session(s) aliveschtasks /create /s targetmachine /tn "MyTask" /tr "{CMD}" /sc dailyExecute · Create a remote task to run daily relative to the the time of creation
Indicators
Not observed.
Analysis
schtasks.exe manages scheduled tasks through the Task Scheduler service. A task pairs a trigger (a time, a schedule, logon, boot, idle, or an event) with an action (a program or script) and an account to run as. The main verbs are /create, /run, /query, /change, and /delete, and with /s <host> plus credentials it manages tasks on a remote machine. The genuine binary lives at C:\Windows\System32\schtasks.exe. The tasks it creates are carried out later by the Task Scheduler, often through taskhostw.exe for DLL-based tasks.
Legitimately, schtasks is run by administrators, installers, and management tooling to set up maintenance and automation. The task it creates, the program that task runs, the account it runs as, and the trigger that fires it, all on the command line, are what give an instance meaning.
schtasks.exe is one of the most common persistence mechanisms on Windows (T1053.005). A task bound to logon or boot, or set on a recurring schedule, re-runs the attacker's program every time the trigger fires and survives reboots, and /ru SYSTEM makes that program run with full privileges. A created task whose action is a script host, a LOLBIN, or a binary in a user-writable directory points to abuse rather than routine automation.
Pointed at a remote host, schtasks is also lateral movement (T1053.005). schtasks /create /s <target> /u <user> /p <pass> /tr ... followed by /run creates and triggers a task on another machine with supplied credentials, a well-worn remote-execution method. Remote task creation followed by an immediate run is the pattern.
Attackers also hide tasks, for example by stripping a task's security descriptor so it disappears from the Task Scheduler UI, and tuck them in obscure folders. Because schtasks is a normal administrative tool, the action, the account, the trigger, the parent, and any remote target are what separate automation from abuse. Where a created task runs DLL-based work, it surfaces at execution time under taskhostw.exe.
- Image path other than
C:\Windows\System32\schtasks.exehigh /createwith/trpointing to a script host, a LOLBIN, or a binary in a user-writable pathhigh/ru SYSTEMor another privileged account on a created taskhigh- A remote target,
/s <host>with credentialshigh - Parent is an Office application, a script host, or an unfamiliar processhigh
- A task created in an unusual or hidden task foldermed
/createfollowed immediately by/runmed
Telemetry
Not observed.
Not observed.