In this article, we will present an extensive email security attack that uses Excel 4.0 macros (XLM) to deliver Qakbot malware. Qakbot is a modular information stealer whose original purpose was primarily as a banking Trojan but currently serves as a loader for other crimeware.
In this campaign, the attacker conceals the malicious payload by embedding it deeply with other pieces of content. The attacker sends a malicious email containing a URL, which retrieves a zip file with the target’s name as the file name. This zip archive contains a malicious Excel document (xls) that, when opened, runs an Excel 4.0 macro code that downloads and executes a malicious DLL/Qakbot malware to the user’s machine.
The attacker impersonates a person the user knows in an attempt to gain trust and deceive him. He sends an email in the native language of the user, with a URL ending with the user’s name + .zip extension. In order to make the email look more authentic, the attacker may add real email conversations between the user and the person impersonated by the attacker.
The link is non-clickable, which means the user has to copy and paste it into his browser. This is an evasion technique used against email security solutions.
The emails have been sent in many different languages, which indicates a widespread attack to different geolocations.
How is the zip name generated?
First, let’s take the following URL as an example:
After browsing to this link, we get redirected to:
And then a zip file is downloaded automatically with the name ‘dan.zip’. The malicious excel, containing hidden XLM code, is found inside the zip file.
If the same user will try to download the file again, they will receive the following error:
This happens because the server stores all the IP addresses that already accessed the link, and prevents more than one download per IP which is an evasion technique from the attacker.
However, while investigating the URL, it was discovered that the malicious server was accessible without any authentication.
The server log files contains all of the infected computers’ IP addresses.
We downloaded more than 30 samples of malicious zip files from one of the malicious URLs and have found that the hashes were different for each file. When comparing between the files, we saw that the differences were minimal.
Changing the hash of each individual file is a technique used by the attacker to evade signature/ioc based detection.
The embedded Excel 4.0 macro code itself is similar to previous attacks we have previously reported – it downloads and executes a malicious DLL. This time, the DLL payload is the Qakbot Trojan, also known as QBOT.
The malware uses a process injection method known as process hollowing, thereby injecting itself into explorer.exe process, where it creates a scheduled task in order to achieve persistence, and later connects to a C&C server.
Perception Point Approach.
This attack was detected using the multiple protection layers in the Perception Point platform.
- The Recursive Unpacker, an anti-evasion layer, instantaneously extracted all files
- Static engines detected the utilization of malicious Excel 4.0 macros
- The HAP engine, a dynamic engine that combines CPU-level data with advanced software algorithms, identified the malicious behavior of the spreadsheet and its content.
In addition, the platform searches for and scrapes non-clickable links which enables the detection of the URLs in the scanned emails.
- Educate your employees about email security and on the risk of browsing to unknown URLs and downloading files from unknown sources.
- Always check the authenticity of the sender by checking if the display name and the email address match.
- Use an advanced email security solution with dynamic scanning and anti-evasion mechanisms to reduce the risks of cyber-attacks.
List of initial zip download URLs:
List of DLL payload download URLs:
List of malicious DLL hashes (SHA256):
List of C&C Servers: