A Trojan family classification method and system based on deep learning

By converting Trojan codes into images and using deep learning neural network classification, it solves the problem of existing technology being unable to keep up with Trojan iteration speed, achieving fast and accurate classification of Trojan families and the issuance of universal protective measures.

CN115114625BActive Publication Date: 2024-09-13北京国瑞数智技术有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210892620.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-27
Publication Date
2024-09-13
Estimated Expiration
2042-07-27

AI Technical Summary

Technical Problem

Existing detection methods cannot keep up with the iteration speed of Trojans and cannot effectively provide universal protection measures for the entire Trojan family.

Method used

Convert the Trojan code into images, use the advantages of deep learning in image classification, extract features through neural networks and bidirectional hidden layers, classify the Trojan family and issue protective measures.

Benefits of technology

By converting the Trojan code into a grayscale image and supplementing the feature values, the characteristics of the Trojan family are highlighted, which solves the problem that detection methods cannot keep up with the Trojan iteration speed, and achieves fast and accurate Trojan family classification and universal protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115114625B
    Figure CN115114625B
Patent Text Reader

Abstract

The present invention provides a Trojan family classification method and system based on deep learning. The Trojan code is converted into a grayscale image. In order to overcome the accuracy defect of the grayscale image, a dimension of the Trojan feature value is added on the basis of the grayscale image, so as to further highlight the characteristics of certain Trojan families. The Trojan classification problem is converted into an image classification problem, thereby solving the problem that the known detection means cannot keep up with the iteration speed of the Trojan by leveraging the advantages of deep learning in image classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network security technology, and in particular to a Trojan family classification method and system based on deep learning. Background Art

[0002] With the rapid development of the Internet, the number of malware has increased exponentially, and malicious code has become the main threat to today's Internet. Malicious code, taking Trojans as an example, usually has an evolutionary process, and will derive and iterate many different versions. These different versions of Trojans often have certain correlations and can be classified as a Trojan family.

[0003] Since known detection methods cannot keep up with the iteration speed of Trojans, it is necessary to be able to trace the source of the Trojan family based on its characteristics and summarize universal protection measures for the entire Trojan family.

[0004] At the same time, with the rapid development of machine learning, deep learning technology will play an irreplaceable role in feature tracing and induction, and will be able to process massive data quickly and accurately.

[0005] Therefore, there is an urgent need for a targeted Trojan family classification method and system based on deep learning. Summary of the invention

[0006] The purpose of the present invention is to provide a Trojan family classification method and system based on deep learning, which converts the Trojan code into an image and converts the Trojan classification problem into an image classification problem, thereby leveraging the advantages of deep learning in image classification to solve the problem that known detection methods cannot keep up with the iteration speed of Trojans.

[0007] In a first aspect, the present application provides a Trojan family classification method based on deep learning, the method comprising:

[0008] Receiving a Trojan sent by an external device, extracting a binary code and a characteristic value of the Trojan, encoding and mapping the binary code into a first one-dimensional vector, and vectorizing the characteristic value into a second one-dimensional vector, wherein the range of each vector value is limited to between 0 and 255;

[0009] The width of the Trojan horse image is set according to the size of the Trojan horse file, and a two-dimensional array matrix is ​​created, wherein the width of the Trojan horse image is used as the number of columns of the two-dimensional array matrix;

[0010] Writing the vector values ​​of the first one-dimensional vector into the two-dimensional array matrix one by one, and then writing the vector values ​​of the second one-dimensional vector into the two-dimensional array matrix one by one, taking each point of the two-dimensional array matrix as a grayscale pixel point, and obtaining the corresponding Trojan horse image;

[0011] The Trojan horse image is uniformly preprocessed according to the width required by the classifier of the server. When the width of the Trojan horse image does not meet the width required by the classifier, an image interpolation algorithm is used to perform image scaling processing on the Trojan horse image to obtain a Trojan horse image to be classified, and the image is sent to the classifier of the server.

[0012] The classifier adopts a neural network, receives the input Trojan horse image to be classified, and uses a number of neurons to form a bidirectional hidden layer, the neurons are divided into two groups, one group is a forward feedback circuit, and the other group is a reverse feedback circuit, thereby forming a bidirectional circuit, the current neuron in each feedback circuit receives the hidden layer information transmitted by the previous neuron, and receives the state information transmitted by the neighboring neurons adjacent to the previous neuron, outputs the hidden layer information at the current moment and the updated state information of the current neuron, and outputs them to the accumulation unit of the timing feature module for element-by-element addition;

[0013] Extract the output of the fully connected middle layer of the neural network as a new feature of the Trojan image to be classified, classify it according to the new feature, determine the Trojan family corresponding to the Trojan image to be classified according to the classification result, and send the universal protection measures corresponding to the Trojan family to the external device.

[0014] In a second aspect, the present application provides a Trojan family classification system based on deep learning, the system comprising:

[0015] An extraction unit is used to receive a Trojan sent by an external device, extract a binary code and a characteristic value of the Trojan, encode and map the binary code into a first one-dimensional vector, and vectorize the characteristic value into a second one-dimensional vector, wherein the range of each vector value is limited to between 0 and 255;

[0016] An imaging unit is used to set the width of the Trojan horse image according to the size of the Trojan horse file, create a two-dimensional array matrix, and use the width of the Trojan horse image as the number of columns of the two-dimensional array matrix; write the vector values ​​of the first one-dimensional vector into the two-dimensional array matrix one by one, and then write the vector values ​​of the second one-dimensional vector into the two-dimensional array matrix one by one, and use each point of the two-dimensional array matrix as a grayscale pixel point to obtain the corresponding Trojan horse image;

[0017] A preprocessing unit is used to uniformly preprocess the Trojan horse image according to the width required by the classifier of the server. When the width of the Trojan horse image does not meet the width required by the classifier, an image interpolation algorithm is used to perform image scaling processing on the Trojan horse image to obtain a Trojan horse image to be classified, and the image is sent to the classifier of the server;

[0018] A classifier is located on a server and uses a neural network to receive the input Trojan horse image to be classified, and uses a number of neurons to form a bidirectional hidden layer. The neurons are divided into two groups, one group is a forward feedback circuit, and the other group is a reverse feedback circuit, thereby forming a bidirectional circuit. The current neuron in each feedback circuit receives the hidden layer information transmitted by the previous neuron, and receives the state information transmitted by the neighboring neurons adjacent to the previous neuron, outputs the hidden layer information at the current moment and the updated state information of the current neuron, and outputs them to the accumulator unit of the timing feature module for element-by-element addition; extracts the output of the fully connected intermediate layer of the neural network as a new feature of the Trojan horse image to be classified, and classifies according to the new feature;

[0019] The execution unit is used to determine the Trojan family corresponding to the Trojan image to be classified according to the classification result, and send the universal protection measures corresponding to the Trojan family to the external device.

[0020] In a third aspect, the present application provides a Trojan family classification system based on deep learning, the system comprising a processor and a memory:

[0021] The memory is used to store program code and transmit the program code to the processor;

[0022] The processor is used to execute any one of the four possible methods of the first aspect according to the instructions in the program code.

[0023] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store program code, and the program code is used to execute any one of the four possible methods in the first aspect.

[0024] Beneficial Effects

[0025] The present invention provides a Trojan family classification method and system based on deep learning. The Trojan code is converted into a grayscale image. In order to overcome the accuracy defect of the grayscale image, a dimension of the Trojan feature value is added on the basis of the grayscale image, so as to further highlight the characteristics of certain Trojan families. The Trojan classification problem is converted into an image classification problem, thereby solving the problem that the known detection means cannot keep up with the iteration speed of the Trojan by leveraging the advantages of deep learning in image classification. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0027] Figure 1 The following is a general flow chart of the Trojan family classification method based on deep learning of the present invention;

[0028] Figure 2 This is an architecture diagram of the Trojan family classification system based on deep learning of the present invention. DETAILED DESCRIPTION

[0029] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings so that the advantages and features of the present invention can be more easily understood by those skilled in the art, thereby making a clearer and more definite definition of the protection scope of the present invention.

[0030] The image textures of the same Trojan family are similar, while the image textures of different Trojan families are somewhat different. The visualization of Trojan code can present the overall structure and characteristics of the Trojan without the need for traditional reverse analysis of Trojan operations.

[0031] However, in some scenarios, the detection accuracy of Trojan code after visualization may not be high enough. A common improvement method is to convert it into a color image.

[0032] The present invention creatively adds a dimension based on the grayscale image: the eigenvalue of the Trojan horse. The extracted eigenvalue of the Trojan horse is vectorized into a one-dimensional vector and written into the two-dimensional array matrix, so that the Trojan horse image also carries the eigenvalue of the Trojan horse, which can further highlight the characteristics of certain Trojan horse families.

[0033] Figure 1 A general flow chart of the Trojan family classification method based on deep learning provided in this application, the method includes:

[0034] Receiving a Trojan sent by an external device, extracting a binary code and a characteristic value of the Trojan, encoding and mapping the binary code into a first one-dimensional vector, and vectorizing the characteristic value into a second one-dimensional vector, wherein the range of each vector value is limited to between 0 and 255;

[0035] The width of the Trojan horse image is set according to the size of the Trojan horse file, and a two-dimensional array matrix is ​​created, wherein the width of the Trojan horse image is used as the number of columns of the two-dimensional array matrix;

[0036] Writing the vector values ​​of the first one-dimensional vector into the two-dimensional array matrix one by one, and then writing the vector values ​​of the second one-dimensional vector into the two-dimensional array matrix one by one, taking each point of the two-dimensional array matrix as a grayscale pixel point, and obtaining the corresponding Trojan horse image;

[0037] The vector values ​​of the second one-dimensional vector are written into the two-dimensional array matrix one by one, that is, after the first one-dimensional vector is written into the two-dimensional array matrix, the vector value of the second one-dimensional vector is written immediately thereafter.

[0038] If there are still unfilled rows in the two-dimensional array matrix after the first one-dimensional vector and the second one-dimensional vector are written, "0" is written until the row is filled.

[0039] The Trojan horse image is uniformly preprocessed according to the width required by the classifier of the server. When the width of the Trojan horse image does not meet the width required by the classifier, an image interpolation algorithm is used to perform image scaling processing on the Trojan horse image to obtain a Trojan horse image to be classified, and the image is sent to the classifier of the server.

[0040] The classifier adopts a neural network, receives the input Trojan horse image to be classified, and uses a number of neurons to form a bidirectional hidden layer, the neurons are divided into two groups, one group is a forward feedback circuit, and the other group is a reverse feedback circuit, thereby forming a bidirectional circuit, the current neuron in each feedback circuit receives the hidden layer information transmitted by the previous neuron, and receives the state information transmitted by the neighboring neurons adjacent to the previous neuron, outputs the hidden layer information at the current moment and the updated state information of the current neuron, and outputs them to the accumulation unit of the timing feature module for element-by-element addition;

[0041] Extract the output of the fully connected middle layer of the neural network as a new feature of the Trojan image to be classified, classify it according to the new feature, determine the Trojan family corresponding to the Trojan image to be classified according to the classification result, and send the universal protection measures corresponding to the Trojan family to the external device.

[0042] The classification includes performing n rounds of extraction to obtain n training sets, using the extracted n training sets to randomly train n decision trees using a specified number of feature values ​​by column sampling, and the n decision trees obtain classification results by voting.

[0043] In some preferred embodiments, the image interpolation algorithm includes: nearest neighbor interpolation algorithm, bilinear interpolation algorithm and bicubic interpolation algorithm.

[0044] There is often a packer in Trojans. A packer means adding a protection program to the Trojan code to prevent it from being modified or reverse analyzed.

[0045] In some preferred embodiments, before extracting the binary code and feature value of the Trojan horse, the method further includes detecting the packing type and signature of the Trojan horse code, and performing unpacking processing on different packed Trojan horse codes.

[0046] In some preferred embodiments, the classification includes multiple extractions, creating multiple decision trees, and performing weighted cumulative voting on the output results of each decision tree.

[0047] Figure 2This is an architecture diagram of the Trojan family classification system based on deep learning provided in this application, and the system includes:

[0048] An extraction unit is used to receive a Trojan sent by an external device, extract a binary code and a characteristic value of the Trojan, encode and map the binary code into a first one-dimensional vector, and vectorize the characteristic value into a second one-dimensional vector, wherein the range of each vector value is limited to between 0 and 255;

[0049] An imaging unit is used to set the width of the Trojan horse image according to the size of the Trojan horse file, create a two-dimensional array matrix, and use the width of the Trojan horse image as the number of columns of the two-dimensional array matrix; write the vector values ​​of the first one-dimensional vector into the two-dimensional array matrix one by one, and then write the vector values ​​of the second one-dimensional vector into the two-dimensional array matrix one by one, and use each point of the two-dimensional array matrix as a grayscale pixel point to obtain the corresponding Trojan horse image;

[0050] A preprocessing unit is used to uniformly preprocess the Trojan horse image according to the width required by the classifier of the server. When the width of the Trojan horse image does not meet the width required by the classifier, an image interpolation algorithm is used to perform image scaling processing on the Trojan horse image to obtain a Trojan horse image to be classified, and the image is sent to the classifier of the server;

[0051] A classifier is located on a server and uses a neural network to receive the input Trojan horse image to be classified, and uses a number of neurons to form a bidirectional hidden layer. The neurons are divided into two groups, one group is a forward feedback circuit, and the other group is a reverse feedback circuit, thereby forming a bidirectional circuit. The current neuron in each feedback circuit receives the hidden layer information transmitted by the previous neuron, and receives the state information transmitted by the neighboring neurons adjacent to the previous neuron, outputs the hidden layer information at the current moment and the updated state information of the current neuron, and outputs them to the accumulator unit of the timing feature module for element-by-element addition; extracts the output of the fully connected intermediate layer of the neural network as a new feature of the Trojan horse image to be classified, and classifies according to the new feature;

[0052] The execution unit is used to determine the Trojan family corresponding to the Trojan image to be classified according to the classification result, and send the universal protection measures corresponding to the Trojan family to the external device.

[0053] The present application provides a Trojan family classification system based on deep learning, the system comprising: the system comprising a processor and a memory:

[0054] The memory is used to store program code and transmit the program code to the processor;

[0055] The processor is used to execute the method described in any one of all embodiments of the first aspect according to the instructions in the program code.

[0056] The present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store program code, and the program code is used to execute the method described in any one of the embodiments of the first aspect.

[0057] In a specific implementation, the present invention further provides a computer storage medium, wherein the computer storage medium may store a program, and when the program is executed, the program may include some or all of the steps in each embodiment of the present invention. The storage medium may be a disk, an optical disk, a read-only storage memory (abbreviated as: ROM) or a random access memory (abbreviated as: RAM), etc.

[0058] Those skilled in the art can clearly understand that the technology in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution in the embodiments of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention or some parts of the embodiments.

[0059] The same and similar parts between the various embodiments of this specification can be referred to each other. In particular, for the embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiment.

[0060] The above-described embodiments of the present invention do not limit the protection scope of the present invention.

Claims

1. A Trojan family classification method based on deep learning, characterized in that: The method comprises: Receiving a Trojan sent by an external device, extracting a binary code and a characteristic value of the Trojan, encoding and mapping the binary code into a first one-dimensional vector, and vectorizing the characteristic value into a second one-dimensional vector, wherein the range of each vector value is limited to between 0 and 255; The width of the Trojan horse image is set according to the size of the Trojan horse file, and a two-dimensional array matrix is ​​created, wherein the width of the Trojan horse image is used as the number of columns of the two-dimensional array matrix; Writing the vector values ​​of the first one-dimensional vector into the two-dimensional array matrix one by one, and then writing the vector values ​​of the second one-dimensional vector into the two-dimensional array matrix one by one, taking each point of the two-dimensional array matrix as a grayscale pixel point, and obtaining the corresponding Trojan horse image; The Trojan horse image is uniformly preprocessed according to the width required by the classifier of the server. When the width of the Trojan horse image does not meet the width required by the classifier, an image interpolation algorithm is used to perform image scaling processing on the Trojan horse image to obtain a Trojan horse image to be classified, and the image is sent to the classifier of the server. The classifier adopts a neural network, receives the input Trojan horse image to be classified, and uses a number of neurons to form a bidirectional hidden layer, the neurons are divided into two groups, one group is a forward feedback circuit, and the other group is a reverse feedback circuit, thereby forming a bidirectional circuit, the current neuron in each feedback circuit receives the hidden layer information transmitted by the previous neuron, and receives the state information transmitted by the neighboring neuron adjacent to the previous neuron, outputs the hidden layer information at the current moment and the updated state information of the current neuron, and outputs them to the accumulation unit of the time series feature module for element-by-element addition; Extract the output of the fully connected middle layer of the neural network as a new feature of the Trojan image to be classified, classify it according to the new feature, determine the Trojan family corresponding to the Trojan image to be classified according to the classification result, and send the universal protection measures corresponding to the Trojan family to the external device.

2. The method according to claim 1, characterized in that: The image interpolation algorithms used include: nearest neighbor interpolation algorithm, bilinear interpolation algorithm and bicubic interpolation algorithm.

3. The method according to claim 1, characterized in that: Before extracting the binary code and characteristic value of the Trojan horse, the method also includes detecting the shell type and signature of the Trojan horse code, and performing shell removal processing on different shell Trojan horse codes.

4. The method according to any one of claims 2 or 3, characterized in that: The classification includes multiple extractions, creating multiple decision trees, and performing weighted cumulative voting on the output results of each decision tree.

5. A Trojan family classification system based on deep learning, characterized in that: The system comprises: An extraction unit is used to receive a Trojan sent by an external device, extract a binary code and a characteristic value of the Trojan, encode and map the binary code into a first one-dimensional vector, and vectorize the characteristic value into a second one-dimensional vector, wherein the range of each vector value is limited to between 0 and 255; An imaging unit is used to set the width of the Trojan horse image according to the size of the Trojan horse file, create a two-dimensional array matrix, and use the width of the Trojan horse image as the number of columns of the two-dimensional array matrix; write the vector values ​​of the first one-dimensional vector into the two-dimensional array matrix one by one, and then write the vector values ​​of the second one-dimensional vector into the two-dimensional array matrix one by one, and use each point of the two-dimensional array matrix as a grayscale pixel point to obtain the corresponding Trojan horse image; A preprocessing unit is used to uniformly preprocess the Trojan horse image according to the width required by the classifier of the server. When the width of the Trojan horse image does not meet the width required by the classifier, an image interpolation algorithm is used to perform image scaling processing on the Trojan horse image to obtain a Trojan horse image to be classified, and the image is sent to the classifier of the server; A classifier is located on a server and uses a neural network to receive the input Trojan horse image to be classified, and uses a number of neurons to form a bidirectional hidden layer. The neurons are divided into two groups, one group is a forward feedback circuit, and the other group is a reverse feedback circuit, thereby forming a bidirectional circuit. The current neuron in each feedback circuit receives the hidden layer information transmitted by the previous neuron, and receives the state information transmitted by the neighboring neurons adjacent to the previous neuron, outputs the hidden layer information at the current moment and the updated state information of the current neuron, and outputs them to the accumulation unit of the time series feature module for element-by-element addition; extracts the output of the fully connected intermediate layer of the neural network as a new feature of the Trojan horse image to be classified, and classifies according to the new feature; The execution unit is used to determine the Trojan family corresponding to the Trojan image to be classified according to the classification result, and send the universal protection measures corresponding to the Trojan family to the external device.

6. A Trojan family classification system based on deep learning, characterized in that: The system comprises a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the method according to any one of claims 1 to 4 according to the instructions in the program code.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program codes, and the program codes are used to execute the method according to any one of claims 1 to 4.