Sub-technique of T1222 File and Directory Permissions Modification.View on attack.mitre.org
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: chown (short for change owner), and chmod (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.
Rules on DetectionCode tagged with T1222.002.
| Rule | Level | Log source |
|---|---|---|
| Chmod Targeting Sensitive Directories | medium | linux / process_creation |
| Remove Immutable File Attribute | medium | linux / process_creation |
| Remove Immutable File Attribute - Auditd | medium | linux / NULL |
| File or Folder Permissions Change | low | linux / NULL |
| Rule | Type | Risk | Data source |
|---|---|---|---|
| Linux Auditd Change File Owner To Root | Anomaly | NULL | Linux Auditd Proctitle |
| Linux Auditd File Permission Modification Via Chmod | Anomaly | NULL | Linux Auditd Proctitle |
| Linux Auditd File Permissions Modification Via Chattr | Anomaly | NULL | Linux Auditd Execve |
| Linux Change File Owner To Root | Anomaly | NULL | Sysmon for Linux EventID 1 |
| Used by | Procedure example |
|---|---|
| GroupAPT32 | APT32's macOS backdoor changes the permission of the file it wants to execute to 755. |
| GroupRocke | Rocke has changed file permissions of files so they could not be modified. |
| GroupTeamTNT | TeamTNT has modified the permissions on binaries with |
| Used by | Procedure example |
|---|---|
| MalwareBlack Basta | The Black Basta binary can use `chmod` to gain full permissions to targeted files. |
| MalwareBundlore | Bundlore changes the permissions of a payload using the command |
| MalwareCOATHANGER | COATHANGER will set the GID of `httpsd` to 90 when infected. |
| MalwareDok | Dok gives all users execute permissions for the application using the command |
| MalwareDRYHOOK | DRYHOOK has the ability to remount the filesystem as “read-write” to make changes and then restores it to “read-only” prior to killing processes to apply the modifications. |
| MalwareKinsing | Kinsing has used chmod to modify permissions on key files for use. |
| MalwareOSX_OCEANLOTUS.D | OSX_OCEANLOTUS.D has changed permissions of a second-stage payload to an executable via |
| MalwareOSX/Shlayer | OSX/Shlayer can use the |
| Used by | Procedure example |
|---|---|
| CampaignKV Botnet Activity | KV Botnet Activity altered permissions on downloaded tools and payloads to enable execution on victim machines. |
Data from MITRE ATT&CK® (Enterprise). ATT&CK® is a registered trademark of The MITRE Corporation.