Scheduled Tasks
TODO: Add scheduled task enumeration. schtask commands, privileges (ability to create tasks for current user), possible hijacks, etc.
Introduction
Typically an account would have to be an administrator account to schedule task for the system or it would have to be run as the administrator.
Enumerating Task Permissions
Creating Tasks
Windows Task Scheduler allows us to create tasks that execute on a pre-defined trigger. For example they can be:
Time of day
User Login
Computer Idle
Every n hours, minutes, seconds
Building Payload
For this example we will base64 encode our PowerShell payload using -enc (-EncodedCommand)
Output:
Execute Payload - SharPersist & Cobalt Strike
-t
is the desired persistence technique.-c
is the command to execute.-a
are any arguments for that command.-n
is the name of the task.-m
is to add the task (you can alsoremove
,check
andlist
).-o
is the task frequency.
Confirm
We can confirm we successfully created a scheduled task by opening the Task Scheduler.
Last updated