A key component of any digital forensic investigation is malware reverse engineering (MRE). MRE involves locating malware on a system, decompiling that malware, and then breaking down the functions within the code. This is an important piece of the digital forensics process. Understanding the code, what it does, and how it is written allows investigators to determine possible system impacts and assign threat attribution.
After capturing a forensic image, the next part of the process is determining executables and binaries. These files will be the ones we need to check in our Decompiler. Using tools like Autopsy can assist in this process. Once a file is found, you can export it with the export tool within Autopsy by right-clicking the file and choosing to export and save. [1]
Note: It is recommended that files exported be touched only within a virtual machine environment.
There are a number of ways to decompile malware once you’ve obtained a file. Some popular tools are Gnu Project Debugger (GDB), Ghidra, and Binary Ninja. While both Ghidra and Binary Ninja can be installed on a Windows machine, it is recommended that these tools only ever be used on a VM. [2] GDB comes preinstalled on Kali Linux, and Ghidra can be installed on Linux as well. All these tools provide similar functionality, with the main differences being the workflow used to analyze the code provided.
Once your file is processed, you can begin to determine the program flow. Program flow is just the steps that are taken while the “main” function runs. Determining program flow is important to determine the impact the program might have and what resources or servers it is trying to access. There are many ways to work through a program, but the best is to start programmatically by following the main program from top to bottom and stepping out to another function whenever it’s called. [3] The difficult part will be determining how the program works and what each function is doing. There is no particular way to do this other than to understand how the decompiler you’re using works and how it names objects. [4] As noted before, each compiler works differently and utilizes different workflows, so stick with one and try to learn it as best as possible.
Conclusion
MRE is another key tool for a digital forensic analyst. Analyzing and understanding what malware might have done to a system or network can help build a more accurate picture of a case. This will be important when creating reports and responding to events in order to provide the best response possible. Having a complete and accurate report is important to guide mitigation and recovery plans.