Security in depth · Unit 22 · Lesson 23 of 44
Windows privilege escalation
Understand tokens, access checks, and service authority through small decisions.
ATT&CK TA0004 Privilege Escalation
Helpful before thisPrivilege escalation
After this lesson you can
- Explain why a process token matters more than a visible account name.
- Distinguish discretionary permissions, integrity policy, and service authority.
- Describe a permission problem with evidence, a limited fix, and a verification step.
Lessons in this unit
Browse 21 lessons in this topic
- Windows access tokensRead group attributes in the token used for a particular access check.3 min
- SIDs identify security principalsRead an account-lifecycle record without confusing a reused name with an existing identity.3 min
- DACLs describe permitted accessDistinguish a present empty DACL from an absent discretionary restriction.3 min
- Inherited access needs a reviewCompare inherited access with the actual confidentiality requirement.3 min
- UAC and administrative contextEvaluate an unexpected elevation request using the approved task, publisher, and execution context.3 min
- Integrity levels are another inputExplain different results for two same-user processes using a supplied integrity policy.3 min
- Service identities have different reachCompare service-account candidates against a supplied local and network resource requirement.3 min
- Service configuration is authoritySeparate viewing service status, controlling execution, and changing configuration.3 min
- Scheduled tasks need complete boundariesReview a monthly task using its principal, approved duties, and definition-management permissions.3 min
- DLL loading extends the trust boundaryAssess a supplied dependency inventory without treating an approved executable as approval for every loaded library.4 min
- Impersonation is scoped responsibilityRead a supplied request trace and distinguish client context from the service process identity.4 min
- User rights differ from file permissionsEvaluate a system privilege separately from folder access and its present token state.3 min
- Protect local credential copiesFollow a fictional credential copy from protected disk to a diagnostic bundle with broader readers.4 min
- Local administrator passwords need ownershipSeparate a successful managed-password rotation from retrieval rights and local administrator membership.3 min
- Credential isolation has a defined scopeRead a fleet snapshot without equating a requested Credential Guard policy with active, universal protection.4 min
- Patch state includes restarts and recoveryClassify three fictional update records using applicability, restart state, and observed service behavior.4 min
- Registry settings have their own permissionsCompare a configuration key's effective permissions with the distinct duties of support and release roles.3 min
- A network share adds another access checkCompare local and SMB access to the same file using supplied effective permissions.4 min
- Service SIDs make permissions more specificExplain why adding a service-specific grant does not remove a broader shared-account grant.3 min
- Boot integrity and disk secrecy differReview startup trust, encryption state, active protection, and recovery access as distinct travel-readiness requirements.4 min
- Case study: review a Windows service boundaryCompare a fictional service’s approved duties with supplied permissions, then write a correction and verification decision.9 min
A document service needs to write reports. Does that mean everyone who can start it should be able to change the program it runs? This is the central question behind privilege boundaries: who can cause an action, under whose authority, on which object?
Windows privilege escalation describes gaining authority beyond the intended security context. Understanding the boundary helps you prevent mistakes, explain a finding, and choose a proportionate fix. Begin with the model here, then explore the short lessons below at your own pace.
A process carries a security context
An access token includes a user identity, group information, privileges, and other security attributes. A process normally uses its primary token. A thread may use an impersonation token when acting for a client. These contexts are related, but they are not interchangeable.
A familiar account name is a useful label, not a complete account of authority. Group membership, token restrictions, enabled privileges, and the requested operation matter. Follow access tokens with security identifiers to separate identity from display names.
Ask about an operation on an object
A file, registry key, or service object exposes specific operations. Reading a document, changing its contents, and changing its permissions are different requests. A DACL describes discretionary access through entries for security identities. Their order, inheritance, and the token’s attributes can affect evaluation.
Avoid guessing from a single visible grant. A null DACL and an empty DACL also have very different meanings. The DACL lesson introduces those distinctions; permission inheritance explains how access can change as an object moves through its lifecycle.
Integrity adds another check
An integrity level is a trust label, separate from ordinary object permissions. Under no-write-up policy, a lower-integrity process cannot write to a higher-integrity object even when the DACL would otherwise grant that write. Matching levels does not itself grant access.
User Account Control influences how administrative tasks obtain an elevated context. Membership in Administrators does not mean every process starts with the same unrestricted token. Read UAC context after trying the model.
EXPLORE THE CONCEPT
Why a permission can still be insufficient
Compare these situations, then change the two controls in the model.
The DACL grants the write
A medium-integrity process still cannot write to this high-integrity file under its no-write-up policy. A discretionary grant does not cancel the integrity check.
The integrity levels match
Matching integrity levels removes that particular block. The token still needs permission from the DACL for the requested operation.
Both controls permit the write
The model allows the write when both conditions hold. A real system may also apply other checks; this model deliberately isolates these two concepts.
A simplified learning model. It connects to no systems and uses no real data.
Services have two boundaries to review
A service identity determines the context in which the service works. Its effective access should match its purpose. Separately, consider who can change its configuration, executable, or trusted dependencies. Controlling those inputs can change the work performed under the service identity.
For our document service, a useful review records the report destination, the required write permission, configuration ownership, and how changes are approved. It also considers failure: where sensitive temporary files go, what logs reveal, and whether recovery preserves the intended permissions. Explore service change control and scheduled task boundaries.
Reduce authority and verify the result
Credential isolation, separate local administrator passwords, application control, and patch maintenance address different failure paths. No single control substitutes for understanding the actual permissions. Local SYSTEM authority also does not automatically establish administrative authority over an entire domain.
A strong finding names the affected identity, object, operation, and evidence. Recommend the smallest change that removes unnecessary authority while preserving the service’s legitimate task. Verify normal work, denied operations, monitoring, and recovery afterward. That turns a permission observation into a useful improvement.
Apply these ideas in the Windows service-permission review case. Compare approved duties with supplied grants, separate service management from file access, and explain what evidence would justify closing the findings.
Worked review: separate the two failed boundaries
The fictional Ledger service publishes reports. These records concern ordinary processes, valid security descriptors, and the stated integrity policy. The case excludes special privilege overrides and additional blocking controls.
W1: A medium-integrity reporting process requests a write to a high-integrity report file. Its DACL allows that write, but the file applies no-write-up.
W2: The service owner approves Operators to start Ledger and query its status. The effective service-object permissions also grant Operators configuration changes.
W3: Maintainers control the executable files. Ledger’s runtime file access is limited to its input and report folders. No domain permission evidence is supplied.
PredictWould granting more file permissions fix both W1 and W2?
No. W1 already has the discretionary grant; integrity policy blocks the write. W2 concerns service management, a different object and operation. Adding runtime file access addresses neither mismatch.
For W1, the owner must decide whether the reporting process and destination were designed for the same trust level. A supported redesign might use an appropriately protected report destination or a narrowly authorized publishing component. Automatically elevating the entire reporting application expands its authority and needs a separate justification.
For W2, remove the unsupported configuration-change grant while preserving approved start and status operations. Keep executable protection from W3; it remains useful, but it does not cancel service configuration authority. Record permission evidence for each object separately.
Acceptance should confirm that Operators can start Ledger and obtain status but cannot change its configuration. Also confirm that the intended reporting design produces the required file under its approved context. These checks support a local correction. Neither successful publication nor a service account name establishes domain-wide authority.
Terms you met
Check yourself
No timer. No penalties. Read the explanation and try again whenever you like.
This lesson’s questions have changed. Your reading progress is saved; review the updated questions.
-
The same user has a primary process token and a thread acting for a client. Which context should the review record?
Show the answer
Correct answer: The token used by the operation, including any applicable thread impersonation. The effective context can depend on whether the thread is acting for a client. Record the relevant token and requested operation together.
-
In W1, why does the report write fail?
Show the answer
Correct answer: No-write-up blocks the medium-integrity process from writing the high-integrity file. This mandatory check remains relevant even with the discretionary grant, under the case’s explicit assumptions.
-
Which W2/W3 fact is the separate permission mismatch?
Show the answer
Correct answer: Operators can change service configuration although only start and status are approved. Service management rights are separate from runtime folder access and executable-file protection.
-
Which evidence best supports closing the W2 finding?
Show the answer
Correct answer: Operators retain start/status and are denied configuration changes after the scoped correction. The evidence tests the intended and unintended actions using the affected actor on the relevant service object.
Try it
- WriteWrite a decision note for W1-W3: explain why the write fails, identify the unsupported configuration grant, and propose a narrow change for its owner. Include one positive and one negative acceptance check, plus the missing evidence needed before claiming wider access.