Hunts for adversary persistence and execution via Windows scheduled tasks (T1053.005) by analyzing Security Event ID 4698 task-creation events, suspicious task properties, and unusual execution patterns from schtasks.exe/at.exe. Use after detecting schtasks or at.exe in process creation logs, during incident response to enumerate persistence on compromised hosts, or when Event ID 4698 fires for an unusual task.
Start a fresh conversation. Replace the highlighted placeholders.
Use hunting-for-suspicious-scheduled-tasks to investigate suspicious scheduled-task persistence within [authorized Windows hosts, task inventory or XML, and available event/process logs], and produce a risk-ranked task report covering actions, triggers, creators, execution accounts, and corroborating evidence.
Required inputs
[authorized Windows hosts, task inventory or XML, and available event/process logs]
User-approved starter prompt based on a pinned source version; check current skill requirements before running. Task evidence ↗
SKILL.md
name: hunting-for-suspicious-scheduled-tasksdescription: Hunts for adversary persistence and execution via Windows scheduled tasks (T1053.005) by analyzing Security Event ID 4698 task-creation events, suspicious task properties, and unusual execution patterns from schtasks.exe/at.exe. Use after detecting schtasks or at.exe in process creation logs, during incident response to enumerate persistence on compromised hosts, or when Event ID 4698 fires for an unusual task.domain: cybersecuritysubdomain: threat-huntingtags: - threat-hunting- scheduled-tasks- persistence- mitre-t1053-005- windows- endpoint-detectionversion: '1.0'author: mahipallicense: Apache-2.0nist_csf: - DE.CM-01- DE.AE-02- DE.AE-07- ID.RA-05mitre_attack: - T1046- T1057- T1082- T1083- T1547
Hunting for Suspicious Scheduled Tasks
When to Use
When proactively hunting for persistence mechanisms in Windows environments
After detecting schtasks.exe or at.exe usage in process creation logs
When investigating malware that survives reboots and user logoffs
During incident response to enumerate all persistence on compromised systems
When Windows Security Event ID 4698 (Scheduled Task Created) fires for unusual tasks
Prerequisites
Windows Security Event ID 4698/4699/4702 (Task Created/Deleted/Updated)
Sysmon Event ID 1 for schtasks.exe process creation with command lines
Windows Task Scheduler operational log (Microsoft-Windows-TaskScheduler/Operational)
PowerShell logging for Register-ScheduledTask cmdlet usage
Access to Task Scheduler XML definitions on endpoints
Workflow
Enumerate All Scheduled Tasks: Collect complete task inventory from target systems using schtasks /query /fo CSV /v or Get-ScheduledTask PowerShell cmdlet.
Monitor Task Creation Events: Track Event ID 4698 for new task creation, correlating with the creating process and user account context.
Analyze Task Actions: Examine what each task executes. Flag tasks running scripts (PowerShell, cmd, wscript), binaries from user-writable paths (TEMP, AppData, Downloads), or encoded/obfuscated commands.
Check Task Triggers: Review trigger conditions. Tasks triggered by system startup, user logon, or short intervals (1-5 minutes) warrant investigation.
Identify Hidden or Disguised Tasks: Hunt for tasks with names mimicking legitimate Windows tasks, tasks with Security Descriptor modifications hiding them from standard enumeration, or tasks stored in non-standard registry locations.
Correlate with Process Execution: Match scheduled task execution events with process creation logs to confirm what actually runs.
Baseline and Diff: Compare current task inventory against known-good baselines to identify new, modified, or unexpected tasks.
Cobalt Strike Persistence: Creates scheduled tasks via schtasks.exe to execute PowerShell download cradles at user logon intervals.
Ransomware Staging: Task created to run encryption payload at a future time, often during off-hours for maximum impact.
Hidden Task via SD Modification: Attacker modifies Security Descriptor of scheduled task to hide it from normal enumeration while maintaining execution.
COM Handler Abuse: Task uses COM handler rather than direct executable path, making action inspection more complex.
Lateral Movement via Tasks: Remote scheduled task creation using schtasks /create /s REMOTE_HOST for execution on other systems.