Skip to content

[New Rule] Potential Suspicious DebugFS Root Device Access #2982

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 3, 2023

Conversation

Aegrah
Copy link
Contributor

@Aegrah Aegrah commented Jul 31, 2023

Summary

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.

Detection

0 hits in RedSector last 365 days. The disk group might be leveraged by system administrators to create backups without granting the user root permissions. The DebugFS utility will most likely not be frequently used for this. By looking for this process and filtering on not user.Ext.real.id : "0" I think we can reduce most FPs, and final FPs could be eliminated by customer's themselves by adding specific actions to the exclusion list.

process where host.os.type == "linux" and event.action in ("exec", "exec_event") and event.type == "start" and 
process.name == "debugfs" and process.args : "/dev/sd*" and not user.Ext.real.id : "0" and not group.Ext.real.id : "0"
image

Copy link
Contributor

@DefSecSentinel DefSecSentinel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Aegrah Aegrah merged commit 4bcec33 into main Aug 3, 2023
@Aegrah Aegrah deleted the new-rule-disk-mount-non-root branch August 3, 2023 14:13
protectionsmachine pushed a commit that referenced this pull request Aug 3, 2023
* [New Rule] Potential DebugFS Privilege Escalation

* Changed rule name

* Update rules/linux/privilege_escalation_sda_disk_mount_non_root.toml

---------

Co-authored-by: Colson Wilhoit <[email protected]>

(cherry picked from commit 4bcec33)
protectionsmachine pushed a commit that referenced this pull request Aug 3, 2023
* [New Rule] Potential DebugFS Privilege Escalation

* Changed rule name

* Update rules/linux/privilege_escalation_sda_disk_mount_non_root.toml

---------

Co-authored-by: Colson Wilhoit <[email protected]>

(cherry picked from commit 4bcec33)
protectionsmachine pushed a commit that referenced this pull request Aug 3, 2023
* [New Rule] Potential DebugFS Privilege Escalation

* Changed rule name

* Update rules/linux/privilege_escalation_sda_disk_mount_non_root.toml

---------

Co-authored-by: Colson Wilhoit <[email protected]>

(cherry picked from commit 4bcec33)
protectionsmachine pushed a commit that referenced this pull request Aug 3, 2023
* [New Rule] Potential DebugFS Privilege Escalation

* Changed rule name

* Update rules/linux/privilege_escalation_sda_disk_mount_non_root.toml

---------

Co-authored-by: Colson Wilhoit <[email protected]>

(cherry picked from commit 4bcec33)
protectionsmachine pushed a commit that referenced this pull request Aug 3, 2023
* [New Rule] Potential DebugFS Privilege Escalation

* Changed rule name

* Update rules/linux/privilege_escalation_sda_disk_mount_non_root.toml

---------

Co-authored-by: Colson Wilhoit <[email protected]>

(cherry picked from commit 4bcec33)
protectionsmachine pushed a commit that referenced this pull request Aug 3, 2023
* [New Rule] Potential DebugFS Privilege Escalation

* Changed rule name

* Update rules/linux/privilege_escalation_sda_disk_mount_non_root.toml

---------

Co-authored-by: Colson Wilhoit <[email protected]>

(cherry picked from commit 4bcec33)
protectionsmachine pushed a commit that referenced this pull request Aug 3, 2023
* [New Rule] Potential DebugFS Privilege Escalation

* Changed rule name

* Update rules/linux/privilege_escalation_sda_disk_mount_non_root.toml

---------

Co-authored-by: Colson Wilhoit <[email protected]>

(cherry picked from commit 4bcec33)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants