11 Dec 2025
The first chapter in Practical Malware Analysis discusses the basics of static/dynamic analysis including the Portable Executable (PE) format, static/dynamic/runtime linking (DLLs), and packing/obfuscation. This chapter introduced some basic tools for static analysis of PE files such as PEView, Resource Hacker, and Dependency Walker. Four malware samples are included to reinforce what was taught in the chapter and gain some familiarity with the tools.
The first malware sample consists of one executable and one DLL. We are asked several questions regarding PE file contents to become familiar with their structure and the PEView tool.
Unfortunately none of the samples can be uploaded to Virus total using the recommended Windows XP VM. Even the version of the website designed for older browsers still includes a Captcha, making it incompatible.
When I reached Chapter 5 I was forced to install a Windows 10 VM to use IDA Pro, so I was able to come back here and upload these samples to Virus Total. The executable was flagged as malicious by 57/72 vendors:
The DLL was flagged by 40/72:
Here I get to use PEView for the first time to inspect PE headers. Looking at IMAGE_NT_HEADERS/IMAGE_FILE_HEADER, we can see that both of these files were compiled on 12/19/2010.
Looking at the IMAGE_SECTION_HEADER data for all of the sections, there is nothing that indicates packed files. If these were packed, the virtual size would appear much larger than the raw data size because of the unpacking process.

However, there is something interesting in the .rdata IMPORT table from the DLL file. Ten functions are imported from WS2_32.dll, but they are imported by ordinal instead of name, which disguises their purpose. Opening C:\Windows\system32\ws2_32.dll in PEView and looking at the EXPORT table in the .text section allows a cross-reference of the ordinal values and their name. This DLL includes functions for network communication and a few can be seen here:

Looking at IMPORT table from the .rdata section for the executable shows that functions are imported from msvcrt.dll and kernel32.dll. The Visual C-runtime (msvcrt.dll) functions all look pretty standard, but there are some functions from kernel32.dll which show file manipulation functions:
These functions, combined with the obfuscated functions from the DLL identified earlier indicate that this sample has the ability for network communication and file manipulation.
In the .data section of the executable, there is a string "kerne132.dll", with the number one in the name meant to look like a lowercase L:

WARNING_THIS_WILL_DESTROY_YOUR_MACHINE might be another good indicator 😂
This filename would be a good indicator for not only this malware, but possibly others as well.
There is another suspicious string in the .data section of the DLL which looks like an IP address:
Traffic to/from the IP address 127.26.152.13 would be a strong network-based indicator of this malware.
The executable imports functions for creating, finding, and copying files. This is where the kerne132.dll and system32 path strings are located, leading me to believe that the purpose of this file is to create the kernel32.dll lookalike and copy it to C:\Windows\system32. The included DLL (not kerne132) imports functions for process manipulation and networking communication.
The fact that the executable never imports the DLL and neither file imports the newly-created kerne132.dll leads me to believe that kerne132.dll will import the process manipulation and networking functions from the included DLL. All of these functions combined could be used for a backdoor.
This sample includes just one executable, which appears to be packed.
This sample was flagged as malicious by 59/72 vendors:
Instead of the usual names like .text, .data, etc., sections have been renamed to UPX0, UPX1, and UPX2, indicating that this sample was packed using UPX. Sections with a virtual size much larger than the raw data size also indicate packing.
Functions are imported for virtual memory allocation, service creation, and internet connectivity.
Because this binary is packed, strings in the .data section are corrupted and cannot be used for identification:
To unpack this file, I was able to download UPX from GitHub and fortunately it still works on XP!
With the binary unpacked, plaintext strings are now visible:
The strings that have been revealed appear to be arguments for the imported functions such as CreateServiceA and InternetOpenA. Indicators used to identify the presence of this sample would be processes named Malservice or network traffic to/from http://malwareanalysisbook.com.
This sample is another packed executable.
This sample was flagged as malicious by 65/71 vendors:
This sample also has sections with virtual sizes much larger than the raw data size. However, on this sample the section names are missing entirely and the packing method is unknown:
Analyzing this sample with PEiD shows that it is packed using FSG:
This sample also does not list any imports when viewed in PEView. The only indication of any of its functionality are a DLL name and a couple functions, but not enough to make any sense of:
Unfortunately this sample is too heavily-obfuscated to gather any useful indicators and cannot be directly unpacked using the methods learned so far. Referencing the lab solutions for this sample confirms that this was the expected result and that this sample will be re-visited in a later chapter using more advanced analysis techniques.
This sample is an executable which appears to have more functionality than any of the previous samples.
This sample was flagged as malicious by 62/71 vendors:
The naming of sections appears normal with no indication of packing when comparing virtual and raw data sizes. There is also no evidence of obfuscation.
This sample was compiled on 8/30/2019:
Many of the imports are focused on process/resource/file manipulation. Of particular interest is the AdjustTokenPrivileges function imported from ADVAPI32.dll, which may indicate privilege escalation:
Looking at the .data section reveals many concerning targets for the imported functions:
Looking at this resource, it appears to be a binary which was embedded:
Because of this, I chose to save it in that format:
And then open this new binary in PEView, where it can be seen that it downloads and executes a file:
Which is http://practicalmalwareanalysis.com/updater.exe:
And that's the end of the Chapter 1 labs! This was a great overview of PE files and their structure, which was something I had read about in my Malware Analysis course, but getting this hands-on practice really improved my understanding. I am actually happy that I was not able to upload to VirusTotal the first time around because it gives a very detailed description of how each sample works, which would have undermined the learning experience. I'm assuming VirusTotal did not have this functionality at the time PMA was written.