Skip to content
WETNav

Defense evasion · Windows

takeown.exe

Take Ownership

Takes ownership of files and folders. Used with icacls to seize a protected file an attacker does not own, so it can then be read, replaced or deleted.

Legitimate use

Admins use it to recover access to files with broken or restrictive ownership.

Worst caseMedium

Switches

/f<value>

The file or folder to take ownership of.

Medium
/r

Recurses into subfolders.

Low
/a

Gives ownership to the Administrators group instead of the current user.

Low
/d<value>

Default answer for the prompt on folders where the user has no list permission.

Info

Command lines to worry about

  • Medium

    Recursive ownership change

    Taking ownership of a folder tree is often paired with an icacls grant to seize protected files. Check the target path.

    Detection regextakeown(\.exe)?\s+.*\/f\s+\S+.*\/r\b

    T1222.001

Where it is recorded

  • Security4688Process creation with the full command line, when command-line auditing is enabled.
  • Sysmon1Process creation with command line, hashes and parent process.

Community detections

1 SigmaHQ rule for takeown.exe. The explainer checks every pasted command line against all of them.

  • Medium
    Suspicious Recursive Takeown

    Adversaries can interact with the DACLs using built-in Windows commands takeown which can grant adversaries higher permissions on specific files and folders

    T1222.001by frack113

Rules from SigmaHQ (rules/windows/process_creation), Detection Rule License (DRL) 1.1. Each rule links to its source and credits its authors.