Schtasks.exe
Schedule periodic tasks
Paths
c:\windows\system32\schtasks.exec:\windows\syswow64\schtasks.exe
Commands
Execute
Create a recurring task to execute every minute.
Use case: Create a recurring task to keep reverse shell session(s) alive
Privileges: User
schtasks /create /sc minute /mo 1 /tn "Reverse shell" /tr "{CMD}"
Execute
Create a scheduled task on a remote computer for persistence/lateral movement
Use case: Create a remote task to run daily relative to the the time of creation
Privileges: Administrator
schtasks /create /s targetmachine /tn "MyTask" /tr "{CMD}" /sc daily
Detection
- Sigma: https://github.com/SigmaHQ/sigma/blob/c04bef2fbbe8beff6c7620d5d7ea6872dbe7acba/rules/windows/process_creation/proc_creation_win_schtasks_creation.yml
- Elastic: https://github.com/elastic/detection-rules/blob/ef7548f04c4341e0d1a172810330d59453f46a21/rules/windows/persistence_local_scheduled_task_creation.toml
- Splunk: https://github.com/splunk/security_content/blob/18f63553a9dc1a34122fa123deae2b2f9b9ea391/detections/endpoint/schtasks_scheduling_job_on_remote_system.yml
- IOC: Suspicious task creation events