Morphisec has been tracking an uptick in the delivery of Ursnif/Gozi during the COVID-19 pandemic. Specifically, we have noticed a significant spike both in numbers and sophistication. The latest delivery methods will many times involve old-school Excel 4.0 macro functionality, which historically is a blind spot for AV detection as it has nothing to do with the VBA macro engine and is integrated as part of the workbook. INQUEST reported the use of similar techniques as part of a Zloader delivery campaign. Interestingly, in the latest campaign, it looks like the malware writers removed the image from the Excel document to avoid OCR heuristic detection following the INQUEST article.
Excel 4.0 was released in 1992, ready for use on Windows 3.0 and 3.1. At its release, Excel 4.0 featured the ability to use macro worksheets as a way to deploy XLM macros for automation. The feature worked well enough and enabled backwards compatibility up to Excel 4.0. The following year, Visual Basic for Applications (VBA) macros were released in Excel 5.0, and macro worksheets were phased out.
As with many other backward-compatible enabled features, these macro worksheets provide plenty of offensive opportunities, seeing as they still function within the current build of Excel. Most of the functionality you can do with VBA can also be achieved using XLM macros, including access to the Win32 API, integrated as part of .xlm, .xls, and .xlsm files. This makes the functionality a viable attack vector for Excel worksheets delivered via social engineering emails.
We observed this specific campaign, starting at the beginning of January, that uses advanced obfuscation techniques to evade detection. Many of the files have a .xlsm extension and have less than a 3 detection score. A score of less than 3 is not a high enough threshold for a static heuristic-based approach to classify the file as suspicious (not even talking about malicious). For this reason, many detection-based solutions miss this type of file.
Figure 1 — Low VirusTotal detection rate
The file content asks the victim to enable editing and content in written text rather than an image as mostly seen in these campaigns. Our assumption is that the attacker is trying to evade OCR heuristic detection methods.
Figure 2 — Asks the victim to enable content by text
In this campaign, the sheet hidden state is set to Hidden. The auto-open sheet can be found by looking at the Name Manager option under Formulas.
Figure 3 — Auto-Open Cell
The macro worksheet is heavily obfuscated and will start with a number of “RUN” commands that eventually ends with several interesting commands such as “CALL” and “EXEC”.
Figure 4 — The obfuscated CALL commands
@DissectMalware wrote a tool that deobfuscates these Excel 4 macros. Looking at the output of the tool, we can see the pattern below.
Figure 5 — Deobfuscated commands.
The macro utilizes the Win32 API function to download the next stage. In this case, it is Gozi.
Ursnif/Gozi continues to change and evolve, showing that threat actors are increasingly looking for any opportunity they might have to evade detection solutions. Morphisec’s customers can be confident that they are protected against the malicious Excel macros delivered by Ursnif/Gozi and others.
*** This is a Security Bloggers Network syndicated blog from Morphisec Moving Target Defense Blog authored by Arnold Osipov. Read the original post at: https://blog.morphisec.com/ursnif/gozi-delivery-old-school-excel-macro-4.0-utilization-uptick-and-the-ocr-heuristics-bypass