Netskope Threat Research Labs has been tracking multiple similar malspam campaigns that began in April 2019. The spam campaign contains an ISO image file as an attachment containing the next level payload. This blog post details both the campaign and the payload.
MalSpam Campaign
The malspam campaign began in April 2019, with a generic message about an invoice and an ISO disk image file attachment. The generic message indicates that the spam campaigns are not targeted toward any particular individuals or enterprises. Figure 1 below shows an example snapshot of a malspam email containing an ISO file as an attachment.
We first noticed these malspam campaigns when our outbreak detection system alerted us to an unusual filetype showing up in multiple detections — the ISO disk image format. The samples were detected due to the samples of LokiBot and NanoCore that they contained. To date, we have uncovered 10 variants of this campaign, using different ISO images and emails.
Targeting such uncommon file formats gives an advantage to the malware authors as ISO files are usually allow listed from scanning in various email security solutions to improve efficiency. Also, major operating systems now have default software which automatically detects and mount the ISO image once the user clicks on it. This again makes it a preferred target for the scammers. The observed ISO files were in the size range of 1MB to 2MB which is an unusual file size for image files; usually, their sizes are in the upwards of 100MB. The image contains only one executable file embedded in it which is the actual malware payload. Instances of similar spam campaigns have been reported in the past where keyloggers and other information stealing payloads were being dropped onto the infected machines. The cases encountered during our analysis were mainly related to LokiBot and NanoCore remote administrative tools. Netskope’s advanced threat protection suit detects these files as Trojan.GenericKD.41227940 and Trojan.GenericKD.40782328.
Payload Analysis
LokiBot
There is a growing trend in using LokiBot as the delivery payload across a wide range of spam campaigns, the most recent one being reported here. The current version of Loki is similar to its previous versions, with only slight modifications in the anti-reversing techniques implemented in the bot. The sample analyzed, in this case, used the IsDebuggerPresent() function to determine if it is loaded inside a debugger. It also implemented a common anti-VM technique, measuring the computational time difference between CloseHandle() and GetProcessHeap() to detect if it is running inside a VM (the time difference will be large in case of a VM). Figure 2 shows how this looks in the disassembled code.
Once the codes for anti-reversing are patched, the malware sample unpacks it in the memory, as shown in Figure 3. The unpacked binary is an executable program coded in Visual Basic.
Once the malware infects the system it performs the following operations:
- Query system GUID information
- Perform process hollowing and launch a child process.
- Delete the parent process, leaving the child orphaned and in running state.
Once the infection process is complete, the sample then launches its stealer functions which have the capability to:
- Probe more than 25 different web browsers to steal various browsing information.
- Check for the presence of web or email servers running on the machine.
- Locate credentials for 15 different email and file transfer clients.
- Check for the presence for popular remote admin tools like SSH, VNC, and RDP.
Figure 4 below depicts a summary of malware’s behavior captured by our Advanced Heuristic analysis engine.
NanoCore RAT
We have previously blogged about NanoCore RAT in a completely different campaign where cloud storage services were used to host malicious PDF documents dropping a variant of this RAT. Netskope’s advanced threat protection suit detected these files as Trojan.GenericKD.40782328. Like our previous analysis, this version of NanoCore was also built using AutoIT as a top-level wrapper for the main .NET compiled binary.
The decompiled AutoIT script is heavily obfuscated and constructs the actual .NET binar