Skip to content
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

artif: dump /etc/ld.so.preload with debugfs/xfs_db #280

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from

Conversation

mnrkbys
Copy link
Contributor

@mnrkbys mnrkbys commented Sep 11, 2024

Add a new artifact to collect /etc/ld.so.preload.
Although LD_PRELOAD rootkits may hide /etc/ld.so.preload, it can be read via debugfs.

Add a new artifact to collect /etc/ld.so.preload.
Although LD_PRELOAD rootkits may hide /etc/ld.so.preload, it can be read via debugfs.
Add a new artifact to dump /etc/ld.so.preload.
If the file system where /etc is located is XFS, we need to use xfs_db instead of debugfs.
@mnrkbys mnrkbys changed the title artif: /etc/ld.so.preload via debugfs artif: dump /etc/ld.so.preload with debugfs/xfs_db Sep 12, 2024
@tclahr
Copy link
Owner

tclahr commented Oct 15, 2024

This is cool, but I need some time for testing it. I will release UAC v3.0.0 and move this to 3.1.0. Thanks!

tclahr and others added 5 commits November 30, 2024 08:25
Add collection of stat even if the file is hidden.
Change the output file as any files that are written to disk that matches ld.so.preload is modified by the rootkit.
Moved the condition from command to condition.
@tclahr
Copy link
Owner

tclahr commented Jan 11, 2025

Before merging into develop, I had to do some small changes.

  1. During some tests, I noticed that any files that contain the string ld.so.preload is hooked by the rootkit, so UAC (or any other tool) cannot write to files like etc_ld.so.preload.txt. So I changed the output_file to etc_ld_so_preload.txt

  2. I changed your .sh script name to reflect what it is doing.

  3. I moved the condition to check the file system from the command to condition property. This is due to the fact even systems that use xfs also have debugfs installed as /boot uses to be formatted as ext. So I think it would be better checking the file system among with the debugfs in the condition property.

  4. I noticed that stat can retrieve file stats for the /etc/ld.so.preload even if the rootkit is enabled. So I added a collector for that.

  5. I added %mount_point% in the command as this artifact can also be run in offline disks.

Change script name to linux_dump_etc_ld_so_preload.sh
@mnrkbys
Copy link
Contributor Author

mnrkbys commented Jan 14, 2025

Thanks for your detailed review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants