A method and system for detecting evasive malware

By acquiring and analyzing user-mode API call sequences and kernel-mode system call sequences, and combining a variety of machine learning algorithms, we build a polymorphic behavior feature integrated detection model, which solves the problem of the inability of existing technologies to detect evasive malware and significantly improves detection efficiency. Accuracy and efficiency.

CN118296602BActive Publication Date: 2024-10-29INSTITUTE OF INFORMATION ENGINEERING CHINESE ACADEMY OF SCIENCES
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410462681.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-17
Publication Date
2024-10-29
Estimated Expiration
2044-04-17

AI Technical Summary

Technical Problem

Existing technologies cannot effectively detect and defend against evasive malware, resulting in traditional detection methods being greatly reduced in effectiveness and unable to capture the dynamic and changing characteristics of these software, posing serious network security threats.

Method used

By obtaining the user-mode API call sequence and kernel-mode system call sequence of the program under test, combined with the random forest algorithm, convolutional neural network, bidirectional long short-term memory network and naive Bayes algorithm, a polymorphic behavioral feature integrated detection model is constructed to achieve Detection of evasive malware.

Benefits of technology

It significantly improves the detection accuracy and efficiency of evasive malware. By integrating behavioral characteristics at different operational levels, a comprehensive evaluation system is formed to enhance the detection capabilities of malware.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118296602B_ABST
    Figure CN118296602B_ABST
Patent Text Reader

Abstract

The present invention discloses an evasive malware detection method and system, and relates to the field of computer network security. The present invention constructs a training sample set and a verification sample set based on collected normal software samples and evasive malware samples, runs the samples and analyzes to obtain a user-mode API call sequence and a kernel-mode system call sequence; based on the two sequences in the two sample sets, a user-mode behavior feature detection model and a kernel-mode behavior feature detection model are trained and used as a base model, and a polymorphic behavior feature integrated detection model is obtained by stacking and training with a metamodel, and the model is used to detect evasive malware. The present invention integrates two call sequence classification models to effectively capture the behavior characteristics of malware at different operation levels, and integrates the outputs of multiple models by stacking, which significantly improves the accuracy and efficiency of evasive malware detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer network security, and in particular relates to an evasive malware detection method and system. Background Art

[0002] With the rapid development of information technology, malware has become one of the main threats in the field of network security. In particular, a new type of malware - evasive malware - is attracting great attention from the industry. Evasive malware refers to malware that uses various technical means to actively evade traditional security detection mechanisms. This type of software is highly concealed and intelligent, and can identify and adapt to different detection environments to achieve evasion. Evasive malware usually uses the following main technologies to evade: code obfuscation, encryption, polymorphism and metamorphosis, environmental perception and behavioral delay. Code obfuscation and encryption evade signature-based detection by changing the appearance of the code without changing its function; polymorphism and metamorphosis allow malware to change its code structure every time it infects, making detection based on static features difficult; environmental perception enables malware to detect and avoid running in analysis or sandbox environments; behavioral delay evades detection based on behavioral analysis by delaying the display of malicious behavior.

[0003] These evasion techniques not only pose a severe challenge to traditional signature-based and behavior-based malware detection methods, but also pose a great threat to information system security. Traditional detection methods usually rely on known features or predefined behavior patterns of malware, but the dynamic and changeable characteristics of evasive malware make these methods less effective. In addition, evasive malware, with its high concealment, can lurk in the victim system for a long time without being detected, and conduct malicious activities such as data theft and system destruction, thus posing a major threat to the privacy and security of individuals and enterprises. With the increasing number of network security threats, traditional malware detection technology faces severe challenges, especially in combating evasive malware. This type of malware can effectively evade existing security detection mechanisms through advanced technologies such as environmental perception, behavior concealment, dynamic code execution, and anti-dynamic analysis. Summary of the invention

[0004] The purpose of the present invention is to propose an evasive malware detection method and system based on function call sequence, which analyzes and detects evasive malware by obtaining the user-mode API call sequence and kernel-mode system call sequence of the program to be tested, so as to solve the problem that the prior art cannot detect evasive malware and has low detection efficiency.

[0005] In order to achieve the above object, the specific technical solution adopted by the present invention is:

[0006] A method for detecting evasive malware comprises the following steps:

[0007] 1) Collect normal software samples and evasive malware samples, and construct training sample sets and validation sample sets containing both types of samples;

[0008] 2) Run and analyze each sample in the training sample set and the verification sample set to obtain the user state API call sequence and the kernel state system call sequence;

[0009] 3) Input the user-mode API call sequence of the training sample set into the random forest algorithm for supervised learning training, and use the user-mode API call sequence of the verification sample set for parameter optimization to obtain a user-mode behavior feature detection model;

[0010] 4) The kernel-state system call sequence of the training sample set is input into a hybrid neural network based on Convolutional Neural Networks (CNN) and Bi-directional Long Short-Term Memory (Bi-LSTM) for supervised learning training, and the kernel-state system call sequence of the verification sample set is used for parameter optimization to obtain a kernel-state behavior feature detection model;

[0011] 5) The user-state behavior features predicted by the user-state behavior feature detection model and the kernel-state behavior features predicted by the kernel-state behavior feature detection model are combined into meta-features, which are input into the naive Bayes algorithm for supervised learning training to obtain a meta-model;

[0012] 6) The user-mode behavior feature detection model and the kernel-mode behavior feature detection model are used as base models to form an initial polymorphic behavior feature integrated detection model together with the meta-model, and the user-mode API call sequence and kernel-mode system call sequence of the verification sample set are used to optimize the parameters of the meta-model to obtain a trained polymorphic behavior feature integrated detection model;

[0013] 7) Capture the behavior information of the software and input it into the trained polymorphic behavior feature integrated detection model to predict whether it is evasive malware.

[0014] Furthermore, in step 1), the evasive malware sample files and normal software sample files in the training sample set and the verification sample set are executed in a malware analysis environment, and the user-mode API call sequence and the kernel-mode system call sequence are obtained using dynamic binary instrumentation technology.

[0015] Furthermore, in step 2), the obtained user-mode API call sequence and kernel-mode system call sequence are deduplicated using a sequence deduplication algorithm to remove continuous sequence fragments of the same pattern and shorten the sequence length.

[0016] Furthermore, in step 3), the step of inputting the user-mode API call sequence of the training sample set into the random forest algorithm for supervised learning training includes:

[0017] Extract context features of user-mode API call sequences;

[0018] Use the information gain algorithm to select the context features and extract the feature vectors of key features;

[0019] The feature vectors of key features are input into the random forest algorithm for supervised learning training.

[0020] Furthermore, the N-Gram algorithm is used to extract context features of user-mode API call sequences.

[0021] Furthermore, the N-Gram algorithm is preferably preferred over the 1-Gram algorithm.

[0022] Furthermore, during the training of the random forest algorithm, its decision tree is split according to the Gini Impurity.

[0023] Furthermore, the step of training and obtaining the kernel state behavior feature detection model in step 4) includes:

[0024] The kernel-mode system call sequences in the training sample set are pre-trained with the Continuous Bag of Words (CBOW) method in the Word2vec model to obtain the vector representation of each system call.

[0025] Using the vector representation obtained by pre-training, each independent system call in the kernel-mode system call sequence in the training sample set is converted into a corresponding vector form, and the feature vector of each sample is constructed. These feature vectors are input into the hybrid neural network for supervised learning training to generate the initial kernel-mode behavior feature detection model;

[0026] Using the vector representation obtained by pre-training, each independent system call in the kernel-state system call sequence in the verification sample set is converted into a corresponding vector form, and the feature vector of each sample is constructed. These feature vectors are input into the initial kernel-state behavior feature detection model, and the parameters of the hybrid neural network model are optimized to obtain the kernel-state behavior feature detection model.

[0027] Furthermore, a binary cross entropy loss function is used during the supervised learning training of the hybrid neural network.

[0028] An evasive malware detection system, comprising:

[0029] The behavior information capture module is used to monitor the behavior of the software under test, record its user-mode API call sequence and kernel-mode system call sequence, and send them to the behavior information analysis module;

[0030] The behavior information analysis module is used to analyze the user-mode API call sequence and kernel-mode system call sequence of the software to be tested through the trained polymorphic behavior feature integrated detection model to obtain the detection result of whether it is evasive malware.

[0031] The positive effects of the present invention are as follows:

[0032] The present invention effectively captures the behavioral characteristics of malware at different operation levels by fusing classifiers based on two different sequences, namely, the user-state behavior feature detection model and the kernel-state behavior feature detection model, based on user-state API call sequences and kernel-state system call sequences. The present invention fuses the outputs of multiple classifiers through a stacking method, significantly improving the accuracy and efficiency of detecting evasive malware. Specifically, the user-state behavior feature detection model, as a user-state classifier, effectively captures the abnormal behavior of malware at the application layer by analyzing the interaction between the program and the high-level interface of the operating system; while the kernel-state behavior feature detection model, as a kernel-state classifier, focuses on analyzing the interaction between malware and the core functions of the system to capture deeper malicious behaviors. The features captured by each of the two classifiers are effectively fused in the stacking integration to form a comprehensive and more comprehensive evaluation system. The integration utilizes the complementarity of different classifiers in capturing different types of malicious behaviors, thereby significantly improving the detection capability of evasive malware. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 It is an overall flow chart of an evasive malware detection system according to an embodiment of the present invention.

[0034] Figure 2 It is a flow chart of behavior analysis performed by the behavior analysis module.

[0035] Figure 3 It is a flow chart of user mode behavior detection.

[0036] Figure 4 It is a flowchart of kernel-mode behavior detection. DETAILED DESCRIPTION

[0037] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention and to make the objects, features and advantages of the present invention more obvious and easy to understand, the technical core of the present invention is further described in detail below with reference to the accompanying drawings and examples.

[0038] This embodiment provides a method for detecting evasive malware, which mainly includes the following steps:

[0039] 1) Collect normal software samples and evasive malware samples, and construct training sample sets and validation sample sets containing both types of samples;

[0040] 2) Run and analyze each sample in the training sample set and the verification sample set to obtain the user state API call sequence and the kernel state system call sequence;

[0041] 3) Input the user-mode API call sequence of the training sample set into the random forest algorithm for supervised learning training, and use the user-mode API call sequence of the verification sample set for parameter optimization to obtain a user-mode behavior feature detection model;

[0042] 4) The kernel-mode system call sequence of the training sample set is input into a hybrid neural network based on CNN and Bi-LSTM for supervised learning training, and the kernel-mode system call sequence of the verification sample set is used for parameter optimization to obtain a kernel-mode behavior feature detection model;

[0043] 5) The user-state behavior features predicted by the user-state behavior feature detection model and the kernel-state behavior features predicted by the kernel-state behavior feature detection model are combined into meta-features, which are input into the naive Bayes algorithm for supervised learning training to obtain a meta-model;

[0044] 6) The user-mode behavior feature detection model and the kernel-mode behavior feature detection model are used as base models to form an initial polymorphic behavior feature integrated detection model together with the meta-model, and the user-mode API call sequence and kernel-mode system call sequence of the verification sample set are used to optimize the parameters of the meta-model to obtain a trained polymorphic behavior feature integrated detection model;

[0045] 7) Capture the behavior information of the software and input it into the trained polymorphic behavior feature integrated detection model to predict whether it is evasive malware.

[0046] This embodiment provides an evasive malware detection system, whose modules can implement the specific functions of the above method, such as Figure 1 The specific instructions are as follows:

[0047] Step 100: The behavior information capture module is responsible for dynamically executing the program file to be tested. During the execution process, the module tracks and records the behavior information of the program. This information covers the program's activities in user mode and kernel mode in detail, including but not limited to user mode API call names and kernel mode system call names. These detailed behavior records provide the necessary data basis for subsequent malware detection.

[0048] Step 200: The behavior information analysis module performs evasive malware detection based on the behavior information of the program provided by the behavior information capture module. The behavior information analysis module uses an integrated learning method based on the stacking method to analyze the captured behavior information. The method includes two base models: a user-mode behavior feature detection model and a kernel-mode behavior feature detection model, and a polymorphic behavior feature integrated detection model. The user-mode behavior detection model and the kernel-mode behavior detection model independently analyze the user-mode and kernel-mode behavior data, respectively, to identify potential malicious behavior patterns. The outputs of the two models are then passed to the polymorphic behavior feature integrated detection model. The polymorphic behavior feature integrated detection model is responsible for synthesizing the outputs of the two models to produce a comprehensive analysis result.

[0049] Figure 2 The flowchart of the behavior analysis module is shown as follows:

[0050] Step 210: The behavior analysis module applies a sequence deduplication algorithm to the collected user-mode API call sequences and kernel-mode call sequences to remove repeated pattern sequences and shorten the sequence length; the specific implementation details of the deduplication algorithm are described in detail in Table 1.

[0051] Table 1 Sequence deduplication algorithm table

[0052]

[0053] Step 220: Analyze the user state behavior data using the user state behavior feature detection model and output a user state prediction probability value. The model focuses on identifying malicious behavior patterns related to user level interactions.

[0054] Step 260: Analyze the kernel state behavior data using the kernel state behavior feature detection model and output a kernel state prediction probability value. The model is dedicated to identifying malicious activities that may be carried out at the core level of the operating system.

[0055] Step 290: Use the meta-model to analyze the outputs of step 220 and step 260. The meta-model is used to effectively combine the predictions of the base model to improve the overall prediction performance. In this step, the meta-model of the present invention uses the Naive Bayes algorithm.

[0056] Figure 3 The flowchart of user mode behavior detection is shown as follows:

[0057] Step 230: Use the N-Gram algorithm to process the sequence data and generate context-related corpus features. By comparing different context feature generation models, the optimal detection model is determined to effectively identify evasive malware. In this embodiment, the range of the N-Gram algorithm is set to 1 to 4. After a series of experimental verifications, when 1-Gram is used to extract grammatical structure features, the detection efficiency of user-mode malware is most significant.

[0058] Step 240: Use the information gain algorithm to filter the context features, with the goal of reducing the dimension of the features while retaining the key features. The feature vectors generated by this process further optimize the processing capabilities of the model. For the vectorization of sequence data, if the sample contains a key feature, the vector value of the feature is set to 1, otherwise it is set to 0.

[0059] Step 250: Use the context corpus vector extracted in step 240 as input and pass it into the random forest algorithm for supervised learning to generate a user-mode behavior detection model. Evaluate the detection effect of the model through the test sample set, and optimize the parameters based on the feedback until the best evasive malware detection model is determined.

[0060] Figure 4 The figure shows the flow chart of kernel mode behavior detection. The specific process is as follows:

[0061] Step 270: This step uses the CBOW method in the Word2Vec model to perform word vector training on the system calls in the training sample set to obtain a vector representation of each system call.

[0062] Step 280: The vectorized sequence data is input into a hybrid neural network composed of CNN and Bi-LSTM. A kernel state behavior detection model is generated through supervised learning. The detection effect of the model is evaluated through a test sample set, and parameters are optimized accordingly until the most effective evasive malware detection model is determined.

[0063] Experiment and result analysis:

[0064] In order to verify the effectiveness of the present invention, the present invention collected 366 evasive malware samples and 391 benign software samples from the ANY.RUN website and the CNET app store as the test data of this experiment, and used the accuracy and F1 value as evaluation indicators to conduct experiments. This experiment selected the optimal classifier built based on the user-mode API call sequence and the optimal classifier built based on the kernel-mode system call sequence for integration, and conducted a test experiment on the integrated classifier, and compared it with the performance of the individual classifiers. The experimental results are shown in the following table:

[0065] Table 2 Model validity verification experimental results

[0066]

[0067] Experimental data show that the detection accuracy of the user-state behavior feature detection model and the kernel-state behavior feature detection model reached 96.82% and 98.14% respectively, proving the effectiveness of the user-state API call sequence and kernel-state system call sequence selected by the present invention as detection features; the detection accuracy of the polymorphic behavior feature integrated detection model is as high as 98.41%, which is higher than the two separate classifiers before integration. This significant performance improvement proves that the detection method based on multi-classifier integration is not only effective, but also has obvious advantages in detection accuracy. This superiority stems from the ability of the integration strategy, which can combine the advantages of multiple classifiers to improve the overall detection performance.

[0068] Finally, it should be noted that the above implementation cases are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention is described in detail using examples, ordinary technicians in the field should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention, which should be included in the scope of the claims of the present invention.

Claims

1. A method for detecting evasive malware, It is characterized in that The following steps are involved: 1) Collect normal software samples and evasive malware samples, and construct training sample sets and validation sample sets containing both types of samples; 2) Run and analyze each sample in the training sample set and the verification sample set to obtain the user state API call sequence and the kernel state system call sequence; 3) Input the user-mode API call sequence of the training sample set into the random forest algorithm for supervised learning training, and use the user-mode API call sequence of the verification sample set for parameter optimization to obtain a user-mode behavior feature detection model; 4) The kernel-state system call sequence of the training sample set is input into a hybrid neural network based on a convolutional neural network and a bidirectional long short-term memory network for supervised learning training, and the kernel-state system call sequence of the verification sample set is used for parameter optimization to obtain a kernel-state behavior feature detection model; 5) The user-state behavior features predicted by the user-state behavior feature detection model and the kernel-state behavior features predicted by the kernel-state behavior feature detection model are combined into meta-features, which are input into the naive Bayes algorithm for supervised learning training to obtain a meta-model; 6) The user-mode behavior feature detection model and the kernel-mode behavior feature detection model are used as base models to form an initial polymorphic behavior feature integrated detection model together with the meta-model, and the user-mode API call sequence and kernel-mode system call sequence of the verification sample set are used to optimize the parameters of the meta-model to obtain a trained polymorphic behavior feature integrated detection model; 7) Capture the behavior information of the software and input it into the trained polymorphic behavior feature integrated detection model to predict whether it is evasive malware.

2. The method according to claim 1, It is characterized in that Step 1) evasive malware sample files and normal software sample files in the training sample set and the verification sample set are executed in a malware analysis environment, and the user state API call sequence and kernel state system call sequence are obtained by using dynamic binary instrumentation technology.

3. The method according to claim 1, It is characterized in that In step 2), the obtained user-mode API call sequence and kernel-mode system call sequence are deduplicated using a sequence deduplication algorithm to remove continuous sequence fragments of the same pattern and shorten the sequence length.

4. The method according to claim 1, It is characterized in that In step 3), the step of inputting the user-mode API call sequence of the training sample set into the random forest algorithm for supervised learning training includes: Extract context features of user-mode API call sequences; Use the information gain algorithm to select the context features and extract the feature vectors of key features; The feature vectors of key features are input into the random forest algorithm for supervised learning training.

5. The method according to claim 4, It is characterized in that The N-Gram algorithm is used to extract context features of user-mode API call sequences.

6. The method according to claim 5, It is characterized in that The N-Gram algorithm uses the 1-Gram algorithm.

7. The method according to claim 1 or 4, It is characterized in that During the training of the random forest algorithm, its decision trees are split according to the Gini impurity.

8. The method according to claim 1, It is characterized in that The steps of training and obtaining the kernel state behavior feature detection model in step 4) include: The kernel-mode system call sequences in the training sample set are pre-trained with the continuous bag-of-words method in the Word2vec model to obtain the vector representation of each system call. Using the vector representation obtained by pre-training, each independent system call in the kernel-mode system call sequence in the training sample set is converted into a corresponding vector form, and the feature vector of each sample is constructed. These feature vectors are input into the hybrid neural network for supervised learning training to generate the initial kernel-mode behavior feature detection model; Using the vector representation obtained by pre-training, each independent system call in the kernel-state system call sequence in the verification sample set is converted into a corresponding vector form, and the feature vector of each sample is constructed. These feature vectors are input into the initial kernel-state behavior feature detection model, and the parameters of the hybrid neural network model are optimized to obtain the kernel-state behavior feature detection model.

9. The method according to claim 1 or 8, It is characterized in that During the supervised learning training of the hybrid neural network, the binary cross entropy loss function is used.

10. An evasive malware detection system, based on the method according to any one of claims 1 to 9, It is characterized in that include: The behavior information capture module is used to monitor the behavior of the software under test, record its user-mode API call sequence and kernel-mode system call sequence, and send them to the behavior information analysis module; The behavior information analysis module is used to analyze the user-mode API call sequence and kernel-mode system call sequence of the software to be tested through the trained polymorphic behavior feature integrated detection model to obtain the detection result of whether it is evasive malware.

Citation Information

Patent Citations

  • Abnormal behavior detection method and device during container running and a model training method and device

    CN112860484A

  • Power Internet of Things equipment behavior security detection method, system and equipment and storage medium

    CN114090406A