Studying memory with the Volatility memory dump analyzer
Third-Party Exim Server and Netcat Connections
As Listing 5 and Figure 2 show, a local attacker has uninstalled the installed Exim4 version on the demo system and replaced it with another one that is not from the repository. They probably used the Netcat connection they found to transfer the contents of the /dev/sda1
partition and RAM.
![](/var/linux_magazin/storage/images/issues/2013/157/volatility-2.3/figure-2/601356-1-eng-US/Figure-21_large.png)
A glance at the logfiles from the mail server would be meaningful for further evaluation. Unfortunately, they cannot be reconstructed from memory. Fortunately, we also have the hard drive from the compromised system, the memory dump, and the Honeynet 2011 case, which gives us, for example, the Bash history.
However, we can see from the memory dump – even using standard Unix tools – that the attacker has used wget
to inject malicious software: The strings
command searches for suspicious entries such as wget
, .tar.gz
, or .tgz
:
strings -td victoria-v8.memdump.img | egrep '(\.tar|\.tgz|.\tar\.gz)'
This step returns a fair number of matches and their byte offsets, including rk.tar
. Listing 6 searches an offset range, which often reveals information of further interest; strangely, that is not the case here. If you have access to the tangible physical filesystem, you can inspect the files that surround rk.tar
.
Listing 6
Strings with awk
Reconstructing Files
The linux_mount
command can also provide enlightening information that is very useful to see whether the system used tmpfs, which is taken for granted today. The temporary filesystem almost always keeps a copy of the filesystem as a cache in RAM.
With a little luck, files such as rk.tar
in this example can be reconstructed from memory. In Volatility, the linux_dentry_cache
command does exactly that:
vol.py linux_dentry_cache > bodyfile
The output file uses the forensic bodyfile format, as the name suggests. Mactime, a program from Sleuth Kit [13], helps in this case and converts the file into a readable format (Listing 7).
Listing 7
Mactime
Incorrect Implementation
Unfortunately, the reconstructed bodyfile format still shows an error in recovering the date – February 11, 2080, is unlikely to be the creation date. Proceed with caution, if you intend to use this file as evidence. The developers are already aware of this issue, but reconstructing rk.tar
currently fails, at least if you do not have the filesystem.
At least you can restore /etc/passwd
as a proof of concept (Listing 8). The virtual inode on the cached system is 0xcf033e48. Calling
vol.py linux_find_file -i 0xcf033e48 -O /tmp/passwd
creates a copy of the reconstructed passwd
file in the /tmp
directory .
Listing 8
Restored /etc/passwd
« Previous 1 2 3 4 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
![Learn More](https://www.linux-magazine.com/var/linux_magazin/storage/images/media/linux-magazine-eng-us/images/misc/learn-more/834592-1-eng-US/Learn-More_medium.png)
News
-
NVIDIA Released Driver for Upcoming NVIDIA 560 GPU for Linux
Not only has NVIDIA released the driver for its upcoming CPU series, it's the first release that defaults to using open-source GPU kernel modules.
-
OpenMandriva Lx 24.07 Released
If you’re into rolling release Linux distributions, OpenMandriva ROME has a new snapshot with a new kernel.
-
Kernel 6.10 Available for General Usage
Linus Torvalds has released the 6.10 kernel and it includes significant performance increases for Intel Core hybrid systems and more.
-
TUXEDO Computers Releases InfinityBook Pro 14 Gen9 Laptop
Sporting either AMD or Intel CPUs, the TUXEDO InfinityBook Pro 14 is an extremely compact, lightweight, sturdy powerhouse.
-
Google Extends Support for Linux Kernels Used for Android
Because the LTS Linux kernel releases are so important to Android, Google has decided to extend the support period beyond that offered by the kernel development team.
-
Linux Mint 22 Stable Delayed
If you're anxious about getting your hands on the stable release of Linux Mint 22, it looks as if you're going to have to wait a bit longer.
-
Nitrux 3.5.1 Available for Install
The latest version of the immutable, systemd-free distribution includes an updated kernel and NVIDIA driver.
-
Debian 12.6 Released with Plenty of Bug Fixes and Updates
The sixth update to Debian "Bookworm" is all about security mitigations and making adjustments for some "serious problems."
-
Canonical Offers 12-Year LTS for Open Source Docker Images
Canonical is expanding its LTS offering to reach beyond the DEB packages with a new distro-less Docker image.
-
Plasma Desktop 6.1 Released with Several Enhancements
If you're a fan of Plasma Desktop, you should be excited about this new point release.