githubEdit

SeTakeOwnershipPrivilege

SeTakeOwnershipPrivilege

SeTakeOwnershipPrivilege: grants a user the ability to take ownership of any "securable object," meaning Active Directory objects, NTFS files/folders, printers, registry keys, services, and processes.

This privilege assigns WRITE_OWNER rights over an object, that’s meaning user can change owner in Security Descriptor for this object

Who can take it ?

  • Admins take it by default

  • for Service Account has privilege to take VSS snapshots or Backup Jobs

  • with another privilege like SeBackupPrivilege, SeRestorePrivilege, and SeSecurityPrivilege

Severity

  • access to sensitive data

  • Remote Code Execution (RCE)

  • Denial-of-Service (DOS)

    we can use it to exploit shared folder or sensitive files


Exploit - Leveraging the Privilege

Reviewing Current User Privileges

Enabling SeTakeOwnershipPrivilege

to use this privilege we must enable it

Choosing a Target File

we'll target an interesting file found on a file share. search in public and private folder in sections like (IT, HR, Sales)

we find that all Domain Users can list the contents of certain subdirectories but get an Access denied message when trying to read the contents of most files. We find a file named cred.txt under the IT subdirectory of the Private share folder during our enumeration.

we will use SeTakeOwnershipPrivilege

Checking files Ownership

we can’t to see the owner of this file

Checking folder Ownership

we will back step to check the ownership of folder

Taking Ownership of the File

Now we can use the takeown Windows binary to change ownership of the file.

Confirming Ownership Changed

Modifying the File ACL

We may still not be able to read the file and need to modify the file ACL using icacls to be able to read it.

Let's grant our user full privileges over the target file.


Files of Interest

Some local files of interest may include: