Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Adversaries may modify file or directory permissions/attributes to evade access control lists (ACLs) and access protected files.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-07 | ✗→✓ | ▲ Improved | 144% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 24% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 66% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 51% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 16% | 0% |
> Sub-technique of: T1222
Adversaries may modify file or directory permissions/attributes to evade access control lists (ACLs) and access protected files. File and directory permissions are commonly managed by ACLs configured by the file or directory owner, or users with the appropriate permissions. File and directory ACL implementations vary by platform, but generally explicitly designate which users or groups can perform which actions (read, write, execute, etc.).
Windows implements file and directory ACLs as Discretionary Access Control Lists (DACLs). Similar to a standard ACL, DACLs identifies the accounts that are allowed or denied access to a securable object. When an attempt is made to access a securable object, the system checks the access control entries in the DACL in order. If a matching entry is found, access to the object is granted. Otherwise, access is denied.
Adversaries can interact with the DACLs using built-in Windows commands, such as icacls, cacls, takeown, and attrib, which can grant adversaries higher permissions on specific files and folders. Further, PowerShell provides cmdlets that can be used to retrieve or modify file and directory DACLs. Specific file and directory modifications may be a required step for many techniques, such as establishing Persistence via Accessibility Features, Boot or Logon Initialization Scripts, or tainting/hijacking other instrumental binary/configuration files via Hijack Execution Flow.
Platforms: Windows
The following tests are from Atomic Red Team and provide actionable ways to test this technique:
Modifies the filesystem permissions of the specified file or folder to take ownership of the object. Upon execution, "SUCCESS" will be displayed for the folder and each file inside of it.
Supported Platforms: windows
cmdtakeown.exe /f #{file_folder_to_own} /r
Dependencies:
Modifies the filesystem permissions of the specified folder and contents to allow the specified user or group Full Control. If "Access is denied" is displayed it may be because the file or folder doesn't exit. Run the prereq command to create it. Upon successfull execution, "Successfully processed 3 files" will be displayed.
Supported Platforms: windows
cmdicacls.exe #{file_or_folder} /grant #{user_or_group}:F
Dependencies:
Removes the read-only attribute from a file or folder using the attrib.exe command. Upon execution, no output will be displayed. Open the file in File Explorer > Right Click - Prperties and observe that the Read Only checkbox is empty.
Supported Platforms: windows
cmdattrib.exe -r #{file_or_folder}\*.* /s
Dependencies:
Attackers leverage an existing Windows binary, attrib.exe, to mark specific files or folder as hidden by using specific flags so that the victim does not see the file.
Supported Platforms: windows
cmdmkdir #{file_or_folder} >nul 2>&1 echo T1222.001_attrib1 >> #{file_or_folder}\T1222.001_attrib1.txt echo T1222.001_attrib2 >> #{file_or_folder}\T1222.001_attrib2.txt attrib.exe +h #{file_or_folder}\T1222.001_attrib1.txt attrib.exe +h #{file_or_folder}\T1222.001_attrib2.txt
Invokes the command line similar to that used by Ryuk Ransomware to grant full access to the entire C:\ drive for Everyone. icacls "C:\" /grant Everyone:F /T /C /Q However, for this atomic we set the permission on C:\Users\Public so it completes faster and doesn't irreversibly affect the host. You can set your own path variable to "C:\" if you prefer.
Supported Platforms: windows Elevation Required: Yes
cmdicacls "#{path}" /grant Everyone:F /T /C /Q
Dependencies:
If Atomic Red Team tests are not applicable, manually verify the technique by:
Ensure critical system files as well as those known to be abused by adversaries have restrictive permissions and are owned by an appropriately privileged account, especially if access is not required by users nor will inhibit system functionality.
Applying more restrictive permissions to files and directories could prevent adversaries from modifying the access control lists.
| Finding | Severity | Impact | | ------------------------------------------------------------------------ | -------- | --------------- | | Windows File and Directory Permissions Modification technique applicable | High | Defense Evasion |
| CWE ID | Title | | ------- | ---------------------------- | | CWE-693 | Protection Mechanism Failure |
Other measured skills in the registry, with their headline benchmark lift.