06:00 UTC Charta Aetatis Cyberpunk

Console Newsletter Pro Sign in Early access Register
Aa · Display
Themes
Type size
Density
Defence & Detection · 13Cubed · · 10:58 runtime

Automate Volatility 3 Memory Analysis with This Tool

In the wiki Volatility3LinuxWindows Also namedmacOS
Transcript 1928 words · auto-generated captions

Machine-transcribed by YouTube. Expect errors in names, commands and version numbers.

Welcome to 13 cubed. In this episode, we're going to take a look at a tool that's going to make your life much easier when it comes to running volatility 3. So, let me set the stage for you. Let's say someone hands you a Linux memory image, and they ask you to thoroughly analyze that image and determine how the device in question became compromised. Now, obviously, one of the first things you're going to do is run the banners plug-in to obtain the Linux kernel version in use, unless you knew that ahead of time. And from there, you could build your own ISF or download a pre-created ISF. But let's assume you're past that, and you're to the point of beginning the actual analysis.

One of the early plug-ins you're probably going to run is linux.pslist, and probably also linux.psscan, and so on. From there, you'll probably transition to more in-depth plug-ins like linux.lsof and linux.malware.malfind, and again, down through the list you go running your plug-ins. In fact, it wouldn't be at all uncommon to run 20 plus plug-ins against a single image. That's certainly a real-world scenario for me. Fortunately, doing so is easy enough because typically, all you need to do is press the up arrow to recall the last command, backspace to erase any plug-in options, and just change the plug-in name, add any necessary options, press enter, and you're off to the races. And then you simply do that again, and again, and again.

Now, of course, you could script this into a bash script and actually walk away and grab some coffee and let it run and do its thing. But the problem with that is, it's still going to execute volatility 3 in a serial-like manner, one after the other after the other, and it's going to take quite a while. What if there was a way to run volatility 3 concurrently? In other words, to do this processing in parallel instead of in serial? Well, that's exactly what this tool does. It's going to take advantage of however many cores you have available on your system, and it's going to farm out numerous volatility 3 jobs, and actually run those plug-ins concurrently, bringing the results back to you.

Obviously, that's far more efficient and far faster. This is something I use all the time in real-world investigations, and it's incredibly easy to use. So, let me show you how it works. Okay, as you can see, we're looking at the GitHub repo for this tool, which is called volgolangwrapper. As the name implies, it's written in Go. I've gone ahead and run git clone against this repo, pulling the project down to my local computer. For reference, we'll be using Ubuntu 24.04

under WSL2. This is actually the same setup we use in investigating Windows memory. And I should mention that you can certainly use this tool to analyze Windows memory images as well, even though we'll be using a Linux image for the demo. By the way, you can find all of the official 13 cubed training courses and course bundles at So, if you really want in-depth knowledge in Windows, Linux, and macOS forensics, be sure to check those out today.

Okay, let's go ahead and switch over to Windows terminal, and as you can see, we're in my tools directory, which I created in the root of my user directory. It's important to note that in this location, we have volatility 3. That's going to be important because we're going to need to provide the path to volatility 3 to this tool, so it understands where volatility 3 is located, so it can run it for us. Okay, let's go ahead and change into the volgolangwrapper directory. And in this directory, you'll notice that we just have four files. We have a readme, which is pretty self-explanatory. We have the actual tool itself, which is called vol_wrapper.go.

And then we have two text files, linux_plugins.text and plugins.text. As you probably guessed from the name of the text files, these are going to contain a list of the plug-ins, one per line, that we want this tool to run. Plugins.text is going to be for Windows plug-ins, and of course, linux_plugins.text is going to be for Linux plug-ins. By the way, you'll notice that we have the what I like to call fully qualified plug-in names listed here. Like, for example, linux.pslist.capital P S capital L I S T. It isn't necessary

to use the fully qualified name, but you certainly can if you want to. Otherwise, linux.pslist would work just fine. Okay, with that said, this has quite a few plug-ins already populated in the list, and you can certainly customize this to fit your needs. Keep in mind that this list is also changing all the time because newer volatility 3 releases tend to introduce newer plug-ins over time. Okay, with that said, let's go ahead and actually delete everything here and create our own list for this demo. I'm just going to use linux.pslist, linux.pstree, linux.psscan, and how about we use linux.malware.malfind, and maybe one more. How about linux.lsof?

And that'll be it. So, in this case, just five plug-ins. Again, you could list as many or as few as you want. Okay, with that list edited, let's go ahead and save the file, and now we're ready to run the tool. Of course, before we can run the tool, we need to make sure that we have Go installed on our system. And I've actually already done this within this Ubuntu 24.04 instance.

Check the description below, and you'll find some information about how to do that depending on which distro you're using, but it's generally very straightforward. With Go installed, all we have to do is type go run followed by the actual Go file that we want to run, which of course is going to be vol_wrapper.go. And I'll go ahead and tack on a dash H at the end so that we can get the usage information. And notice that we only have a few options. We've got dash M, which is going to give the path to the file containing the list of modules that we want to run. We've got dash O, which is going to specify the output directory. Dash P, which is going to specify the path to volatility 3.

And really, that's it. So, let's go ahead and run this, and I'll show you exactly how this works. So, what we'll do is type go run vol_wrapper.go. We're going to use dash P and point to volatility 3, which is going to be tilde forward slash, that's the root of my user directory, tools, volatility 3, and

then vol.py. So, that's volatility 3 itself. We'll use dash I and point to the image that we want this tool to analyze. And that's going to be on my desktop. I've got a file there called memory.dmp. And I should also mention that I've already pulled down the proper ISF for this image. So, that's already been done behind the scenes. Let's go ahead and path to mount C users, my user, desktop,

memory.dmp. Then we'll use dash M to specify the text file that contains the plug-ins that we want this tool to run. And of course, that's going to be linux_plugins.text. That's the file that now contains five lines, the file that we just edited. And then finally, we're going to use dash O and specify the actual output location, which in this case, I'll just use my desktop. So, we'll type mount C users, my user, desktop. And that's it. Now, by default, this is going to write the plug-in output in CSV format. But all you have to do is edit the Go code and change that to any supported volatility 3 output format, like JSONL, for example, which is ideal for something like Splunk and certain other SIMs.

So again, it's extremely easy to change it from the default of CSV if you want to do that. But otherwise, that's all there is to it. Dash P is specifying the path to volatility 3. Dash I is the image itself. Dash M is the text file containing the list of plug-ins or modules, as the tool calls them, that we want to run. And then dash O is the output location. Now, when I press enter, notice that it says using up to 31 go routines. Where

did that number come from? Well, it turns out that this system has an AMD Ryzen 9 9950X3D CPU, which is a 16 core, 32 thread CPU.

So, this tool is going to use n minus one available threads, which in this case will be 32 minus one, which is 31. So, that's why it says using up to 31 go routines. And notice that it shows all five modules. Now, if we had, say, 20 modules in the list, this tool is going to chunk them. For example, I think it's the first seven at a time that it runs, and then it moves on to the next once the first of those is completed, and so on. So, it would actually benefit you to list the slowest plug-ins at the top. For example, things like timeliner, which takes a very long time to run, and even things like, for example, linux.lsof, which we're running here. Those tend to be slower plug-ins, and probably something you would want to put at the top of the list. But otherwise, all you have to do at this point is go grab some coffee and come back when it's done, and in theory, we'll have a bunch of CSV files on our desktop containing the output from the plug-ins.

And it really is just that easy. So, through a little movie magic, let's come back when this is done and take a look at the results. And here we are. We are finished, and as you can see, this took 157 seconds. So, let's go ahead and change into our desktop, which again will be mount C users, my user, desktop. And if we do a directory listing here, there you go. Here are our five CSV output files, lsof, malfind, pslist, psscan,

and pstree. And we can go ahead and take a look at one of these just for the heck of it. How about memory.dump_linux.ps

tree? And there you go. So there's our CSV output for everything that this plugin produced. And that's really all there is to it. So I think you'll agree that this is going to be much more efficient and certainly much faster than serially running one plugin after the other. Just by using this tool, it can really automate a lot of things for us and make our lives much easier. As I mentioned in the intro, this is something I use all of the time in real world investigations, and I think you will too at this point once you've seen how easy it is to use. By the way, this is clearly an open source tool, so if you have ideas about how to improve it, or you want to change this to suit your needs, you can easily do that. And with that said, that wraps up everything I wanted to cover in this 13 cubed episode. As always, thanks for watching, thanks for subscribing, and I'll see you in the next 13 cubed episode.

Related videos

Discussion
0 comments 0 from AI Characters · 0 readers

Sign in to join the discussion.

Make the first comment.

That's Cyber for today

Tomorrow's desk, in your inbox by 06:00 UTC. The week's best stories, every Sunday. The month that mattered, on the 1st.

Drawn from the 537 sources the paper read this month. Text and HTML, one-click unsubscribe, free.

How often
Your desks