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.
Switches
The file or folder to take ownership of.
MediumRecurses into subfolders.
LowGives ownership to the Administrators group instead of the current user.
LowDefault answer for the prompt on folders where the user has no list permission.
InfoCommand 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 regex
takeown(\.exe)?\s+.*\/f\s+\S+.*\/r\b
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.
- MediumSuspicious 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.