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-03 | ✗→✓ | ▲ Improved | 40% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 43% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 25% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 45% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 31% | 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.).
Most Linux and Linux-based platforms provide a standard set of permission groups (user, group, and other) and a standard set of permissions (read, write, and execute) that are applied to each group. While nuances of each platform’s permissions implementation may vary, most of the platforms provide two primary commands used to manipulate file and directory ACLs: <code>chown</code> (short for change owner), and <code>chmod</code> (short for change mode).
Adversarial may use these commands to make themselves the owner of files and directories or change the mode if current permissions allow it. They could subsequently lock others out of the file. Specific file and directory modifications may be a required step for many techniques, such as establishing Persistence via Unix Shell Configuration Modification or tainting/hijacking other instrumental binary/configuration files via Hijack Execution Flow.
Platforms: macOS, Linux
The following tests are from Atomic Red Team and provide actionable ways to test this technique:
Changes a file or folder's permissions using chmod and a specified numeric mode.
Supported Platforms: linux, macos
bashchmod #{numeric_mode} #{file_or_folder}
Changes a file or folder's permissions using chmod and a specified symbolic mode.
Supported Platforms: linux, macos
bashchmod #{symbolic_mode} #{file_or_folder}
Changes a file or folder's permissions recursively using chmod and a specified numeric mode.
Supported Platforms: linux, macos
bashchmod -R #{numeric_mode} #{file_or_folder}
Changes a file or folder's permissions recursively using chmod and a specified symbolic mode.
Supported Platforms: linux, macos
bashchmod -R #{symbolic_mode} #{file_or_folder}
Changes a file or folder's ownership and group information using chown.
Supported Platforms: macos, linux
bashchown #{owner}:#{group} #{file_or_folder}
If Atomic Red Team tests are not applicable, manually verify the technique by:
Applying more restrictive permissions to files and directories could prevent adversaries from modifying the access control lists.
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.
| Finding | Severity | Impact | | ------------------------------------------------------------------------------ | -------- | --------------- | | Linux and Mac 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.