# Chthonic: a new modification of ZeuS **[securelist.com/chthonic-a-new-modification-of-zeus/68176/](https://securelist.com/chthonic-a-new-modification-of-zeus/68176/)** Authors [Yury Namestnikov](https://securelist.com/author/yurynamestnikov/) [Vladimir Kuskov](https://securelist.com/author/vladimirkuskov/) Oleg Kupreev In the fall of 2014, we discovered a new banking Trojan, which caught our attention for two reasons: First, it is interesting from the technical viewpoint, because it uses a new technique for loading modules. Second, an analysis of its configuration files has shown that the malware targets a large number of online-banking systems: over 150 different banks and 20 payment systems in 15 countries. Banks in the UK, Spain, the US, Russia, Japan and Italy make up the majority of its potential targets. Kaspersky Lab products detect the new banking malware as Trojan-Banker.Win32.Chthonic. ----- The Trojan is apparently an evolution of ZeusVM, although it has undergone a number of significant changes. Chthonic uses the same encryptor as Andromeda bots, the same encryption scheme as Zeus AES and Zeus V2 Trojans, and a virtual machine similar to that used in ZeusVM and KINS malware. ## Infection We have seen several techniques used to infect victim machines with TrojanBanker.Win32.Chthonic: sending emails containing exploits; downloading the malware to victim machines using the Andromeda bot (Backdoor.Win32.Androm in Kaspersky Lab classification). When sending messages containing an exploit, cybercriminals attached a specially crafted RTF document, designed to exploit the [CVE-2014-1761 vulnerability in Microsoft Office](http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-1761) products. The file has a .DOC extension to make it look less suspicious. _Sample message with CVE-2014-1761 exploit_ In the event of successful vulnerability exploitation, a downloader for the Trojan was downloaded to the victim computer. In the example above, the file is downloaded from a compromised site – hxxp://valtex-guma.com.ua/docs/tasklost.exe. The Andromeda bot downloaded the downloader from hxxp://globalblinds.org/BATH/lider.exe. ## Downloading the Trojan ----- Once downloaded, the downloader injects its code into the msiexec.exe process. It seems that the downloader is based on the Andromeda bot’s source code, although the two use different communication protocols. _Example of common functionality of Andromeda and Chthonic downloaders_ _Differences in communication protocols used by Andromeda and Chthonic C&C_ The Chthonic downloader contains an encrypted configuration file (similar encryption using a virtual machine was used in KINS and ZeusVM). The main data contained in the configuration file includes: a list of С&С servers, a 16-byte key for RC4 encryption, UserAgent, botnet id. ----- _The main procedure of calling virtual machine functions_ After decrypting the configuration file, its individual parts are saved in a heap – in the following format: This is done without passing pointers. The bot finds the necessary values by examining each heap element using the RtlWalkHeap function and matching its initial 4 bytes to the relevant MAGIC VALUE. The downloader puts together a system data package typical of ZeuS Trojans (local_ip, bot_id, botnet_id, os_info, lang_info, bot_uptime and some others) and encrypts it first using XorWithNextByte and then using RC4. Next, the package is sent to one of the C&C addresses specified in the configuration file. In response, the malware receives an extended loader – a module in a format typical of ZeuS, i.e., not a standard PE file but a set of sections that are mapped to memory by the loader itself: executable code, relocation table, point of entry, exported functions, import table. _Code with section IDs matching the module structures_ It should be noted that the imports section includes only API function hashes. The import table is set up using the Stolen Bytes method, using a disassembler included in the loader for this purpose. Earlier, we saw a similar import setup in Andromeda. ----- _Fragment of the import setup function in Andromeda and Chthonic_ _Header of a structure with module_ The extended loader also contains a configuration file encrypted using the virtual machine. It loads the Trojan’s main module, which in turn downloads all the other modules. However, the extended loader itself uses AES for encryption, and some sections are packed using UCL. The main module loads additional modules and sets up import tables in very much the same way as the original Chthonic downloader, i.e. this ZeuS variant has absorbed part of the Andromeda functionality. The entire sequence in which the malware loads, including the modules that are described below, is as follows: ----- ## Modules Trojan-Banker.Win32.Chthonic has a modular structure. To date, we have discovered the following modules: **Name** **Description** **Has a 64bit version** **main** Main module (v4.6.15.0 – v4.7.0.0) Yes **info** Collects system information Yes **pony** Module that steals saved passwords No **klog** Keylogger Yes **http** Web injection and formgrabber module Yes **vnc** Remote access Yes **socks** Proxy server Yes **cam_recorder** Recording video from the web camera Yes The impressive set of functions enables the malware to steal online banking credentials using a variety of techniques. In addition, VNC and cam recorder modules enable attackers to connect to the infected computer remotely and use it to carry out transactions, as well as recording video and sound if the computer has a webcam and microphone. ## Injections ----- Web injections are Chthonic s main weapon: they enable the Trojan to insert its own code and images into the code of pages loaded by the browser. This enables the attackers to obtain the victim’s phone number, one-time passwords and PINs, in addition to the login and password entered by the victim. For example, for one of the Japanese banks the Trojan hides the bank’s warnings and injects a script that enables the attackers to carry out various transactions using the victim’s account: _Online banking page screenshots before and after the injection_ _Interesting functions in injected script_ The script can also display various fake windows in order to obtain the information needed by the attackers. Below is an example of a window which displays a warning of non-existent identification problems and prompts the user to enter TAN: ----- _Fake TAN entry window_ Our analysis of attacks against customers of Russian banks has uncovered an unusual web injection scenario. When opening an online banking web page in the browser, the entire contents of the page is spoofed, not just parts of it as in an ordinary attack. From the technical viewpoint, the Trojan creates an iframe with a phishing copy of the website that has the same size as the original window. Below is a fragment of injected code, which replaces everything between title and body closing tags with the following text: And here is the script itself: ----- Additionally, the bot receives a command to establish a backconnect connection if the injection is successful: ## Coverage There are several botnets with different configuration files. Overall, the botnets we are aware of target online banking systems of over 150 different banks and 20 payment systems in 15 countries. The cybercriminals seem most interested in banks in the UK, Spain, the US, Russia, Japan and Italy. ----- _Chtonic target distribution by country_ It is worth noting that, in spite of the large number of targets on the list, many code fragments used by the Trojan to perform web injections can no longer be used, because banks have changed the structure of their pages and, in some cases, the domains as well. It should also be noted that we saw some of these fragments in other bots’ config files (e.g., Zeus V2) a few years back. ## Conclusion We can see that the ZeuS Trojan is still actively evolving and its new implementations take advantage of cutting-edge techniques developed by malware writers. This is significantly helped by the ZeuS source code having been leaked. As a result, it has become a kind of framework for malware writers, which can be used by anyone and can easily be adapted to cybercriminals’ new needs. The new Trojan – Chthonic – is the next stage in the evolution of ZeuS: it uses Zeus AES encryption, a virtual machine similar to that used by ZeusVM and KINS, and the Andromeda downloader. What all of this means is that we will undoubtedly see new variants of ZeuS in the future. ## A few md5: ----- 12b6717d2b16e24c5bd3c5f55e59528c 148563b1ca625bbdbb60673db2edb74a 6db7ecc5c90c90b6077d5aef59435e02 5a1b8c82479d003aa37dd7b1dd877493 2ab73f2d1966cd5820512fbe86986618 329d62ee33bec5c17c2eb5e701b28639 615e46c2ff5f81a11e73794efee96b38 77b42fb633369de146785c83270bb289 78575db9f70374f4bf2f5a401f70d8ac 97d010a31ba0ddc0febbd87190dc6078 b670dceef9bc29b49f7415c31ffb776a bafcf2476bea39b338abfb524c451836 c15d1caccab5462e090555bcbec58bde ceb9d5c20280579f316141569d2335ca d0c017fef12095c45fe01b7773a48d13 d438a17c15ce6cec4b60d25dbc5421cd [Financial malware](https://securelist.com/tag/financial-malware/) [Trojan Banker](https://securelist.com/tag/trojan-banker/) [Vulnerabilities and exploits](https://securelist.com/tag/vulnerabilities-and-exploits/) [ZeuS](https://securelist.com/tag/zeus/) Authors [Yury Namestnikov](https://securelist.com/author/yurynamestnikov/) [Vladimir Kuskov](https://securelist.com/author/vladimirkuskov/) Oleg Kupreev Chthonic: a new modification of ZeuS Your email address will not be published. Required fields are marked * -----