Windows Event ID 4698

Windows Event ID 4698

One-liner: A Windows Security Event logged when a new scheduled task is createdβ€”critical for detecting persistence mechanisms implanted by attackers.

🎯 What Is It?

Windows Event ID 4698 is generated when a new scheduled task is registered on a Windows system. Attackers abuse scheduled tasks to:

Channel: Security
MITRE ATT&CK: T1053.005 - Scheduled Task/Job: Scheduled Task

Prerequisite: Requires "Audit Other Object Access Events" to be enabled.

πŸ”¬ How It Works

Event Details

<Event>
  <System>
    <EventID>4698</EventID>
    <Channel>Security</Channel>
    <Computer>WKSTN-1.domain.local</Computer>
  </System>
  <EventData>
    <Data Name="SubjectUserName">attacker</Data>
    <Data Name="SubjectDomainName">DOMAIN</Data>
    <Data Name="TaskName">\Windows Update</Data>
    <Data Name="TaskContent">
      <!-- Full XML of the scheduled task -->
    </Data>
  </EventData>
</Event>

Key Fields

Field Description
SubjectUserName Account that created the task
TaskName Name of the scheduled task
TaskContent Full XML definition (includes command, triggers)

Common Attacker Techniques

# Command Prompt
schtasks /create /tn "Windows Update" /tr "C:\Windows\Temp\malware.exe" /sc minute /mo 1

# PowerShell
Register-ScheduledTask -TaskName "Updater" -Trigger (New-ScheduledTaskTrigger -AtStartup) -Action (New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-enc <payload>")

πŸ•΅οΈ Detection & Hunting

KQL Query (from THM Threat Hunting Foothold)

host.name: WKSTN-* AND (winlog.event_id: 4698 OR (*schtasks* OR *Register-ScheduledTask*))

Key Columns to Add

Suspicious Indicators

Indicator Why It's Suspicious
Task executing from %TEMP%, %APPDATA% Unusual execution location
Task name mimicking Windows tasks Masquerading (e.g., "Windows Update")
Encoded PowerShell in task action Obfuscated payload
Frequent execution (every minute) C2 beaconing pattern
Task created by non-admin user Privilege concern
External URLs in task action Downloading remote payloads

Example from THM

Task Name: "Windows Update"
Action: PowerShell downloading from www[.]oneedirve[.]xyz
Schedule: Every minute

β†’ Clear indicator of malicious persistence

Event ID Description
4698 Scheduled task created
4699 Scheduled task deleted
4700 Scheduled task enabled
4701 Scheduled task disabled
4702 Scheduled task updated
106 Task registered (Task Scheduler log)
200 Task executed (Task Scheduler log)
201 Task completed (Task Scheduler log)

πŸ”§ Enabling the Audit

Via Group Policy

Computer Configuration
  β†’ Windows Settings
    β†’ Security Settings
      β†’ Advanced Audit Policy Configuration
        β†’ Object Access
          β†’ Audit Other Object Access Events: Success, Failure

Via Command Line

auditpol /set /subcategory:"Other Object Access Events" /success:enable /failure:enable

🎀 Interview Angles

Common Questions

STAR Story

Situation: Endpoint was beaconing to an external domain every minute, but no obvious malware process was visible.
Task: Identify the persistence mechanism maintaining the C2 connection.
Action: Searched for Event ID 4698 and found a task named "Windows Update" created shortly after initial compromise. The TaskContent XML revealed a PowerShell command downloading from a malicious domain. Correlated with schtasks.exe execution in Sysmon logs.
Result: Identified and removed the persistence mechanism. Created detection rule for tasks executing encoded PowerShell or connecting to external URLs.

βœ… Best Practices

❌ Common Misconceptions

πŸ“š References