RedTeam Nexus Labs
Module 15 · Lesson 04 // Windows Privilege Escalation

scheduled tasks

Windows Privilege Escalation · Ethical Hacking

Freereading · 10 min
On this page
LESSON

Overview

Windows scheduled tasks running with high privilege are an escalation vector when misconfigured, paralleling Linux cron. This lesson covers Windows scheduled-task escalation, defensively.

Learning objectives

  • Explain how privileged Windows scheduled tasks enable escalation.
  • Identify scheduled-task misconfigurations.
  • Connect to hardening scheduled tasks on Windows.

Core concept

Windows scheduled tasks run programs automatically, often with elevated privileges (Administrator or SYSTEM). If a privileged scheduled task runs a program that a low-privilege user can modify — or references a user-writable location — the user can influence what the task executes, escalating on the next run. As with Linux cron, the recurring execution makes this valuable: alter the target, and the privileged task runs the user's content. Misconfigured scheduled tasks are a recognized Windows escalation (and persistence) pattern.

How it works

A privileged scheduled task periodically runs a defined program. If the program (or its directory) is writable by a low-privilege user, or the task references a user-controllable path, the user can modify what runs — and the next execution runs it with the task's elevated privilege (crossing to Administrator/SYSTEM). In authorized testing, enumeration examines scheduled tasks (what runs, under which account, and whether referenced programs/paths are user-writable). Defensively, scheduled-task programs must be writable only by appropriate privileged accounts, referenced by protected paths, and tasks run with least privilege; task definitions and their targets should be monitored for changes.

Practical example

In an authorized Windows lab, the tester finds a scheduled task running as SYSTEM that executes a program in a directory writable by the standard user. Because the user can replace that program, the next run executes their content as SYSTEM — an escalation path. The fix: ensure the program and its directory are writable only by privileged accounts, use a protected path, and monitor the task. The path arose from a privileged scheduled task plus a writable target, mirroring the Linux cron pattern.

Cybersecurity relevance

Windows scheduled-task misconfigurations are a known escalation vector and also a persistence mechanism (see the persistence module). Defensively: ensure privileged scheduled tasks run programs writable only by privileged accounts, use protected paths, run tasks with least privilege, and monitor task definitions and their target files for unauthorized changes (detection). In authorized testing, user-writable programs referenced by privileged tasks are prime escalation findings. This is the Windows counterpart to the Linux scheduled-tasks lesson; understanding it guides both offense (in labs) and hardening/detection.

Common mistakes

  • Privileged scheduled tasks running programs writable by low-privilege users.
  • Referencing tasks by user-controllable/unprotected paths.
  • Not monitoring scheduled-task definitions/targets for unauthorized changes.

Key takeaways

  • Privileged Windows scheduled tasks (Administrator/SYSTEM) become escalation vectors when they run user-writable programs or reference user-controllable paths.
  • Recurring execution means user-modified content runs with elevated privilege on the next run.
  • Mitigate by making task programs writable only by privileged accounts, using protected paths, running with least privilege, and monitoring task definitions/targets (also a persistence mechanism) — the Windows counterpart to Linux cron.

Check your understanding

  • How does a SYSTEM scheduled task running a user-writable program enable escalation?
  • What hardening and detection measures protect Windows scheduled tasks from abuse?
FINISH THIS LESSON

Sign in to save your progress.