Skip to main content

Overview

SeTakeOwnershipPrivilege allows a user to take ownership of any securable object in Windows without being granted discretionary access. Once you own an object, you can grant yourself full control over it — files, registry keys, services, AD objects, anything with a security descriptor. The attack chain is always the same: take ownership → modify DACL → exploit the object.

Who Has It by Default

If you compromised a local admin that is not yet SYSTEM, or a service account with this privilege assigned via GPO, this is your path.

Check if Enabled

Filter for it:
Expected output when exploitable:
If Disabled, you need to enable it in your current token before using it. See Enabling the Privilege below.

How It Works Technically

Every securable object in Windows (file, folder, registry key, service, AD object, named pipe, process, etc.) has a security descriptor containing:
Normally, only the current owner or someone with WRITE_OWNER permission can change the owner. SeTakeOwnershipPrivilege bypasses this entirely — it grants implicit WRITE_OWNER on every object regardless of its DACL. The exploitation flow:
The Windows API behind this is SetNamedSecurityInfo / SetSecurityInfo with OWNER_SECURITY_INFORMATION. The takeown.exe and icacls.exe utilities wrap this API.

Take Ownership of SAM/SYSTEM Files

Dump local hashes by taking ownership of the SAM and SYSTEM registry hives.

Via Registry (Preferred — Avoids File Locks)

The SAM and SYSTEM files under C:\Windows\System32\config\ are locked by the OS. Use registry save instead:
If access denied on the registry hives, take ownership first:
Then dump:

Via File System

If you need the raw files (e.g., for offline cracking with Volume Shadow Copy):
The files are still locked while Windows is running. Use a volume shadow copy to access them:

Crack the Hashes


Take Ownership of Service Registry Keys

Modify a service’s ImagePath to point to your payload. The service runs as SYSTEM — so does your payload.

Step 1 — Find a Target Service

Pick a service running as LocalSystem:
Look for SERVICE_START_NAME : LocalSystem.

Step 2 — Take Ownership of the Registry Key

The /r flag recurses into subkeys. If takeown does not support registry paths on your OS version, use PowerShell:

Step 3 — Grant Full Control

Step 4 — Modify ImagePath

Or for a reverse shell:

Step 5 — Restart Service

If you cannot restart the service, change its start type to automatic and wait for a reboot:

Take Ownership of Service Binaries

Replace the actual binary a service executes.

Step 1 — Find the Binary Path

Step 2 — Take Ownership and Replace

Step 3 — Replace Binary

Generate the payload:

Step 4 — Restart


Take Ownership of Scheduled Task Files

Scheduled tasks running as SYSTEM often execute scripts or binaries. Replace them.

Find Scheduled Tasks Running as SYSTEM

Replace the Task Binary

Overwrite with payload:
Or if the task runs an executable:
Wait for the task to trigger, or run it manually if allowed:

Take Ownership of Startup Folder Locations

Binaries in startup folders execute when any user (or all users) log in.

Target Paths

Take Ownership and Plant Payload

All-users startup:
Target an admin user’s startup folder:
The payload executes when the target user logs in.

Take Ownership of Registry Run Keys

Run keys execute binaries at user logon. Take ownership of HKLM keys to affect all users.

Step 1 — Take Ownership

Step 2 — Grant Full Control

Step 3 — Add Payload

Other useful Run key locations:

Take Ownership of AD Objects (Domain Context)

In a domain environment, SeTakeOwnershipPrivilege on a Domain Controller (or via PowerView remotely with the privilege) lets you take ownership of AD objects — users, groups, OUs, GPOs.

Take Ownership of a User Object (Reset Password)

Take Ownership of a Group (Add Yourself)

Take Ownership of a GPO (Backdoor via Group Policy)

Then modify the GPO to push a scheduled task, startup script, or registry setting domain-wide.

Using PowerView


Using takeown.exe + icacls

The built-in tools for the most common operations.

takeown.exe

icacls.exe

One-Liner (Take Ownership + Full Control)

Recursive version:

Using PowerShell Set-Acl

Native PowerShell approach without external tools.

Files and Folders

Registry Keys

Reusable Function


Using SetNamedSecurityInfo API

Direct Win32 API call via P/Invoke. Use when takeown.exe is blocked or unavailable.

Enabling a Disabled Privilege

If whoami /priv shows SeTakeOwnershipPrivilege as Disabled, the privilege exists in your token but must be enabled before use. takeown.exe enables it automatically. For PowerShell and API methods, enable it manually:
Or using a standalone snippet:
Verify:

Full Chain Walkthrough: TakeOwnership to SYSTEM

Step-by-step example taking ownership of a service registry key, modifying the image path, and getting a SYSTEM shell.

1. Confirm the Privilege

2. Enumerate Services Running as SYSTEM

Pick a stopped or restartable service. Prefer one with StartMode = Auto.

3. Take Ownership of the Service Registry Key

4. Grant Full Control

5. Modify ImagePath

6. Start Listener and Restart Service

Attacker:
Target:

7. Verify


Quick Reference