T1222
File and Directory Permissions Modification
Adversaries may modify file or directory permissions and ACLs to evade access controls and enable access to protected files. On Windows, tools like icacls, cacls, takeown, attrib, and PowerShell's Set-Acl cmdlet are abused to grant unauthorized access, remove inheritance, or take ownership of sensitive files and directories. On Linux and macOS, chmod, chown, chattr, and setfacl are used to widen permissions on credential files, binaries, or configuration data. Permission modifications commonly precede or accompany other techniques such as persistence via accessibility features, boot scripts, or hijack execution flow.
Microsoft Sentinel / Defender
kusto
let PermModTools = dynamic(["icacls.exe", "cacls.exe", "xcacls.exe", "takeown.exe", "attrib.exe", "SetACL.exe"]);
let HighValuePaths = dynamic(["\\system32\\", "\\syswow64\\", "\\windows\\", "\\program files\\", "\\programdata\\", "\\users\\", "\\sam", "\\security", "\\ntds", "\\lsass", "\\hosts"]);
let SuspiciousFlags = dynamic(["/grant", "/deny", "/reset", "/setowner", "/inheritance:r", "/inheritance:d", "Everyone", "BUILTIN\\Everyone", ":(OI)(CI)F", ":(F)", "/T /C /Q"]);
DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ (PermModTools)
or (FileName =~ "powershell.exe" and ProcessCommandLine has_any ("Set-Acl", "SetAccessControl", "InheritanceFlags", "PropagationFlags", "FileSystemAccessRule", "RegistryAccessRule", "AddAccessRule", "SetOwner"))
or (FileName =~ "cmd.exe" and ProcessCommandLine has_any ("icacls", "cacls", "takeown", "SetACL"))
| extend IsPermTool = FileName in~ (PermModTools)
| extend IsHighValuePath = ProcessCommandLine has_any (HighValuePaths)
| extend HasSuspiciousFlag = ProcessCommandLine has_any (SuspiciousFlags)
| extend GrantsEveryone = ProcessCommandLine has_any ("Everyone", "BUILTIN\\Everyone", "*S-1-1-0*")
| extend RemovesInheritance = ProcessCommandLine has_any ("/inheritance:r", "/inheritance:d")
| extend TakeOwnership = FileName =~ "takeown.exe" or ProcessCommandLine has "/setowner"
| extend GrantsFullControl = ProcessCommandLine has_any (":(F)", ":(OI)(CI)F", "/grant Everyone:F", "/grant *:F")
| extend IsPowerShellACL = FileName =~ "powershell.exe" and ProcessCommandLine has_any ("Set-Acl", "SetAccessControl", "AddAccessRule")
| extend SuspicionScore = toint(IsHighValuePath) + toint(HasSuspiciousFlag) + toint(GrantsEveryone) + toint(RemovesInheritance) + toint(TakeOwnership) + toint(GrantsFullControl)
| where SuspicionScore > 0 or IsPermTool or IsPowerShellACL
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine,
IsHighValuePath, HasSuspiciousFlag, GrantsEveryone, RemovesInheritance,
TakeOwnership, GrantsFullControl, IsPowerShellACL, SuspicionScore
| sort by Timestamp desc medium severity
high confidence
Data Sources
Process: Process Creation Command: Command Execution Microsoft Defender for Endpoint
Required Tables
DeviceProcessEvents
False Positives
- Software installation routines that reset permissions on application directories during setup or update (SCCM, Intune, installers)
- IT administrators using icacls or takeown to recover access to orphaned files after account migrations or domain rejoins
- Backup agents (Veeam, Acronis, Windows Server Backup) that modify file ACLs to enable backup of protected files
- Endpoint security tools resetting permissions on quarantined files or their own installation directories
- CI/CD pipeline agents (GitHub Actions, Jenkins, Azure DevOps agents) adjusting permissions on build artifact directories
Last updated: 2026-04-13 Research depth: deep
References (16)
- https://attack.mitre.org/techniques/T1222/
- https://attack.mitre.org/techniques/T1222/001/
- https://attack.mitre.org/techniques/T1222/002/
- https://www.hybrid-analysis.com/sample/ef0d2628823e8e0a0de3b08b8eacaf41cf284c086a948bdfd67f4e4373c14e4d?environmentId=100
- https://www.hybrid-analysis.com/sample/22dab012c3e20e3d9291bce14a2bfc448036d3b966c6e78167f4626f5f9e38d6?environmentId=110
- https://www.eventtracker.com/tech-articles/monitoring-file-permission-changes-windows-security-log/
- https://go.kaspersky.com/rs/802-IJN-240/images/TR_BlackCat_Report.pdf
- https://blog.talosintelligence.com/2022/03/from-blackmatter-to-blackcat-analyzing.html
- https://symantec-enterprise-blogs.security.com/blogs/threat-intelligence/noberus-blackcat-alphv-rust-ransomware
- https://www.crowdstrike.com/blog/falcon-overwatch-contributes-to-blackcat-protection/
- https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/icacls
- https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/takeown
- https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-acl
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1222.001/T1222.001.md
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1222.002/T1222.002.md
- https://github.com/SigmaHQ/sigma/tree/master/rules/windows/process_creation
Unlock Pro Content
Get the full detection package for T1222 including response playbook, investigation guide, and atomic red team tests.
Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance