Skip to content

Response, New York. Noah Park: Check Point Patches Actively Exploited Management Server Path Traversal. Detection, Dallas. Ava Okello: Report Finds Nearly Half of Deployed Detections Need Attention Before SOCs Can Trust Them.

SOCtember

Always First. Fast SOC News.

Microsoft Security Blog post on Tarrask stating that Event ID 4698 in the Security log and the Task Scheduler Operational log are not audited by default and must be turned on by an administrator.
Screenshot: Microsoft Security Blog, Tarrask malware uses scheduled tasks for defense evasion, Microsoft (fair use).

Detection

Did You Know: Windows Records No Event 4698 for a New Scheduled Task Until an Administrator Turns On Auditing, and a Task Stripped of Its SD Value Vanishes From schtasks

Scheduled tasks are one of the most common ways attackers keep a foothold on Windows, and Security Event 4698 is the record of a task being created. Microsoft says neither that event nor the Task Scheduler Operational log is audited by default. Its incident responders also showed how deleting one registry value hides a running task from schtasks /query and the Task Scheduler console.

Ava Okello, DetectionLondon3 min read

LONDON - When a SOC team hunts for persistence on Windows, scheduled tasks are near the top of the list, and Security Event 4698 ("A scheduled task was created.") is the record most detections are built on. Many hunts assume that record exists. Microsoft's own incident responders say it often does not. In a 2022 write-up on the Tarrask malware, Microsoft named two logs that record the creation and operation of scheduled tasks, Event ID 4698 in Security.evtx and the Microsoft-Windows-TaskScheduler/Operational log, and added: "Neither of these are audited by default and must be explicitly turned on by an administrator."

Microsoft Learn page for Event 4698 showing the subcategory Audit Other Object Access Events and the event description.
Screenshot: Microsoft Learn, 4698(S): A scheduled task was created, Microsoft (fair use).

Event 4698 belongs to the advanced audit subcategory Audit Other Object Access Events. Microsoft's reference page says: "This event generates every time a new scheduled task is created." When it is on, the event is rich. It names the account that created the task and carries the full task XML in the TaskContent field, including the command the task runs. On Windows 10 version 1903 and later it also records the client process ID and its parent process ID. The same page advises alerting when the task XML contains a Password logon type, because the password for the account that runs the task is then stored in Credential Manager.

Microsoft Learn page for Audit Other Object Access Events showing Success auditing recommended for domain controllers, member servers and workstations, and the scheduled task events 4698 to 4702.
Screenshot: Microsoft Learn, Audit Other Object Access Events, Microsoft (fair use).

Turning the subcategory on brings the rest of the task lifecycle with it: 4699 for a deleted task, 4700 and 4701 for a task enabled or disabled, and 4702 for a task updated. Microsoft rates the subcategory's event volume as low and, for domain controllers, member servers and workstations alike, writes: "We recommend Success auditing first of all because of scheduled tasks events."

Microsoft Security Blog section explaining that deleting the SD value hides a scheduled task from schtasks /query and Task Scheduler, and that the deletion must run as SYSTEM.
Screenshot: Microsoft Security Blog, Tarrask malware uses scheduled tasks for defense evasion, Microsoft (fair use).

The Tarrask case shows why the event matters. Microsoft said the HAFNIUM group, now tracked as Silk Typhoon, created a task called WinUpdate to restore dropped connections to its command and control servers, then deleted the task's SD (security descriptor) value under the TaskCache\Tree registry key. With that value gone, the task no longer appeared in schtasks /query or the Task Scheduler console, yet it kept running. The deletion needs SYSTEM rights, which Tarrask obtained by stealing a token from lsass.exe. Microsoft noted that even removing the registry keys and the task file entirely would leave the task running until the next reboot.

MITRE ATT&CK technique T1053.005 Scheduled Task, describing hidden scheduled tasks created by deleting the Security Descriptor registry value or altering the Index value.
Screenshot: MITRE ATT&CK, T1053.005 Scheduled Task/Job: Scheduled Task, The MITRE Corporation (fair use).

MITRE ATT&CK now lists the trick under T1053.005 and warns of a variant: "Adversaries may also employ alternate methods to hide tasks, such as altering the metadata (e.g., Index value) within associated registry keys." A task enumeration from schtasks is therefore not proof that a host is clean, but the creation event is written before any hiding happens.

For detection teams, the checks are short. Confirm through Group Policy that Audit Other Object Access Events is set to Success on every Windows server and workstation, and enable the Task Scheduler Operational log. Forward both off the host. Build alerts on 4698 and 4702 that read the TaskContent command, flag new tasks in the root of the Task Scheduler library, and flag Password logon types. During a hunt, Microsoft recommends enumerating HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree for tasks with no SD value.

About the Author

Ava Okello

Ava Okello covers detection engineering and threat hunting for SOCtember from London.

Related stories

Detection desk