Potential Suspicious DebugFS Root Device Access

This rule monitors for the usage of the built-in Linux DebugFS utility to access a disk device without root permissions. Linux users that are part of the "disk" group have sufficient privileges to access all data inside of the machine through DebugFS. Attackers may leverage DebugFS in conjunction with "disk" permissions to read sensitive files owned by root, such as the shadow file, root ssh private keys or other sensitive files that may allow them to further escalate privileges.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2023/08/30"
 3integration = ["endpoint"]
 4maturity = "production"
 5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
 6min_stack_version = "8.3.0"
 7updated_date = "2024/03/08"
 8
 9[rule]
10author = ["Elastic"]
11description = """
12This rule monitors for the usage of the built-in Linux DebugFS utility to access a disk device without root permissions. 
13Linux users that are part of the "disk" group have sufficient privileges to access all data inside of the machine through
14DebugFS. Attackers may leverage DebugFS in conjunction with "disk" permissions to read sensitive files owned by root, 
15such as the shadow file, root ssh private keys or other sensitive files that may allow them to further escalate 
16privileges.
17"""
18from = "now-9m"
19index = ["logs-endpoint.events.*", "endgame-*"]
20language = "eql"
21license = "Elastic License v2"
22name = "Potential Suspicious DebugFS Root Device Access"
23references = ["https://book.hacktricks.xyz/linux-hardening/privilege-escalation/interesting-groups-linux-pe#disk-group"]
24risk_score = 21
25rule_id = "2605aa59-29ac-4662-afad-8d86257c7c91"
26setup = """## Setup
27
28This rule requires data coming in from Elastic Defend.
29
30### Elastic Defend Integration Setup
31Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
32
33#### Prerequisite Requirements:
34- Fleet is required for Elastic Defend.
35- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
36
37#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
38- Go to the Kibana home page and click "Add integrations".
39- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
40- Click "Add Elastic Defend".
41- Configure the integration name and optionally add a description.
42- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
43- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
44- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
45- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
46For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
47- Click "Save and Continue".
48- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
49For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
50"""
51severity = "low"
52tags = ["Domain: Endpoint", "OS: Linux", "Use Case: Threat Detection", "Tactic: Privilege Escalation", "Data Source: Elastic Endgame", "Data Source: Elastic Defend"]
53timestamp_override = "event.ingested"
54type = "eql"
55query = '''
56process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "exec_event") and 
57process.name == "debugfs" and process.args : "/dev/sd*" and not process.args == "-R" and 
58not user.Ext.real.id == "0" and not group.Ext.real.id == "0"
59'''
60
61[[rule.threat]]
62framework = "MITRE ATT&CK"
63
64[[rule.threat.technique]]
65id = "T1078"
66name = "Valid Accounts"
67reference = "https://attack.mitre.org/techniques/T1078/"
68
69[[rule.threat.technique.subtechnique]]
70id = "T1078.003"
71name = "Local Accounts"
72reference = "https://attack.mitre.org/techniques/T1078/003/"
73
74[rule.threat.tactic]
75id = "TA0004"
76name = "Privilege Escalation"
77reference = "https://attack.mitre.org/tactics/TA0004/"

References

Related rules

to-top