Local tasks
How to manipulate local Windows tasks
Use the built-in schtasks command to create and manipulate Windows tasks (basically the equivalent of *NIX cron jobs).
If a task points to a file that you’ve obtained write access to, then that file can be altered without changing the underlying task.
It may also be possible to create your own tasks.
Stealthy tasks
Link to originalHow to hide Windows tasks using PsExec
Deleting the task Security Descriptor will make the task invisible to any user in the system. Note that this requires PsExec!
Link to original
Use
PsExec64.exe -s -i regedit
to open regedit with SYSTEM privileges.Search in
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\
for the task to hide. Under the key for that task, there will be a value named SD that contains the security descriptor. Simply delete it.
Remote tasks
How to manipulate remote Windows tasks
IMPORTANT
By default, UAC restricts remote schtasks calls to domain admins and the default local “Administrator” account. Local Windows admins cannot call this service remotely without first disabling UAC!
The schtasks command can also be used to create and manipulate services on remote machines. This uses the Windows RPC (TCP 135), but will fall back to named pipes over SMB (TCP 445) or NetBIOS (TCP 139). (In fact, this is how
Link to originalschtasks
works locally as well; the only difference is that in this case a local named pipe is always used.)