Scheduled tasks
There might be a possibility that a scheduled task on a Windows machine may have lost the attached binary, or using one that we have write permissions on. The schtasks
command can be utilized to view scheduled tasks.
Perform the following command to view detailed information about a particular task:
Eg. To view the detailed information about the vulntask task
schtasks
command flags:
a) /query
: To list information
b) /tn
: Task name
c) /fo
: Output format (list in this case)
d) /v
: Verbose
The important value to note is Task To Run. The icacls
command can be used to find out if we are able to modify the contents of the C:\tasks\schtask.bat
(Task To Run) file.
Explanation of the(I)
and (F)
permissions:
(I)
: Inherited permissions - from a parent folder(F)
: Full control
As all the account and groups: SYSTEM
, Administrator
and Users have (F)
permissions, it means all of them can read, write and modify the file.
The BUILTIN\Users:(I)(F)
group permissions means that every single user on the system (privileged or non-privileged) are able to modify the file. This can exploited to insert malicious code into the schtask.bat
file, such as a reverse shell.
Last updated