System File Ownership Change

Adversaries may modify file or directory ownership to evade access control lists (ACLs) and access protected files.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2025/09/01"
  3integration = ["endpoint", "windows", "system", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
  4maturity = "production"
  5updated_date = "2026/09/18"
  6
  7[rule]
  8author = ["Elastic"]
  9description = "Adversaries may modify file or directory ownership to evade access control lists (ACLs) and access protected files."
 10from = "now-9m"
 11index = [
 12    "endgame-*",
 13    "logs-crowdstrike.fdr*",
 14    "logs-endpoint.events.process-*",
 15    "logs-m365_defender.event-*",
 16    "logs-sentinel_one_cloud_funnel.*",
 17    "logs-system.security*",
 18    "logs-windows.forwarded*",
 19    "logs-windows.sysmon_operational-*",
 20    "winlogbeat-*",
 21]
 22language = "eql"
 23license = "Elastic License v2"
 24name = "System File Ownership Change"
 25note = """## Triage and analysis
 26
 27### Investigating System File Ownership Change
 28
 29Adversaries may modify file or directory ownership to evade access control lists (ACLs) and access protected files.
 30
 31#### Possible investigation steps
 32
 33- Assess the ownership target file or directory and identify if it's a system critical file.
 34- Identify the user account that performed the action and whether it should perform this kind of action.
 35- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
 36- Investigate other alerts associated with the user/host during the past 48 hours.
 37
 38### False positive analysis
 39
 40- System updates, backup software and uninstallers tend to modify files ownership.
 41
 42### Response and remediation
 43
 44- Initiate the incident response process based on the outcome of the triage.
 45- Isolate the involved host to prevent further post-compromise behavior.
 46- If the triage identified malware, search the environment for additional compromised hosts.
 47  - Implement temporary network rules, procedures, and segmentation to contain the malware.
 48  - Stop suspicious processes.
 49  - Immediately block the identified indicators of compromise (IoCs).
 50  - Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
 51- Remove and block malicious artifacts identified during triage.
 52- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
 53- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
 54- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
 55- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
 56"""
 57
 58setup = """## Setup
 59
 60This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
 61
 62Setup instructions: https://ela.st/install-elastic-defend
 63
 64### Additional data sources
 65
 66This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
 67
 68- [CrowdStrike](https://ela.st/crowdstrike-integration)
 69- [Microsoft Defender XDR](https://ela.st/m365-defender)
 70- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
 71- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
 72- [Windows Process Creation Logs](https://ela.st/audit-process-creation)
 73"""
 74
 75risk_score = 47
 76rule_id = "7eb54028-ca72-4eb7-8185-b6864572347db"
 77severity = "medium"
 78tags = [
 79    "Domain: Endpoint",
 80    "OS: Windows",
 81    "Use Case: Threat Detection",
 82    "Tactic: Defense Evasion",
 83    "Tactic: Persistence",
 84    "Data Source: Elastic Endgame",
 85    "Resources: Investigation Guide",
 86    "Data Source: Elastic Defend",
 87    "Data Source: Windows Security Event Logs",
 88    "Data Source: Microsoft Defender XDR",
 89    "Data Source: Sysmon",
 90    "Data Source: SentinelOne",
 91    "Data Source: Crowdstrike",
 92    "Noise: Low",
 93    "Performance: Normal",
 94    "Rule Type: Event Correlation (EQL)",
 95    "Platform: Windows",
 96]
 97timeline_id = "e70679c2-6cde-4510-9764-4823df18f7db"
 98timeline_title = "Comprehensive Process Timeline"
 99timestamp_override = "event.ingested"
100type = "eql"
101
102query = '''
103process where host.os.type == "windows" and event.type == "start" and
104  (
105   (process.name : "icacls.exe" and process.args : "/reset") or
106   (process.name : "takeown.exe" and process.args : "/f") or
107   (process.name : "icacls.exe" and process.args : "/grant" and process.args : "Everyone:F")
108   ) and
109   process.command_line : "*.exe *C:\\Windows\\*"
110'''
111
112
113[[rule.threat]]
114framework = "MITRE ATT&CK"
115[[rule.threat.technique]]
116id = "T1222"
117name = "File and Directory Permissions Modification"
118reference = "https://attack.mitre.org/techniques/T1222/"
119[[rule.threat.technique.subtechnique]]
120id = "T1222.001"
121name = "Windows File and Directory Permissions Modification"
122reference = "https://attack.mitre.org/techniques/T1222/001/"
123
124
125
126[rule.threat.tactic]
127id = "TA0005"
128name = "Defense Evasion"
129reference = "https://attack.mitre.org/tactics/TA0005/"

Triage and analysis

Investigating System File Ownership Change

Adversaries may modify file or directory ownership to evade access control lists (ACLs) and access protected files.

Possible investigation steps

  • Assess the ownership target file or directory and identify if it's a system critical file.
  • Identify the user account that performed the action and whether it should perform this kind of action.
  • Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
  • Investigate other alerts associated with the user/host during the past 48 hours.

False positive analysis

  • System updates, backup software and uninstallers tend to modify files ownership.

Response and remediation

  • Initiate the incident response process based on the outcome of the triage.
  • Isolate the involved host to prevent further post-compromise behavior.
  • If the triage identified malware, search the environment for additional compromised hosts.
    • Implement temporary network rules, procedures, and segmentation to contain the malware.
    • Stop suspicious processes.
    • Immediately block the identified indicators of compromise (IoCs).
    • Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
  • Remove and block malicious artifacts identified during triage.
  • Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
  • Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
  • Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
  • Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).

Related rules

to-top