Schtasks.exe

Schedule periodic tasks

Paths

  • c:\windows\system32\schtasks.exe
  • c:\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

Resources