Overview
The ScheduledTasks command enumerates Windows Scheduled Tasks using WMI. By default, it filters out tasks authored by Microsoft to focus on potentially interesting third-party or custom tasks. Scheduled tasks are a common persistence mechanism for both legitimate software and malware, making this command valuable for identifying suspicious automated activities.Syntax
Arguments
- -full (optional) - Display all scheduled tasks without filtering Microsoft-authored tasks
Examples
Output
The command returns:- Task name
- Task path (folder location)
- Task state (Ready, Running, Disabled, etc.)
- Author/Creator
- Description
- Actions (executable, arguments, working directory)
- Triggers (schedule type, timing)
- Principal (user context)
- Run level (Highest, Limited)
- Last run time
- Next run time
- Task status
Use Cases
Red Team
- Identify persistence mechanisms
- Discover scheduled tasks for privilege escalation
- Find tasks running with elevated privileges
- Locate tasks with weak permissions for DLL hijacking
- Identify custom administrative tasks
- Discover backup and maintenance tasks
- Find tasks executing scripts or binaries
- Identify tasks for credential harvesting
- Locate tasks with modifiable paths
- Discover reconnaissance opportunities
Blue Team
- Audit scheduled tasks for unauthorized entries
- Detect malicious persistence mechanisms
- Identify suspicious task configurations
- Validate least privilege for scheduled tasks
- Monitor for unauthorized task creation
- Detect tasks running as SYSTEM or Administrator
- Identify tasks with unusual schedules
- Audit task actions for suspicious executables
- Correlate scheduled task activity with security incidents
- Detect Living off the Land techniques via tasks
- Identify tasks with insecure permissions
- Validate task author and digital signatures
Example Output
Performance Considerations
This command has minimal to moderate performance impact as it queries scheduled tasks via WMI. Performance depends on:- Number of scheduled tasks on the system
- WMI service responsiveness
- Whether -full option is used (more tasks = longer execution)
- System performance
Remote Execution
This command supports remote execution via WMI. Use the-computername parameter to enumerate scheduled tasks on remote systems:
Detection Considerations
Indicators
- WMI queries to Schedule.Service class
- Access to Task Scheduler service
- Enumeration of C:\Windows\System32\Tasks
- Registry access to HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache
- Sequential task enumeration queries
Defensive Recommendations
- Enable Task Scheduler auditing (Event IDs 4698, 4699, 4700, 4701, 4702)
- Monitor for unauthorized task creation or modification
- Alert on tasks created with SYSTEM or Administrator privileges
- Track WMI queries to scheduled task classes
- Implement least privilege for task creation
- Use AppLocker or similar to control execution of enumeration tools
- Monitor for tasks executing from unusual locations
- Validate digital signatures of task executables
- Restrict task folder permissions
- Audit task modifications via Event Log
- Correlate task creation with user logon events
- Baseline normal scheduled task inventory
- Alert on tasks with suspicious naming patterns
Related Commands
- AutoRuns - Auto run executables/scripts/programs
- Services - Services with file info
- Processes - Running processes with file info
- ProcessCreationEvents - Process creation logs with sensitive data
- LogonEvents - Logon events from the security event log
- InterestingProcesses - “Interesting” processes including admin tools