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 = "2025/09/02"
  6
  7
  8[rule]
  9author = ["Elastic"]
 10description = "Adversaries may modify file or directory ownership to evade access control lists (ACLs) and access protected files."
 11from = "now-9m"
 12index = [
 13    "endgame-*",
 14    "logs-crowdstrike.fdr*",
 15    "logs-endpoint.events.process-*",
 16    "logs-m365_defender.event-*",
 17    "logs-sentinel_one_cloud_funnel.*",
 18    "logs-system.security*",
 19    "logs-windows.forwarded*",
 20    "logs-windows.sysmon_operational-*",
 21    "winlogbeat-*",
 22]
 23language = "eql"
 24license = "Elastic License v2"
 25name = "System File Ownership Change"
 26note = """## Triage and analysis
 27
 28### Investigating System File Ownership Change
 29
 30Adversaries may modify file or directory ownership to evade access control lists (ACLs) and access protected files.
 31
 32#### Possible investigation steps
 33
 34- Assess the ownership target file or directory and identify if it's a system critical file.
 35- Identify the user account that performed the action and whether it should perform this kind of action.
 36- 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.
 37- Investigate other alerts associated with the user/host during the past 48 hours.
 38
 39### False positive analysis
 40
 41- System updates, backup software and uninstallers tend to modify files ownership.
 42
 43### Response and remediation
 44
 45- Initiate the incident response process based on the outcome of the triage.
 46- Isolate the involved host to prevent further post-compromise behavior.
 47- If the triage identified malware, search the environment for additional compromised hosts.
 48  - Implement temporary network rules, procedures, and segmentation to contain the malware.
 49  - Stop suspicious processes.
 50  - Immediately block the identified indicators of compromise (IoCs).
 51  - Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
 52- Remove and block malicious artifacts identified during triage.
 53- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
 54- 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.
 55- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
 56- 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).
 57"""
 58risk_score = 47
 59rule_id = "7eb54028-ca72-4eb7-8185-b6864572347db"
 60severity = "medium"
 61tags = [
 62    "Domain: Endpoint",
 63    "OS: Windows",
 64    "Use Case: Threat Detection",
 65    "Tactic: Defense Evasion",
 66    "Tactic: Persistence",
 67    "Data Source: Elastic Endgame",
 68    "Resources: Investigation Guide",
 69    "Data Source: Elastic Defend",
 70    "Data Source: Windows Security Event Logs",
 71    "Data Source: Microsoft Defender for Endpoint",
 72    "Data Source: Sysmon",
 73    "Data Source: SentinelOne",
 74    "Data Source: Crowdstrike",
 75]
 76timeline_id = "e70679c2-6cde-4510-9764-4823df18f7db"
 77timeline_title = "Comprehensive Process Timeline"
 78timestamp_override = "event.ingested"
 79type = "eql"
 80
 81query = '''
 82process where host.os.type == "windows" and event.type == "start" and
 83  (
 84   (process.name : "icacls.exe" and process.args : "/reset") or
 85   (process.name : "takeown.exe" and process.args : "/f") or
 86   (process.name : "icacls.exe" and process.args : "/grant" and process.args : "Everyone:F")
 87   ) and
 88   process.command_line : "*.exe *C:\\Windows\\*"
 89'''
 90
 91
 92[[rule.threat]]
 93framework = "MITRE ATT&CK"
 94[[rule.threat.technique]]
 95id = "T1222"
 96name = "File and Directory Permissions Modification"
 97reference = "https://attack.mitre.org/techniques/T1222/"
 98[[rule.threat.technique.subtechnique]]
 99id = "T1222.001"
100name = "Windows File and Directory Permissions Modification"
101reference = "https://attack.mitre.org/techniques/T1222/001/"
102
103
104
105[rule.threat.tactic]
106id = "TA0005"
107name = "Defense Evasion"
108reference = "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