Suspicious Command Patterns in Scheduled Task Creation
Adversaries frequently leverage scheduled tasks to maintain persistence or execute malicious payloads by invoking commands from temporary directories or utilizing obfuscated PowerShell/scripting patterns.
Threat actors consistently abuse the Windows Task Scheduler to achieve persistence, privilege escalation, and lateral movement. By utilizing 'schtasks.exe', attackers can register tasks that trigger malicious activity on system startup, login, or at periodic intervals. Defenders have observed a variety of malicious patterns associated with this technique, ranging from basic command-line execution (e.g., 'cmd /c') to complex, obfuscated PowerShell one-liners and the use of system binaries like 'mshta.exe' or 'cscript.exe'.
Attackers frequently place the target executable in writeable, non-standard directories such as 'C:\ProgramData\', 'C:\Temp\', or user-specific 'AppData' folders to bypass restrictions on protected system directories. Monitoring the command-line arguments of 'schtasks.exe' is critical for detecting these malicious task registrations, as the presence of high-frequency task triggers, privileged account execution, or suspicious scripting indicators often points to automated malware deployment or post-exploitation activities.
Impact
Successful abuse of the Windows Task Scheduler allows attackers to ensure their malware persists across system reboots, execute payloads with SYSTEM privileges, and automate the exfiltration of sensitive data. This technique is pervasive across malware families, including ransomware and sophisticated backdoors, often serving as a foundational step for long-term environment compromise.
Recommendation
- Deploy the provided Sigma rule to monitor for suspicious 'schtasks.exe' command-line patterns in process creation telemetry.
- Enable Sysmon or equivalent EDR process creation logging with command-line auditing to capture the full execution scope of 'schtasks.exe'.
- Tune the detection to account for legitimate software installers, which may use temporary folders (like 'C:\Temp\') for setup tasks during an initial deployment window.
- Establish a baseline for automated administrative task creation to minimize false positives from legitimate IT management tools.
Immediate actions
Deploy Sigma detection for suspicious schtasks patterns.
Detection coverage 1
Detect Suspicious Scheduled Task Creation
highDetects scheduled task creation using 'schtasks' that contains suspicious command patterns, common scripting bypasses, or anomalous file paths.
Detection queries are available on the platform. Get full rules →