Attackers use sophisticated malware to attack Russian businesses

Since the end of last year, we have begun monitoring a new malicious campaign to spread a banking Trojan. The attackers focused on compromising Russian companies, i.e. corporate users. The malicious campaign was active for at least a year, and in addition to the banking Trojan, the attackers resorted to using various other software tools. These include a special bootloader packaged using NSIS, and spyware that is disguised as the well-known legitimate Yandex Punto software. As soon as the attackers managed to compromise the victim's computer, they install a backdoor there, and then a banking Trojan.

Attackers use sophisticated malware to attack Russian businesses

For their malware, the attackers used several valid (at the time) digital certificates and special methods to bypass AV products. The malicious campaign was targeted at a large number of Russian banks and is of particular interest because the attackers used methods that are often used in targeted attacks, i.e. attacks not motivated by purely financial fraud. One can note some similarities between this malicious campaign and a major incident that received much publicity earlier. We are talking about a cybercriminal group that used a banking Trojan Anunak/Carbanak.

Π—Π»ΠΎΡƒΠΌΡ‹ΡˆΠ»Π΅Π½Π½ΠΈΠΊΠΈ устанавливали врСдоносноС ПО Ρ‚ΠΎΠ»ΡŒΠΊΠΎ Π½Π° Ρ‚Π΅ ΠΊΠΎΠΌΠΏΡŒΡŽΡ‚Π΅Ρ€Ρ‹, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ использовали русский язык Π² Windows (локализация) ΠΏΠΎ ΡƒΠΌΠΎΠ»Ρ‡Π°Π½ΠΈΡŽ. ΠžΡΠ½ΠΎΠ²Π½Ρ‹ΠΌ Π²Π΅ΠΊΡ‚ΠΎΡ€ΠΎΠΌ распространСния трояна Π±Ρ‹Π» Π΄ΠΎΠΊΡƒΠΌΠ΅Π½Ρ‚ Word с эксплойтом CVE-2012-0158, which was sent as an attachment to the document. The screenshots below show the appearance of such fake documents. The first document is entitled β€œAccount No. 522375-FLORL-14-115.doc”, and the second β€œkontrakt87.doc”, it is a copy of the contract for the provision of telecommunications services by the mobile operator Megafon.

Attackers use sophisticated malware to attack Russian businesses
Rice. 1. Phishing document.

Attackers use sophisticated malware to attack Russian businesses
Rice. 2. Another modification of the phishing document.

The following facts indicate that the attackers were targeting Russian business:

  • distribution of malicious software using fake documents of the specified subject;
  • tactics of attackers and the malicious tools they use;
  • links to business applications in some executable modules;
  • names of malicious domains that were used in this campaign.

Π‘ΠΏΠ΅Ρ†ΠΈΠ°Π»ΡŒΠ½Ρ‹Π΅ ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½Ρ‹Π΅ инструмСнты, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ Π·Π»ΠΎΡƒΠΌΡ‹ΡˆΠ»Π΅Π½Π½ΠΈΠΊΠΈ ΡƒΡΡ‚Π°Π½Π°Π²Π»ΠΈΠ²Π°ΡŽΡ‚ Π² скомпромСтированной систСмС, ΠΏΠΎΠ·Π²ΠΎΠ»ΡΡŽΡ‚ ΠΈΠΌ ΠΏΠΎΠ»ΡƒΡ‡Π°Ρ‚ΡŒ ΡƒΠ΄Π°Π»Π΅Π½Π½Ρ‹ΠΉ ΠΊΠΎΠ½Ρ‚Ρ€ΠΎΠ»ΡŒ Π·Π° систСмой ΠΈ ΠΎΡ‚ΡΠ»Π΅ΠΆΠΈΠ²Π°Ρ‚ΡŒ Π΄Π΅ΡΡ‚Π΅Π»ΡŒΠ½ΠΎΡΡ‚ΡŒ ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Ρ. Для выполнСния этих Ρ„ΡƒΠ½ΠΊΡ†ΠΈΠΉ ΠΎΠ½ΠΈ ΡƒΡΡ‚Π°Π½Π°Π²Π»ΠΈΠ²Π°ΡŽΡ‚ бэкдор, Π° Ρ‚Π°ΠΊΠΆΠ΅ ΠΏΡ‹Ρ‚Π°ΡŽΡ‚ΡΡ ΠΏΠΎΠ»ΡƒΡ‡ΠΈΡ‚ΡŒ ΠΏΠ°Ρ€ΠΎΠ»ΡŒ ΠΎΡ‚ Π°ΠΊΠΊΠ°ΡƒΠ½Ρ‚Π° ΡƒΡ‡Π΅Ρ‚Π½ΠΎΠΉ записи Windows ΠΈΠ»ΠΈ ΡΠΎΠ·Π΄Π°Ρ‚ΡŒ Π½ΠΎΠ²Ρ‹ΠΉ Π°ΠΊΠΊΠ°ΡƒΠ½Ρ‚. Π—Π»ΠΎΡƒΠΌΡ‹ΡˆΠ»Π΅Π½Π½ΠΈΠΊΠΈ Ρ‚Π°ΠΊΠΆΠ΅ ΠΏΡ€ΠΈΠ±Π΅Π³Π°ΡŽΡ‚ ΠΊ услугам ΠΊΠ΅ΠΉΠ»ΠΎΠ³Π³Π΅Ρ€Π° (ΠΊΠ»Π°Π²ΠΈΠ°Ρ‚ΡƒΡ€Π½ΠΎΠ³ΠΎ шпиона), похититСля ΠΈΠ½Ρ„ΠΎΡ€ΠΌΠ°Ρ†ΠΈΠΈ ΠΈΠ· Π±ΡƒΡ„Π΅Ρ€Π° ΠΎΠ±ΠΌΠ΅Π½Π° Windows (clipboard stealer), Π° Ρ‚Π°ΠΊΠΆΠ΅ ΡΠΏΠ΅Ρ†ΠΈΠ°Π»ΡŒΠ½ΠΎΠ³ΠΎ ПО для Ρ€Π°Π±ΠΎΡ‚Ρ‹ со смарт-ΠΊΠ°Ρ€Ρ‚Π°ΠΌΠΈ. Π­Ρ‚Π° Π³Ρ€ΡƒΠΏΠΏΠ° ΠΏΡ‹Ρ‚Π°Π»Π°ΡΡŒ ΡΠΊΠΎΠΌΠΏΡ€ΠΎΠΌΠ΅Ρ‚ΠΈΡ€ΠΎΠ²Π°Ρ‚ΡŒ ΠΈ Π΄Ρ€ΡƒΠ³ΠΈΠ΅ ΠΊΠΎΠΌΠΏΡŒΡŽΡ‚Π΅Ρ€Ρ‹, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ Π½Π°Ρ…ΠΎΠ΄ΠΈΠ»ΠΈΡΡŒ Π² Ρ‚ΠΎΠΉ ΠΆΠ΅ локальной сСти Ρ‡Ρ‚ΠΎ ΠΈ ΠΊΠΎΠΌΠΏΡŒΡŽΡ‚Π΅Ρ€ ΠΆΠ΅Ρ€Ρ‚Π²Ρ‹.

Our ESET LiveGrid telemetry system, which allows you to quickly track malware distribution statistics, provided us with interesting geographical statistics on the distribution of malware used by attackers in the mentioned campaign.

Attackers use sophisticated malware to attack Russian businesses
Rice. 3. Statistics on the geographical distribution of the malware that was used in this malicious campaign.

Malware installation

ПослС открытия ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Π΅ΠΌ врСдоносного Π΄ΠΎΠΊΡƒΠΌΠ΅Π½Ρ‚Π° с эксплойтом Π½Π° уязвимой систСмС, Ρ‚ΡƒΠ΄Π° Π±ΡƒΠ΄Π΅Ρ‚ Π·Π°Π³Ρ€ΡƒΠΆΠ΅Π½ ΠΈ исполнСн ΡΠΏΠ΅Ρ†ΠΈΠ°Π»ΡŒΠ½Ρ‹ΠΉ Π·Π°Π³Ρ€ΡƒΠ·Ρ‡ΠΈΠΊ (downloader), ΡƒΠΏΠ°ΠΊΠΎΠ²Π°Π½Π½Ρ‹ΠΉ с ΠΏΠΎΠΌΠΎΡ‰ΡŒΡŽ NSIS. Π’ Π½Π°Ρ‡Π°Π»Π΅ своСй Ρ€Π°Π±ΠΎΡ‚Ρ‹ ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ° провСряСт ΠΎΠΊΡ€ΡƒΠΆΠ΅Π½ΠΈΠ΅ Windows Π½Π° ΠΏΡ€Π΅Π΄ΠΌΠ΅Ρ‚ присутствия Ρ‚Π°ΠΌ ΠΎΡ‚Π»Π°Π΄Ρ‡ΠΈΠΊΠΎΠ² ΠΈΠ»ΠΈ запуска Π² контСкстС Π²ΠΈΡ€Ρ‚ΡƒΠ°Π»ΡŒΠ½ΠΎΠΉ ΠΌΠ°ΡˆΠΈΠ½Ρ‹. Она Ρ‚Π°ΠΊΠΆΠ΅ провСряСт Π»ΠΎΠΊΠ°Π»ΠΈΠ·Π°Ρ†ΠΈΡŽ Windows ΠΈ посСщал Π»ΠΈ ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»ΡŒ Π½ΠΈΠΆΠ΅ пСрСчислСнныС Π² Ρ‚Π°Π±Π»ΠΈΡ†Π΅ URL-адрСса Π² Π±Ρ€Π°ΡƒΠ·Π΅Ρ€Π΅. Для этого ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΡŽΡ‚ΡΡ API FindFirst/NextUrlCacheEntry and the SoftwareMicrosoftInternet ExplorerTypedURLs registry key.

Attackers use sophisticated malware to attack Russian businesses

The bootloader checks for the presence of the following applications on the system.

Attackers use sophisticated malware to attack Russian businesses

The list of processes is really impressive and, as you can see, there are not only banking applications in it. For example, the executable file named "scardsvr.exe" refers to the smart card software (Microsoft SmartCard reader). The banking trojan itself includes the ability to work with smart cards.

Attackers use sophisticated malware to attack Russian businesses
Rice. 4. General scheme of the malware installation process.

Π’ случаС ΡƒΡΠΏΠ΅ΡˆΠ½ΠΎΠ³ΠΎ выполнСния всСх ΠΏΡ€ΠΎΠ²Π΅Ρ€ΠΎΠΊ, Π·Π°Π³Ρ€ΡƒΠ·Ρ‡ΠΈΠΊ скачиваСт с ΡƒΠ΄Π°Π»Π΅Π½Π½ΠΎΠ³ΠΎ сСрвСра ΡΠΏΠ΅Ρ†ΠΈΠ°Π»ΡŒΠ½Ρ‹ΠΉ Ρ„Π°ΠΉΠ» (Π°Ρ€Ρ…ΠΈΠ²), ΠΊΠΎΡ‚ΠΎΡ€Ρ‹ΠΉ содСрТит всС врСдоносныС исполняСмыС ΠΌΠΎΠ΄ΡƒΠ»ΠΈ, ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠ΅ΠΌΡ‹Π΅ Π·Π»ΠΎΡƒΠΌΡ‹ΡˆΠ»Π΅Π½Π½ΠΈΠΊΠ°ΠΌΠΈ. Π˜Π½Ρ‚Π΅Ρ€Π΅ΡΠ½ΠΎ ΠΎΡ‚ΠΌΠ΅Ρ‚ΠΈΡ‚ΡŒ, Ρ‡Ρ‚ΠΎ Π² зависимости ΠΎΡ‚ выполнСния Π²Ρ‹ΡˆΠ΅ΠΏΠ΅Ρ€Π΅Ρ‡ΠΈΡΠ»Π΅Π½Π½Ρ‹Ρ… ΠΏΡ€ΠΎΠ²Π΅Ρ€ΠΎΠΊ, скачиваСмыС с ΡƒΠ΄Π°Π»Π΅Π½Π½ΠΎΠ³ΠΎ C&C-сСрвСра Π°Ρ€Ρ…ΠΈΠ²Ρ‹ ΠΌΠΎΠ³ΡƒΡ‚ Ρ€Π°Π·Π»ΠΈΡ‡Π°Ρ‚ΡŒΡΡ. Архив ΠΌΠΎΠΆΠ΅Ρ‚ Π±Ρ‹Ρ‚ΡŒ врСдоносный ΠΈ Π½Π΅Ρ‚. Π’ случаС Π½Π΅ врСдоносного, ΠΎΠ½ устанавливаСт ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»ΡŽ Windows Live Toolbar. Π‘ΠΊΠΎΡ€Π΅Π΅ всСго, Π·Π»ΠΎΡƒΠΌΡ‹ΡˆΠ»Π΅Π½Π½ΠΈΠΊΠΈ пошли Π½Π° ΠΏΠΎΠ΄ΠΎΠ±Π½Ρ‹Π΅ ухищрСния для ΠΎΠ±ΠΌΠ°Π½Π° автоматичСских систСм Π°Π½Π°Π»ΠΈΠ·Π° Ρ„Π°ΠΉΠ»ΠΎΠ² ΠΈ Π²ΠΈΡ€Ρ‚ΡƒΠ°Π»ΡŒΠ½Ρ‹Ρ… машин, Π½Π° ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Ρ… ΠΈΡΠΏΠΎΠ»Π½ΡΡŽΡ‚ΡΡ ΠΏΠΎΠ΄ΠΎΠ·Ρ€ΠΈΡ‚Π΅Π»ΡŒΠ½Ρ‹Π΅ Ρ„Π°ΠΉΠ»Ρ‹.

The file downloaded by the NSIS loader is a 7z archive that contains various malware modules. The figure below shows the entire installation process of this malware and its various modules.

Attackers use sophisticated malware to attack Russian businesses
Rice. 5. General scheme of malware operation.

Although the downloaded modules serve different purposes for attackers, they are packaged in the same way and many of them have been signed with valid digital certificates. We found four such certificates that the attackers have been using since the beginning of the campaign. After our complaint, these certificates were revoked. It is interesting to note that all certificates were issued to companies registered in Moscow.

Attackers use sophisticated malware to attack Russian businesses
Rice. 6. The digital certificate that was used to sign the malware.

The following table lists the digital certificates that the attackers used in this malicious campaign.

Attackers use sophisticated malware to attack Russian businesses

Almost all malicious modules used by attackers have an identical installation procedure. They are self-extracting 7zip archives that are password protected.

Attackers use sophisticated malware to attack Russian businesses
Rice. 7. Fragment of the batch file install.cmd.

The batch .cmd file is responsible for installing malware into the system and launching various malicious tools. If the execution requires missing administrator rights, the malicious code uses several methods to obtain them (bypassing UAC). To implement the first method, two executable files named l1.exe and cc1.exe are involved, which specialize in bypassing UAC with a mechanism from leaked source code for Carberp. Another way is based on the exploitation of the CVE-2013-3660 vulnerability. Each malware module that requires privilege escalation contains both a 32-bit and a 64-bit version of the exploit.

During the tracking of this campaign, we analyzed several archives downloaded by the uploader. The contents of the archives varied, i.e. the attackers could adapt the malicious modules for different purposes.

User compromise

Как ΠΌΡ‹ ΡƒΠΏΠΎΠΌΠΈΠ½Π°Π»ΠΈ Π²Ρ‹ΡˆΠ΅, Π·Π»ΠΎΡƒΠΌΡ‹ΡˆΠ»Π΅Π½Π½ΠΈΠΊΠΈ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΡŽΡ‚ ΡΠΏΠ΅Ρ†ΠΈΠ°Π»ΡŒΠ½Ρ‹Π΅ инструмСнты для ΠΊΠΎΠΌΠΏΡ€ΠΎΠΌΠ΅Ρ‚Π°Ρ†ΠΈΠΈ ΠΊΠΎΠΌΠΏΡŒΡŽΡ‚Π΅Ρ€ΠΎΠ² ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Π΅ΠΉ. К Ρ‚Π°ΠΊΠΈΠΌ инструмСнтам относятся ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡ‹ с названиями исполняСмых Ρ„Π°ΠΉΠ»ΠΎΠ² mimi.exe and xtm.exe. Они ΠΏΠΎΠΌΠΎΠ³Π°ΡŽΡ‚ Π·Π»ΠΎΡƒΠΌΡ‹ΡˆΠ»Π΅Π½Π½ΠΈΠΊΠ°ΠΌ ΡƒΡΡ‚Π°Π½ΠΎΠ²ΠΈΡ‚ΡŒ ΠΊΠΎΠ½Ρ‚Ρ€ΠΎΠ»ΡŒ Π·Π° ΠΊΠΎΠΌΠΏΡŒΡŽΡ‚Π΅Ρ€ΠΎΠΌ ΠΆΠ΅Ρ€Ρ‚Π²Ρ‹ ΠΈ ΡΠΏΠ΅Ρ†ΠΈΠ°Π»ΠΈΠ·ΠΈΡ€ΡƒΡŽΡ‚ΡΡ Π½Π° Π²Ρ‹ΠΏΠΎΠ»Π½Π΅Π½ΠΈΠΈ ΡΠ»Π΅Π΄ΡƒΡŽΡ‰ΠΈΡ… Π·Π°Π΄Π°Ρ‡: ΠΏΠΎΠ»ΡƒΡ‡Π΅Π½ΠΈΠ΅/восстановлСниС ΠΏΠ°Ρ€ΠΎΠ»Π΅ΠΉ ΠΊ Π°ΠΊΠΊΠ°ΡƒΠ½Ρ‚Π°ΠΌ ΡƒΡ‡Π΅Ρ‚Π½Ρ‹Ρ… записСй Windows, Π²ΠΊΠ»ΡŽΡ‡Π΅Π½ΠΈΠ΅ сСрвиса RDP, созданиС Π½ΠΎΠ²ΠΎΠ³ΠΎ Π°ΠΊΠΊΠ°ΡƒΠ½Ρ‚Π° (ΡƒΡ‡Π΅Ρ‚Π½ΠΎΠΉ записи) Π² ОБ.

The executable file mimi.exe includes a modified version of a well-known open source tool Mimikatz. Π­Ρ‚ΠΎΡ‚ инструмСнт позволяСт ΠΏΠΎΠ»ΡƒΡ‡Π°Ρ‚ΡŒ ΠΏΠ°Ρ€ΠΎΠ»ΠΈ Π°ΠΊΠΊΠ°ΡƒΠ½Ρ‚ΠΎΠ² ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Π΅ΠΉ Windows. Π—Π»ΠΎΡƒΠΌΡ‹ΡˆΠ»Π΅Π½Π½ΠΈΠΊΠΈ ΡƒΠ΄Π°Π»ΠΈΠ»ΠΈ ΠΈΠ· Mimikatz Ρ‚Ρƒ Ρ‡Π°ΡΡ‚ΡŒ, которая ΠΎΡ‚Π²Π΅Ρ‡Π°Π΅Ρ‚ Π·Π° взаимодСйствиС с ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Π΅ΠΌ. Π˜ΡΠΏΠΎΠ»Π½ΡΠ΅ΠΌΡ‹ΠΉ ΠΊΠΎΠ΄ Π±Ρ‹Π» Ρ‚Π°ΠΊΠΆΠ΅ ΠΌΠΎΠ΄ΠΈΡ„ΠΈΡ†ΠΈΡ€ΠΎΠ²Π°Π½ Ρ‚Π°ΠΊΠΈΠΌ ΠΎΠ±Ρ€Π°Π·ΠΎΠΌ, Ρ‡Ρ‚ΠΎΠ±Ρ‹ ΠΏΡ€ΠΈ запускС Mimikatz запускался с ΠΊΠΎΠΌΠ°Π½Π΄Π°ΠΌΠΈ privilege::debug ΠΈ sekurlsa:logonPasswords.

Another executable file, xtm.exe, launches special scripts that turn on the RDP service in the system, try to create a new account in the OS, and also change system settings in such a way as to allow multiple users to simultaneously connect to the compromised computer via RDP. Obviously, these steps are necessary to gain complete control over the compromised system.

Attackers use sophisticated malware to attack Russian businesses
Rice. 8. Commands executed by xtm.exe in the system.

Attackers use another executable file called impack.exe, which installs special software on the system. This software is called LiteManager and is used by attackers as a backdoor.

Attackers use sophisticated malware to attack Russian businesses
Rice. 9. LiteManager interface.

Once installed on a user's system, LiteManager allows attackers to directly connect to that system and control it remotely. This software has special command-line options for installing it behind the scenes, creating special firewall rules, and running its module. All parameters are used by attackers.

The last module of the malware bundle used by the attackers is a banking malware (banker) with the executable file name pn_pack.exe. She specializes in spying on the user and is responsible for interacting with the controlling C&C server. The banker is launched using legitimate Yandex Punto software. Punto is used by attackers to launch a malicious DLL library (DLL Side-Loading method). The malware itself can perform the following functions:

  • track keystrokes on the keyboard and the contents of the clipboard for their subsequent transfer to a remote server;
  • list all smart cards that are present in the system;
  • interact with a remote C&C server.

The malware module that is responsible for performing all these tasks is an encrypted DLL. It is decrypted and loaded into memory during Punto execution. To perform the above tasks, the executable DLL code starts three threads.

The fact that the attackers chose the Punto software for their purposes is not a surprise: some Russian forums openly provide detailed information on such a topic as using flaws in legitimate software to compromise users.

The malicious library uses the RC4 algorithm to encrypt its strings, as well as during network interaction with the C&C server. It contacts the server every two minutes and transfers there all the data that was collected on the compromised system during this period of time.

Attackers use sophisticated malware to attack Russian businesses
Rice. 10. A fragment of the network interaction between the bot and the server.

The following are some of the C&C server instructions that the library can receive.

Attackers use sophisticated malware to attack Russian businesses

In response to receiving instructions from the C&C server, the malware responds with a status code. It is interesting to note that all of the banker modules we have analyzed (the most recent with a compilation date of January 18th) contain the string "TEST_BOTNET" that is sent in every message to the C&C server.

Conclusion

In order to compromise corporate users, attackers at the first stage compromise one employee of the company by sending a phishing message with an exploit. Further, as soon as the malware is installed in the system, they will use software tools that will help them significantly increase the authority in the system and perform additional tasks on it: compromise other computers on the corporate network and spy on the user, as well as on bank transactions that he performs.

Attackers use sophisticated malware to attack Russian businesses

Attackers use sophisticated malware to attack Russian businesses

Source: habr.com

Buy reliable hosting for sites with DDoS protection, VPS VDS servers πŸ”₯ Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster