EMOTET banking trojan is still active: shellcode release methods, infrastructure updates, and traffic encryption

0 24
Since the EMOTET banking trojan was discovered in 2014, it has been active until...

Since the EMOTET banking trojan was discovered in 2014, it has been active until now and has become one of the most influential malicious software families. This trojan often spreads through spam emails and has iterated many versions. In the early days, it was delivered through malicious JavaScript scripts, and later turned to spreading through documents containing malicious macro code. We disclosed it last September, and as of now, the infrastructure of this trojan is still being updated.

EMOTET banking trojan is still active: shellcode release methods, infrastructure updates, and traffic encryption

Program entry analysis

This malicious sample belongs to the MFC class program, and the entry of the main function of the program is as follows:

image.png

Through static and dynamic debugging analysis, it is not possible to locate the core functional function from the entire execution flow of the main function.

image.pngBy examining strings, the import functions used by the program, and dynamic debugging, the following function is the main entry function of the functional module.

image.pngimage.pngIt uses Windows resource operation-related functions to find the resource section, then imports resources, and decrypts related data.

image.pngimage.pngThe following is related data in the resource section of the program:

image.png

The program jumps to the shellcode section to execute, and then performs multiple decryption operations, using the VirtualProtectEx function to modify the properties of the memory page where the next execution code is located, changing it to readable and executable.

image.pngimage.pngThen, it switches to the corresponding entry to execute the main malicious function.

image.pngVirus 'self-deletion'

The virus file is moved to the system directory (and the original file is deleted) by using the SHFileOperationW function.

image.pngimage.png

Then, related files ending with Zone.Identifier are deleted. Zone.Identifier type files are other附属 information stream files of the target file, which may include information such as where the target file comes from, such as local, shared, and network.

image.pngThen, a new process is created to run.

image.pngVirus persistence

Persistence is achieved by creating a Windows service.

image.png

Persistence is achieved by creating an auto-start registry entry.

image.png

image.png

Infrastructure Analysis

C2Basic Information Analysis

Request IP Request Port Request Method
200.119.11.118 443 HTTP POST
103.83.81.141 8080 HTTP POST

 The specific information of the requested IP and port is as follows:

image.pngimage.png

Communication Process Analysis

Obtain the IP address to be remotely accessed.

image.png

Parameters required to create an HTTP request message. Strings are randomly generated using the RtlRandom function.

image.pngimage.png

Since the file upload method using the post form needs to be used for data upload, the boundary-related fields are required.

image.png

image.png

The InternetOpen function is called to initialize the network request.

image.pngBy calling the InternetConnectW function, we can connect to the remote server, and we can see the specific request port from the parameters.

image.pngThen, the request is made through the POST method.

image.png

Finally, the related request body is sent through the HttpSendRequestW function. The request body is uploaded through the form upload method, with the content type of multipart/form-data.

image.pngimage.pngContent Analysis Submission

The content uploaded by the malicious sample to the remote server includes encrypted keys, computer names, and currently running processes, etc. These data are encrypted during transmission.

After obtaining the computer name, system directory, and drive information, etc., then concatenate.

image.pngimage.png

The assembled string at the end is as follows:

image.png

Obtain the list of running processes on the computer.

image.pngAs follows is the content to be encrypted and the encrypted content.

image.pngimage.pngThen, the encrypted data is uploaded. The network request entity parameters also indicate that the uploaded data includes the key and the encrypted collected information.

image.pngimage.png

Encryption Algorithm Analysis

The malicious software will encrypt the uploaded data when uploading information, and the encryption algorithm used in the communication process is RSA_AES mode.

Firstly, the CryptAcquireContextW function is used to create a key container. From the parameters, we can know that an RSA_AES key container is created, with PROV_RSA_AES = 24.

image.png

Then, the RSA public key is imported by calling the CryptImportKey function. The specific information of the RSA public key can also be obtained from the parameters of this function, such as the public key modulus, public key exponent, and the modulus of the public key.

image.png

Then, the CryptGenKey function is called to generate the key. From the parameters, we can see that the key algorithm is AES_128.

image.pngThe used hash is SHA1.

image.png

Then, the CryptEncrypt function is called to encrypt the collected information data.

image.png

The AES key information generated previously is exported using the CryptExportKey function. During the export, the RSA public key is used to encrypt as part of the uploaded data. After the server receives it, it can decrypt the AES key using the RSA private key, and then further decrypt the main data. CALG_AES_128=0x0000660e.

image.png

image.png

Shellcode Analysis

This sample performs 2 important correction operations before entering the core function module, the first is to load the resource data into memory, then decrypt the first shellcode, and then jump to this location to execute. As shown in the figure below:

image.png

The second operation is to jump to the shellcode and execute after sorting, then allocate content again, copy related content, and change this memory segment to be readable and executable, and then jump to this core function. First, it calls the system function through the windows api hash method, rather than using it directly.

image.png

Then call the VirtualAlloc function to allocate space.

image.png

Then prepare to start copying data. It is worth noting that it first operates on the data starting from 0027053F. We can see from the previous memory address that this is exactly the start of the MZ header. Therefore, the decrypted shellcode contains the PE data of the core module of this program in its entirety.

image.pngimage.pngThen the copied data is as follows, which is missing the MZ header of the PE data. The author may do this to prevent us from easily seeing that the core module is actually a complete PE format file, in order to prevent static auxiliary analysis from being performed during dump.

image.png

Then modify the memory attributes and jump to the core function entry to execute.

image.pngimage.png

We dump this module and can see the complete entry of the core module.

image.pngimage.pngThe general process of the core module is as follows:

image.png

It can also be viewed with the help of code, since the functions used by this program are all dynamically obtained after running, so dynamic analysis is still required. However, with static disassembly, it can be more convenient to assist in viewing.

image.pngWe can also see that there are many encrypted strings in the data segment, which are basically decrypted by the function sub_402B80.

image.pngimage.pngWe can also see relevant information in the dynamic debugging, of course, in addition to dynamic debugging, after static decompilation, decryption can also be performed through IDAPython.

image.pngimage.png

We can see that this function was called a total of 31 times.

image.pngSolution

Do not click on emails and attachments of unknown origin;

Do not click on links contained in emails of unknown origin;

Please download the program from official websites;

Use strong passwords, avoid using weak password passwords, and change passwords regularly;

Open system automatic update, and check for updates to install;

IOC

File MD5 File Name Yaxin Security Detection Name
cc4f5e25d48bbb315b6076273eb55a37 WebGrabber.exe TROJ_GEN.R002C0PF320
你可能想看:

3.6 Should not use OS package manager update instructions such as apt-get update or yum update separately or on a single line in Dockerfile

As announced today, Glupteba is a multi-component botnet targeting Windows computers. Google has taken action to disrupt the operation of Glupteba, and we believe this action will have a significant i

Article 2 of the Cryptography Law clearly defines the term 'cryptography', which does not include commonly known terms such as 'bank card password', 'login password', as well as facial recognition, fi

b) It should have a login failure handling function, and should configure and enable measures such as ending the session, limiting the number of illegal login attempts, and automatically logging out w

It is possible to perform credible verification on the system boot program, system program, important configuration parameters, and application programs of computing devices based on a credible root,

b) It should have the login failure handling function, and should configure and enable measures such as ending the session, limiting the number of illegal logins, and automatically exiting when the lo

Announcement regarding the addition of 7 units as technical support units for the Ministry of Industry and Information Technology's mobile Internet APP product security vulnerability database

Data security can be said to be a hot topic in recent years, especially with the rapid development of information security technologies such as big data and artificial intelligence, the situation of d

Cross-compilation environment construction and communication data decryption of the CIA Hive platform

(3) Is the national secret OTP simply replacing the SHA series hash algorithms with the SM3 algorithm, and becoming the national secret version of HOTP and TOTP according to the adopted dynamic factor

最后修改时间:
admin
上一篇 2025年03月28日 16:30
下一篇 2025年03月28日 16:52

评论已关闭