T1053.002

At

Adversaries may abuse the at utility to perform task scheduling for initial or recurring execution of malicious code. The at utility exists as an executable within Windows, Linux, and macOS for scheduling tasks at a specified time and date. Although deprecated in favor of schtasks in Windows environments, at can be used to execute programs at system startup or on a scheduled basis for persistence, remote execution as part of lateral movement, and privilege escalation on Linux if allowed to run as superuser via sudo. Adversaries may also leverage the WMI Win32_ScheduledJob class to schedule tasks programmatically.

Microsoft Sentinel / Defender
kusto
// Detect suspicious use of the 'at' scheduler utility on Windows and WMI-based job scheduling
let AtSuspiciousArgs = dynamic([
  "cmd.exe", "powershell", "wscript", "cscript", "mshta", "rundll32", "regsvr32",
  "certutil", "bitsadmin", "net use", "net user", "whoami", "mimikatz",
  ".exe", ".bat", ".vbs", ".ps1", ".hta"
]);
union
(
  // Windows: at.exe process creation via DeviceProcessEvents
  DeviceProcessEvents
  | where Timestamp > ago(24h)
  | where FileName =~ "at.exe"
  | where ProcessCommandLine has_any (AtSuspiciousArgs)
     or ProcessCommandLine matches regex @"\d{1,2}:\d{2}\s+(AM|PM|/every|/next)"
     or ProcessCommandLine has "/interactive"
  | extend Source = "at.exe direct execution"
  | project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
            InitiatingProcessFileName, InitiatingProcessCommandLine,
            InitiatingProcessAccountName, FolderPath, Source
),
(
  // Windows: at.exe spawned by unusual parents (lateral movement pattern)
  DeviceProcessEvents
  | where Timestamp > ago(24h)
  | where FileName =~ "at.exe"
  | where InitiatingProcessFileName in~ ("cmd.exe", "powershell.exe", "wscript.exe", "cscript.exe",
                                          "mshta.exe", "python.exe", "python3.exe", "perl.exe")
  | extend Source = "at.exe spawned by scripting engine"
  | project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
            InitiatingProcessFileName, InitiatingProcessCommandLine,
            InitiatingProcessAccountName, FolderPath, Source
),
(
  // WMI Win32_ScheduledJob creation detected via DeviceProcessEvents (wmic or powershell invoking Win32_ScheduledJob)
  DeviceProcessEvents
  | where Timestamp > ago(24h)
  | where (FileName =~ "wmic.exe" and ProcessCommandLine has "ScheduledJob")
     or (FileName in~ ("powershell.exe", "pwsh.exe") and ProcessCommandLine has "Win32_ScheduledJob")
  | extend Source = "WMI Win32_ScheduledJob"
  | project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
            InitiatingProcessFileName, InitiatingProcessCommandLine,
            InitiatingProcessAccountName, FolderPath, Source
)
| sort by Timestamp desc
high severity high confidence

Data Sources

Process: Process Creation Command: Command Execution Microsoft Defender for Endpoint

Required Tables

DeviceProcessEvents

False Positives

  • Legacy enterprise applications that still use at.exe for scheduled maintenance tasks (e.g., older backup software or batch job schedulers)
  • IT administrators manually scheduling jobs via at.exe on older Windows Server systems that have not migrated to schtasks
  • Security testing tools or vulnerability scanners that enumerate or test scheduled task functionality
  • Automated build or CI/CD pipelines that invoke at.exe for timed job coordination on legacy systems

Unlock Pro Content

Get the full detection package for T1053.002 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections