Linux and Mac Permissions T1222.002
- Tactic
- Defense Impairment
- Platforms
- Linux, macOS
- Version
- 2.0
- Created
- 04 February 2020
- Last modified
- 12 May 2026
Adversaries may modify file or directory permissions/attributes to evade access control lists (ACLs) and access protected files.[1][2] 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.).
Linux and Mac Permissions MITRE reference T1222.002
3 groups have been recorded using this technique. Newest first; each entry carries MITRE’s procedure text and a link to the group’s full record. Click a name to filter the rules below.
Has changed file permissions of files so they could not be modified.1
APT32's macOS backdoor changes the permission of the file it wants to execute to 755.1
All 3 groups for this technique
1 campaign has been recorded using this technique. Listed newest first; dates are year-granularity and attribution is MITRE’s.
Altered permissions on downloaded tools and payloads to enable execution on victim machines.1
All 1 campaigns for this technique
11 software entries are documented implementing this technique. MITRE files each as a tool or as malware; newest first, then by how many groups carry them.
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.12
Will set the GID of httpsd to 90 when infected.1
The Black Basta binary can use chmod to gain full permissions to targeted files.1
Uses the chmod +x command to grant executable permissions to the malicious file.1
Has the ability to modify file permissions.1
Has used chmod to modify permissions on key files for use.1
All 11 software entries for this technique · 6 newest in this preview
Offense vs defense T1222.002
Is defensive coverage keeping up with adversary use? Eight counts, each ranked against all 697 ATT&CK techniques. Attack sits left, defense right, so a shape leaning left means adversaries are better documented here than defenders are equipped. Hover any spoke for its percentile and the share of techniques that have more. The timeline below shows when each side arrived.
How it got here
Adversary activity (campaign spans) over cumulative rule output. Each source is plotted independently from zero, so neither line includes the other. Campaign dates are year-granularity.
Linux and Mac Permissions detection strategy DET0351
MITRE names one behaviour worth catching for this technique and breaks it into 2 analytics, one per platform. Each carries the log sources it needs and the fields you tune per environment.
Unix-like File Permission Manipulation Behavioral Chain Detection Strategy
AN0998 · Linux
Linux permission escalation behavioral chain: (1) Process creation of permission modification utilities (chmod, chown, chgrp, setfacl) with suspicious parameters indicating privilege escalation intent, (2) System call analysis revealing direct file metadata manipulation (chmod, fchmod, chown, fchown syscalls), (3) Extended attribute and ACL modifications targeting critical system paths, (4) Temporal correlation with subsequent file access or process execution from modified locations, (5) Anomalous permission patterns deviating from system baselines
Log sources
The data this analytic draws on. You do not need every component — each one you already collect covers part of it. Each links to its ATT&CK record.
| Data component | Name | Channel |
|---|---|---|
| Process CreationDC0032 | linux:osquery | process execution events for permission modification utilities with command-line analysis |
| File MetadataDC0059 | auditd:SYSCALL | syscall in (chmod, fchmod, fchmodat, chown, fchown, fchownat, lchown, setxattr, lsetxattr, fsetxattr, removexattr, lremovexattr, fremovexattr) |
| Command ExecutionDC0064 | auditd:PROCTITLE | proctitle contains chmod, chown, chgrp, setfacl, or attr with suspicious parameters (777, 755, +x, -R) |
Tunable fields
MITRE calls these the analytic’s mutable elements: the thresholds and filters you set for your own environment.
| Field | What you tune |
|---|---|
| SuspiciousPermissionValues | Octal permission values indicating potential malicious intent - customize based on organizational security policy (default: 777, 755, 4755, 2755, 1755 for sticky/setuid/setgid) |
| CriticalSystemPaths | Linux filesystem paths requiring enhanced permission change monitoring - adapt to environment-specific critical directories (/etc, /usr/bin, /usr/sbin, /var, /opt, /root, /boot) |
| AuthorizedSystemAdministrators | User accounts and service accounts authorized for system-level permission modifications - maintain current list of legitimate administrators |
| TemporalCorrelationWindow | Time window for correlating permission changes with subsequent file access or process execution - adjust based on system performance (default: 300 seconds) |
| RecursiveOperationThreshold | Maximum depth or file count for recursive permission operations before triggering anomaly detection (-R flag monitoring) |
| ACLComplexityBaseline | Baseline complexity metrics for setfacl operations to detect anomalous extended ACL configurations |
| FileAccessFrequencyBaseline | Statistical baseline for normal file access patterns post-permission modification to detect privilege abuse |
AN0999 · macOS
macOS permission and attribute manipulation behavioral chain: (1) Process execution of permission utilities (chmod, chown, chgrp) or macOS-specific tools (chflags) with suspicious parameters, (2) System Integrity Protection (SIP) bypass attempts through permission modifications, (3) File flags manipulation (uchg, schg, hidden) for evasion or persistence, (4) Extended attribute (xattr) modifications affecting security metadata, (5) Unified log correlation with file system events and subsequent access patterns, (6) Gatekeeper and code signing bypass through permission/attribute manipulation
Log sources
The data this analytic draws on. You do not need every component — each one you already collect covers part of it. Each links to its ATT&CK record.
| Data component | Name | Channel |
|---|---|---|
| Process CreationDC0032 | macos:unifiedlog | process execution events for chmod, chown, chflags with parameter analysis and target path examination |
| File MetadataDC0059 | OpenBSM:AuditTrail | BSM audit events for file permission, ownership, and attribute modifications with user context |
| File ModificationDC0061 | fs:fsevents | file system events indicating permission, ownership, or extended attribute changes on critical paths. File system modification events with kFSEventStreamEventFlagItemChangeOwner, kFSEventStreamEventFlagItemXattrMod flags |
Tunable fields
MITRE calls these the analytic’s mutable elements: the thresholds and filters you set for your own environment.
| Field | What you tune |
|---|---|
| SIPProtectedPaths | macOS system paths protected by SIP that should never have permission modifications - maintain current list based on macOS version (/System, /usr, /bin, /sbin) |
| SuspiciousFileFlags | chflags parameter combinations indicating potential evasive behavior - customize based on security requirements (uchg, schg, hidden, archived) |
| CriticalExtendedAttributes | Extended attributes requiring monitoring for unauthorized removal or modification (com.apple.quarantine, com.apple.metadata, com.apple.FinderInfo) |
| GatekeeperBypassIndicators | Patterns in permission/attribute changes that may indicate Gatekeeper bypass attempts |
| ApplicationBundleMonitoring | Scope of .app directory monitoring for internal permission modifications indicating bundle tampering |
| UnifiedLogRetentionPeriod | Log retention period for correlating permission changes with subsequent access patterns - balance storage with detection capability |
| FSEventsFilteringThreshold | File system event filtering threshold to manage high-volume environments while maintaining detection coverage |
Adversaries sometimes modify object access rights at the operating system level. There are varying motivations behind this action - they may not want some files/objects to be changed on systems for persistence reasons and therefore provide admin only rights; also, they may want files to be accessible with lower levels of permissions.
D3FEND techniques
The defensive countermeasure this analytic implements, in MITRE’s D3FEND ontology.
| ID | Name |
|---|---|
| D3-SFA | System File Analysis |
Implementations
Pseudocode is the canonical logic; the rest are CAR’s translations into vendor query languages.
Windows environment logs can be noisy, so we take the following into consideration: * We need to exclude events generated by the local system (subject security ID "NT AUTHORITY\SYSTEM") and focus on actual user events. * When a permission modification is made for a folder, a new event log is generated for each subfolder and file under that folder. It is advised to group logs based on handle ID or user ID. * The Windows security log (event ID 4670) also includes information about the process that modifies the file permissions. It is advised to focus on uncommon process names, and it is also uncommon for real-users to perform this task without a GUI.
log_name == "Security" AND event_code == "4670" AND object_type == "File" AND subject_security_id != "NT AUTHORITY\SYSTEM"
This looks for any invocations of chmod. Note that this is likely to be more noisy than the Windows-specific implementation, although Linux does not generate logs for system triggered activities like in Windows. In addition, it may be necessary to whitelist cron jobs that regularly run and execute chmod.
processes = search Process:Create chmod_processes = filter processes where command_line == "chmod *" output chmod_processes
Splunk version of the above pseudocode.
index=__your_windows_security_log_index__ EventCode=4670 Object_Type="File" Security_ID!="NT AUTHORITY\\SYSTEM"
LogPoint version of the above pseudocode for Windows.
norm_id=WindowsSysmon channel="Security" event_id=4670 object_type="File" -user_id="S-1-5-18"
Unit tests
CAR’s own validation procedures for this analytic.
For Windows - right click on any file and change its permissions under properties. Or, execute the following command: `icacls "C:\<fileName>" /grant :F`
For Linux - execute the following command: `chmod 777 "fileName"`
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.
Tests from Atomic Red Team (MIT licence) · technique definition