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 = "2023/08/30"
 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"
26severity = "low"
27tags = ["Domain: Endpoint", "OS: Linux", "Use Case: Threat Detection", "Tactic: Privilege Escalation", "Data Source: Elastic Endgame", "Data Source: Elastic Defend"]
28timestamp_override = "event.ingested"
29type = "eql"
30query = '''
31process where host.os.type == "linux" and event.action in ("exec", "exec_event") and event.type == "start" and 
32process.name == "debugfs" and process.args : "/dev/sd*" and not process.args == "-R" and 
33not user.Ext.real.id == "0" and not group.Ext.real.id == "0"
34'''
35
36[[rule.threat]]
37framework = "MITRE ATT&CK"
38
39[[rule.threat.technique]]
40id = "T1078"
41name = "Valid Accounts"
42reference = "https://attack.mitre.org/techniques/T1078/"
43
44[[rule.threat.technique.subtechnique]]
45id = "T1078.003"
46name = "Local Accounts"
47reference = "https://attack.mitre.org/techniques/T1078/003/"
48
49[rule.threat.tactic]
50id = "TA0004"
51name = "Privilege Escalation"
52reference = "https://attack.mitre.org/tactics/TA0004/"

References

Related rules

to-top