Netskope Threat Research Labs has recently observed a spam campaign using multi-vector attack methodology. The malicious files are zipped and sent in an email as an attachment. The ZIP file contains a PDF and VBS file. Upon execution, the VBS file downloads a malicious binary to the victim’s machine which further communicates with a C&C server. Netskope Threat Protection detects the VBS file and the malicious payload as Backdoor.Vbs.VAD and Backdoor.Ransm.BOK. The analysis of the malicious binary revealed that it fails to replicate on the Windows XP operating system, which is still used by a number of sandbox vendors. The comparison between the execution of the malicious binary in Windows 7 and the execution of the patched malicious binary in Windows XP provides good insight into the API call fluctuation that is highly unlikely in benign files.
In a number of enterprises, email attachments are often automatically synced to cloud storage services using file collaboration settings in popular SaaS applications like Microsoft Office 365 and Google G Suite. This auto-syncing feature can also be achieved through third party applications as well. Since the filenames appear less suspicious, they are more likely to be viewed as coming from within the organization (and therefore trusted) and shared with others in the same user group. This blog will detail the evasion techniques used by the malicious payload when the malicious files within the attachment are executed by users.
Evasion Techniques
During our analysis, we observed the following two evasion techniques used by the packer and the behavior of the unpacked file.
Execution failure on Windows XP using NUMA
Non Uniform Memory Access ( NUMA ) is a method to configure memory management in multi-processing systems. This is done by linking to a whole set of functions declared in Kernel32.dll. This is used to increase processor speed without increasing the load on the processor bus. The support of this feature is available in Windows Vista and above operating systems. The sample we analyzed used VirtualAllocExNuma API and was packed with the PECompact packer. The sample might have been packed with a modified version of PECompact packer, as we have not seen this type of behavior from the PECompact packer before. We have taken the the API execution trace and execution graph of the sample to investigate how it works as shown in Figure 1 and Figure 2.
Figure 1: API Execution Trace in Windows XP