A new variant of the Ursnif trojan has been discovered targeting Japan since the beginning of 2019. Japan is a common target for Ursnif, but the latest version, delivered by Bebloh, goes to increased lengths to ensure that the victim is indeed Japanese.
New variants of Ursnif are not uncommon since the source code was leaked in 2015, but this version also includes enhanced data theft modules for stealing data from mail clients and email credentials stored in browsers. Other new developments, according to Cybereason research, include a new stealthy persistence module, a cryptocurrency and disk encryption module, and an anti-PhishWall (a Japanese security product) module.
The infection chain starts with delivering Bebloh via a weaponized Office document. If activated, a VBA macro in the document first conducts extensive location tests. These tests are expanded and modified over earlier versions, making them more difficult to interpret — but using a technique also seen in a campaign against Italian targets this year.
If the target computer passes the location tests, a PowerShell payload is activated. This includes a final IP geolocation check. It then downloads Bebloh hidden steganographically in an image downloaded from an image sharing website such as imgur or postimage.cc. Bebloh is injected into explorer.exe and it downloads Ursnif’s loader from the C2 server.
The Ursnif loader conducts further tests to ensure that the victim is a genuine user and not a disguised researcher. These include a Xeon CPU check, a virtualization vendor check, and a timing check to force a VM exit. If any of these checks prove positive, the loader displays an error message and terminates the process. But if all is well, Ursnif’s core DLL is injected into the main explorer.exe process.
The payload seems to be Gozi ISFB v3. Its compilation date is February 22, 2019. However, Cybereason has found an earlier sample of the same variant timestamped July 2018, suggesting that the variant first emerged in 2018.
Code analysis suggests that this version is related to the Dreambot variant of Ursnif, but with some features removed and others added. Gone, for example, are the Tor client and the VNC module. New or revamped features include a new last-minute persistence feature (resembling that used by Dridex); new data theft modules to steal from IE, Outlook and Thunderbird; a cryptocurrency and disk encryption software module; and an anti-PhishWall module.
‘Persistence’ is created at the last minute before system shutdown. When the system is rebooted, persistence is activated and Ursnif is re-run. Persistence is then deleted to lower the chance of detection, and only recreated when the system is shut down.
The new variant’s mail stealing functionality has been enhanced and expanded. For example, the Outlook stealer has been enhanced to locate Microsoft Outlookís .PST and .OST file extensions. A new module has been added to steal Thunderbird login credentials and the Thunderbird personal address book. A new Internet Explorer module will steal autocomplete typed URLs and data (including credentials, and the IE browsing history.
It also adds functionality that seems to be designed to steal cryptocurrency from wallets, including the Electrum Bitcoin wallet, Bitcoin wallet, Multibit-hd, Bither Bitcoin wallet, mSigna Bitcoin wallet, Jaxx multi-currency digital wallet, and Bitcoin Armory wallet.
This version of Ursnif also adds some anti-security product capabilities aimed at defeating PhishWall and Rapport. PhishWall is a popular Japanese anti-phishing and anti-banking trojan application, and anti-PhishWall modules have been used by other trojans in the past (such as Shifu and Bebloh).
The anti-Rapport module is designed to defeat IBM Trusteer’s Rapport product. This is not new, but not often seen in malware targeting Japan. The code seems to be based on — if not copy/pasted from — Carberp’s anti-Rapport code (which is freely available on GitHub). Cybereason notes that it has tested neither the PhishWall nor the Rapport module, so cannot attest to their efficiency.
Cybereason is unsurprised by the new concentration on data stealing highlighted by the new version of Ursnif. “With more and more banking customers shifting to mobile banking and the continuous hardening of financial systems,” writes the researcher, “it is not surprising that trojans are beginning to focus more than ever before on harvesting non-financial data that can also be monetized and exploited by the threat actors.”
But what stands out from this campaign, he adds, “is the great effort made by threat actors to target Japanese users. They use multiple checks to verify that the targeted users are Japanese, as opposed to other more prolific trojans and information stealers that cast a wider net when it comes to their victims.”