Method, device, computer equipment and storage medium for determining malicious degree of behavior

The deep learning model identifies and evaluates the behavior sequence of malware, calculates its heat value to determine the degree of malice, solves the problem of setting sandbox behavior rules in dynamic analysis, and improves the accuracy and comprehensiveness of malware detection.

CN112632541BActive Publication Date: 2024-10-15QI-ANXIN LEGENDSEC INFORMATION TECH (BEIJING) INC +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011594338.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-29
Publication Date
2024-10-15
Estimated Expiration
2040-12-29

AI Technical Summary

Technical Problem

In the existing technology, the difficulty of dynamic analysis and detection of malware lies in how to accurately and comprehensively set and develop sandbox behavior rules, especially to determine the maliciousness of the malware execution behavior, thereby improving the accuracy and comprehensiveness of the sandbox behavior rules. .

Method used

A deep learning model is used to convert the behavior sequence generated by the software in the sandbox environment into high-level features. The software category is identified through the preset deep learning model, and the thermal value of the behavior in the behavior sequence is calculated to determine its degree of maliciousness. The method includes constructing the input vector of the deep learning model, converting it into high-level features, calculating the thermal value, and determining the maliciousness of the behavior based on the thermal value. The larger the thermal value, the higher the degree of maliciousness.

Benefits of technology

The deep learning model determines the category of malware and the degree of malicious behavior, which improves the accuracy and comprehensiveness of sandbox behavior rules. It can analyze the reasons for missed detections and optimize engine rules to enhance the ability to identify malicious behaviors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112632541B_ABST
    Figure CN112632541B_ABST
Patent Text Reader

Abstract

The present application provides a method, device, computer equipment and storage medium for determining the maliciousness of behavior. The method includes: generating a behavior sequence according to the behavior of the software in a sandbox environment; constructing an input vector of a preset deep learning model according to the behavior sequence; inputting the input vector into a preset deep learning model, wherein the deep learning model is used to convert the input vector into high-level features, and determine the category of the software according to the high-level features, and the categories include malware and non-malware software; when the software belongs to malware, the thermal value corresponding to the behavior in the behavior sequence is calculated according to the high-level features; and the maliciousness of the behavior in the behavior sequence is determined according to the thermal value, wherein the greater the thermal value, the greater the maliciousness of the behavior. Through the present application, the maliciousness of the malware execution behavior can be determined, which is conducive to improving the accuracy and comprehensiveness of the sandbox behavior rules.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of security information processing, and in particular to a method, apparatus, computer device and readable storage medium for determining the maliciousness of a behavior. Background Art

[0002] Malware refers to a computer program that has a variety of malicious behaviors in order to achieve the purpose of unauthorized control of computers or stealing computer data. At present, the main methods for detecting computer malware are divided into static analysis and dynamic analysis. Static analysis refers to the detection of malware by analyzing the software source code without running the software. Its advantage is fast detection speed, but more and more malware uses various obfuscation methods such as shelling and flower instructions to bypass static detection, resulting in a decrease in the effectiveness of static analysis methods. Dynamic analysis refers to running the software in a sandbox and analyzing the host behavior, network behavior and other behaviors it generates, and then determining whether the software is malware. Although the speed is slightly slower, it captures the most essential behavioral characteristics and is much more accurate than the static analysis method.

[0003] The inventors have found that the difficulty of dynamic analysis lies in how to accurately and comprehensively set and develop a set of sandbox behavior rules to determine malware, and when setting sandbox behavior rules, it is necessary to determine the maliciousness of the malware execution behavior. Therefore, how to determine the maliciousness of the malware execution behavior to improve the accuracy and comprehensiveness of the sandbox behavior rules has become a technical problem that urgently needs to be solved in this field. Summary of the invention

[0004] The purpose of this application is to provide a method, device, computer equipment and readable storage medium for determining the maliciousness of behavior, so as to solve the technical problems in the prior art.

[0005] On the one hand, to achieve the above objectives, the present application provides a method for determining the degree of maliciousness of an action.

[0006] The method for determining the maliciousness of behavior includes: generating a behavior sequence based on the behavior of the software in a sandbox environment; constructing an input vector of a preset deep learning model based on the behavior sequence; inputting the input vector into the preset deep learning model, wherein the deep learning model is used to convert the input vector into high-level features, and determine the category of the software based on the high-level features, and the category includes malware and non-malware software; when the software is malware, calculating the thermal value corresponding to the behavior in the behavior sequence based on the high-level features; and determining the maliciousness of the behavior in the behavior sequence based on the thermal value, wherein the larger the thermal value, the greater the maliciousness of the behavior.

[0007] Furthermore, the deep learning model is used to convert the input vector into high-level features of multiple channels, and the step of calculating the thermal value corresponding to the behavior in the behavior sequence based on the high-level features includes: calculating the sensitivity of the high-level features of each channel to the malware category; determining the weight corresponding to the high-level features based on the sensitivity; weighted summing the high-level features of each channel according to the weights corresponding to the high-level features to obtain the thermal distribution corresponding to the behavior sequence; and determining the thermal value based on the thermal distribution corresponding to the behavior sequence.

[0008] Furthermore, the deep learning model determines the category of the software according to the high-level features by: outputting the score of the software on the malware category according to the high-level features, and the step of calculating the sensitivity of the high-level features of each channel to the malware category includes: calculating the partial derivative of the score with respect to the high-level features; when the high-level features are two-dimensional feature graphs, taking the global average of the width and height dimensions of the partial derivatives to obtain the sensitivity; when the high-level features are one-dimensional feature vectors, taking the global average of the width dimension of the partial derivatives to obtain the sensitivity.

[0009] Furthermore, when the high-level feature is a two-dimensional feature graph, the thermal distribution includes multiple thermal vectors corresponding one-to-one to the behaviors, and the step of determining the thermal value according to the thermal distribution corresponding to the behavior sequence includes: extracting the maximum value in the thermal vector or calculating the average value of the positive values ​​in the thermal vector to obtain the thermal value corresponding to the behavior.

[0010] Furthermore, after the step of determining the thermal value according to the thermal distribution corresponding to the behavior sequence, the method for determining the maliciousness degree of the behavior also includes: processing the thermal value corresponding to each behavior in the behavior sequence, wherein if the thermal value is less than the preset threshold, the thermal value is set to 0, and if the thermal value is greater than or equal to the preset threshold, the thermal value is kept unchanged; normalizing the processed thermal value to [0,255]; and mapping the normalized thermal value to the RGB space for display.

[0011] Furthermore, the step of constructing an input vector of a preset deep learning model based on the behavior sequence includes: searching for an identifier corresponding to the behavior in the behavior sequence in the behavior dictionary corresponding to the sandbox; converting the identifier corresponding to the behavior into a onehot code; and using the onehot code corresponding to the behavior sequence as the input vector of the deep learning model.

[0012] Furthermore, the step of generating a behavior sequence based on the behavior of the software in the sandbox environment includes: obtaining the operation log of the software in the sandbox environment, wherein the operation log includes multiple behaviors, and the behaviors include API names; forming the behavior sequence through the API names in the operation log, wherein the order of the API names in the behavior sequence is consistent with the execution order of the behaviors.

[0013] Furthermore, the following steps are adopted to construct a behavior dictionary corresponding to the sandbox: obtaining multiple operation logs of the sandbox within a preset time period; and constructing the behavior dictionary according to the API names in the multiple operation logs.

[0014] Furthermore, the behavior dictionary includes N API names, and the step of searching for an identifier corresponding to the behavior in the behavior sequence in the behavior dictionary corresponding to the sandbox includes: searching for the API name in the behavior sequence in the behavior dictionary; when the API name is in the behavior dictionary, determining that the identifier corresponding to the behavior where the API name is located is the position number of the API name in the behavior dictionary; when the API name is not in the behavior dictionary, determining that the identifier corresponding to the behavior where the API name is located is N+1.

[0015] Furthermore, the step of converting the identifier corresponding to the behavior into a onehot code includes: setting the onehot code to include N+1 elements; when the identifier corresponding to the behavior is M, setting the Mth element of the onehot code to 1 and the remaining elements to 0.

[0016] Furthermore, the step of constructing the behavior dictionary through the API names in the multiple operation logs includes: for each of the multiple operation logs, extracting the API names in the operation logs according to the behavior execution order to obtain a first sequence; removing the API names before the API name TryToAnalyze and after the API name AnalyzeStop in the first sequence to obtain a second sequence; aggregating the second sequences corresponding to the multiple operation logs to obtain an API name set; and deduplicating the same API names in the API name set to obtain the behavior dictionary.

[0017] Furthermore, the step of forming the behavior sequence through the API names in the operation log includes: extracting the API names in the operation log corresponding to the software in the order of behavior execution to obtain a third sequence; removing the API names before the API name TryToAnalyze and after the API name AnalyzeStop in the third sequence to obtain a fourth sequence; when the number of API names in the fourth sequence is greater than a first threshold and less than or equal to a second threshold, determining that the fourth sequence is the behavior sequence; when the number of API names in the fourth sequence is greater than the second threshold, intercepting the first second threshold number of API names in the fourth sequence as the behavior sequence.

[0018] On the other hand, to achieve the above-mentioned purpose, the present application provides a device for determining malicious behavior.

[0019] The malicious behavior determination device includes: a generation module, which is used to generate a behavior sequence according to the behavior of the software in a sandbox environment; a construction module, which is used to construct an input vector of a preset deep learning model according to the behavior sequence; an input module, which is used to input the input vector into the preset deep learning model, wherein the deep learning model is used to convert the input vector into high-level features and determine the category of the software according to the high-level features, and the category includes malware and non-malware; a calculation module, which is used to calculate the thermal value corresponding to the behavior in the behavior sequence according to the high-level features when the software belongs to malware; and a determination module, which is used to determine the maliciousness of the behavior in the behavior sequence according to the thermal value, wherein the larger the thermal value, the greater the maliciousness of the behavior.

[0020] On the other hand, to achieve the above objectives, the present application also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the above method when executing the computer program.

[0021] On the other hand, to achieve the above-mentioned purpose, the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned method are implemented.

[0022] The method, device, computer equipment and readable storage medium for determining the malicious degree of behavior provided by the present application preset a deep learning model to identify the software and determine whether the software belongs to malware or non-malware. After obtaining the identification result, when the software belongs to malware, the high-level features of the deep learning model are used to further determine which behaviors of the software execution have a high malicious degree. Among them, when determining the category of the software, a behavior sequence is generated according to the behavior of the software in the sandbox environment, and the input vector of the deep learning model is constructed with this behavior sequence. When the input vector is input into the deep learning model, the deep learning model converts the input vector into a high-level feature and determines the category of the software according to the high-level feature; when the software belongs to malware, when determining the malicious behavior in the behavior sequence, the thermal value corresponding to the behavior in the behavior sequence is calculated according to the high-level features output by the deep learning model, and then the malicious degree of the behavior in the behavior sequence is determined according to the thermal value, wherein the larger the thermal value, the greater the malicious degree rate of the behavior. Through this application, after using a deep learning model to identify malware, the maliciousness of the malware's execution behavior can be further determined, so that it can be compared with the sandbox behavior rules. In particular, when the sandbox misses a detection, the reason for the missed detection can be analyzed or valuable typical malicious behaviors can be found, thereby optimizing the engine rules and improving the accuracy and comprehensiveness of the sandbox behavior rules. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0024] Figure 1 A flowchart of a method for determining the maliciousness of a behavior provided in Example 1 of the present application;

[0025] Figure 2 A flowchart of a method for determining the maliciousness of a behavior provided in Example 2 of the present application;

[0026] Figure 3 A schematic diagram of deep learning model training in the method for determining the maliciousness of behavior provided in Example 2 of the present application;

[0027] Figure 4 A block diagram of a device for determining malicious behavior provided in Embodiment 3 of the present application;

[0028] Figure 5 This is a hardware structure diagram of the computer device provided in Example 4 of the present application. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0030] In order to determine the malicious behavior performed by malware, so as to guide the setting of sandbox behavior rules and improve the accuracy and comprehensiveness of sandbox behavior rules, the present application provides a method, apparatus, computer equipment and readable storage medium for determining the malicious degree of behavior. In the method for determining the malicious degree of behavior, a behavior sequence is first generated according to the behavior of the software in the sandbox environment, and the behavior sequence is constructed as an input vector of a preset deep learning model and input into the preset deep learning model. The deep learning model is used to convert the input vector into a high-level feature and determine the category of the software according to the high-level feature, that is, determine whether the software belongs to malware or non-malware software. When the software belongs to malware, the thermal value corresponding to the behavior in the behavior sequence is calculated according to the high-level feature, and finally the malicious degree of the behavior in the behavior sequence is determined according to the thermal value, wherein the larger the thermal value, the greater the malicious degree of the behavior. After determining the malicious degree of the behavior, the existing sandbox behavior rules can be analyzed and the sandbox behavior rules can be updated so that the sandbox behavior rules can determine behaviors with higher malicious degrees as behaviors with higher malicious levels, thereby improving the accuracy and comprehensiveness of the sandbox behavior rules.

[0031] The specific embodiments of the method, apparatus, computer device and readable storage medium for determining the maliciousness of a behavior provided in the present application will be described in detail below.

[0032] Embodiment 1

[0033] The first embodiment of the present application provides a method for determining the maliciousness of behavior. Through this method, it is possible to determine that malware is more likely to exhibit malicious behavior when executed in a sandbox, and use this as a basis for formulating sandbox behavior rules to improve the accuracy and comprehensiveness of sandbox behavior rules. Specifically, Figure 1 This is a flow chart of a method for determining the maliciousness of a behavior provided in Example 1 of the present application, such as Figure 1 As shown, the method for determining the maliciousness level of a behavior provided by this embodiment includes the following steps S101 to S105.

[0034] Step S101: Generate a behavior sequence according to the behavior of the software in the sandbox environment.

[0035] Specifically, when the software is running in a sandbox environment, a sandbox report in a format such as XML or JSON is generated. The report content includes the running log of the software in the sandbox environment. The running log consists of multiple behaviors that are executed sequentially during the running of the software. Through these sequentially executed behaviors, a behavior sequence can be generated. Optionally, the behavior sequence may include all behaviors of the software during the running process, or it may also include part of the behaviors of the software during the running process. The behaviors in the behavior sequence can be identified by some or all of the characteristics of the behavior. For example, the behavior data in the running log includes the characteristics such as the English name of the API corresponding to the behavior, the Chinese name of the API, and the description of the behavior. The behavior description can be used to identify the behavior, and the behavior sequence is actually a behavior description sequence. Alternatively, the behavior can be identified by the API English name, and the behavior sequence is actually an API English name sequence.

[0036] Step S102: construct an input vector of a preset deep learning model according to the behavior sequence.

[0037] Specifically, a deep learning model is preset, which is trained with a software sample training set and can identify the category of the software. Specifically, it can be a convolutional neural network, a recurrent neural network or a deep belief network, etc. Preset behavior vectorization rules to convert the behavior sequence into an input vector of the deep learning model. For example, when the behavior sequence is a behavior description sequence, the behavior description corresponding to each behavior in the behavior sequence can be segmented and filtered, and further converted into a word vector, and the input vector of the deep learning model is constructed through the word vector. For another example, when the behavior sequence is the English name of the behavior API, the English name of the API corresponding to each behavior in the behavior sequence is directly converted into a word vector to construct the input vector of the deep learning model.

[0038] Regardless of how the input vector is constructed, the deep learning model is used to convert the input vector into high-level features and determine the category of the software based on the high-level features, which include malware and non-malware. Specifically, the deep learning model originates from an artificial neural network, which can be structurally understood as a neural network containing multiple hidden layers, such as a convolutional neural network, a recurrent neural network, a deep belief network, etc. The deep learning model uses the hidden layers in the model to convert the original input vector into shallow features, middle features, and high-level features layer by layer by combining low-level features until the final task goal, that is, determining the category of the software and achieving software classification. The high-level features in this application refer to the features output by the last hidden layer in the deep learning model.

[0039] Optionally, in one embodiment, a behavior dictionary corresponding to the sandbox is constructed. When constructing an input vector of a preset deep learning model according to a behavior sequence, the identifier corresponding to each behavior in the behavior sequence is searched in the behavior dictionary corresponding to the sandbox, and then the identifier corresponding to each behavior is vectorized and converted into onehot encoding respectively, and the onehot encoding corresponding to all behaviors in the behavior sequence is used as the input vector of the deep learning model. The position number of each behavior in the behavior dictionary is set as the identifier corresponding to the behavior.

[0040] Step S103: Input the input vector into a preset deep learning model.

[0041] After constructing the input vector corresponding to the software through the above step S102, in this step S103, the input vector is input into the preset deep learning model. The deep learning model forms more abstract high-level features by combining low-level features to discover the distributed feature representation of the data, and outputs the confidence or probability score of the software on the malware category. Through this score, it can be determined whether the software belongs to malware. Optionally, the activation function of the output layer of the deep learning model is set to a softmax function. Accordingly, the score value range of the deep learning model output must be between 0 and 1. The score threshold can be set according to experience to classify the software. For example, if the score threshold is set to 0.99, then when the score output by the deep learning model is greater than or equal to 0.99, the software can be determined to be malware.

[0042] Step S104: When the software is malware, the thermal value corresponding to the behavior in the behavior sequence is calculated according to the high-level features.

[0043] When the software is considered malicious software, the importance of each behavior in the behavior sequence is analyzed and calculated using high-level features. Feature visualization technology based on Class Activation Map (class activation map or class heat map) can be used, such as CAM, Grad-CAM, Grad-CAM++, and Smooth Grad-CAM++ algorithms, to calculate the thermal value corresponding to the behavior. The larger the thermal value corresponding to the behavior, the more important the behavior is for the software to be judged as malicious software.

[0044] Step S105: Determine the maliciousness of the behaviors in the behavior sequence according to the thermal value.

[0045] Optionally, after calculating the thermal value corresponding to the behavior in the behavior sequence, the maliciousness of the behavior is calculated according to the thermal value. The thermal value is positively correlated with the maliciousness of the behavior. The larger the thermal value, the greater the maliciousness of the behavior. Alternatively, the thermal value can be used as the maliciousness of the behavior, and further, the behaviors corresponding to a larger portion of the thermal values ​​can be used as malicious behaviors in the behavior sequence; or, optionally, a thermal value threshold is preset, and the behaviors corresponding to the thermal values ​​greater than the thermal value threshold are used as malicious behaviors in the behavior sequence.

[0046] In the method for determining the malicious degree of behavior provided in this embodiment, a deep learning model is preset to identify the software and determine whether the software belongs to malware or non-malware. After obtaining the identification result, when the software belongs to malware, the high-level features of the deep learning model are used to further determine which behaviors of the software execution have a high malicious degree. When determining the category of the software, a behavior sequence is generated according to the behavior of the software in the sandbox environment, and the input vector of the deep learning model is constructed with this behavior sequence. When the input vector is input into the deep learning model, the deep learning model converts the input vector into a high-level feature and determines the category of the software according to the high-level feature. When the software belongs to malware, when determining the malicious behavior in the behavior sequence, the thermal value corresponding to the behavior in the behavior sequence is calculated according to the high-level features output by the deep learning model, and then the malicious degree of the behavior in the behavior sequence is determined according to the thermal value, wherein the larger the thermal value, the greater the malicious degree of the behavior. By adopting the method for determining the malicious degree of behavior provided in this embodiment, after determining the malware through a deep learning model, the malicious degree of the behavior executed by the malware can be further determined, so that it can be compared with the sandbox behavior rules. In particular, when the sandbox misses the software, the reason for the missed detection can be analyzed or valuable typical malicious behaviors can be found, thereby optimizing the engine rules and improving the accuracy and comprehensiveness of the sandbox behavior rules.

[0047] Optionally, in one embodiment, the behavior is identified by the API name of the behavior to generate a behavior sequence. Specifically, the step of generating a behavior sequence based on the behavior of the software in the sandbox environment includes: obtaining the running log of the software in the sandbox environment, wherein the running log includes multiple behaviors, and the behaviors include API names; forming a behavior sequence through the API names in the running log, wherein the order of the API names in the behavior sequence is consistent with the execution order of the behaviors, that is, the behavior sequence is actually an API name sequence, and the order of the API name sequence is arranged according to the execution order of the behaviors.

[0048] Accordingly, the following steps are used to construct the behavior dictionary corresponding to the sandbox: obtain multiple operation logs of the sandbox within a preset time period. For example, obtain the operation logs of the sandbox within a few months, which can obtain millions or tens of millions of operation logs. The behavior dictionary is constructed by extracting the API names in these operation logs. The behavior dictionary includes the API name and the identifier corresponding to each API name. When determining the identifier corresponding to the behavior, search for each API name in the behavior sequence in the behavior dictionary, and obtain its corresponding identifier when it is found.

[0049] Optionally, in one embodiment, the behavior dictionary includes N API names, and in the behavior dictionary corresponding to the sandbox, the step of searching for the identifier corresponding to the behavior in the behavior sequence includes: searching for the API name in the behavior sequence in the behavior dictionary; when the API name is in the behavior dictionary, determining that the identifier corresponding to the behavior where the API name is located is the position number of the API name in the behavior dictionary; when the API name is not in the behavior dictionary, determining that the identifier corresponding to the behavior where the API name is located is N+1. Accordingly, the step of converting the identifier corresponding to the behavior into a onehot code includes: setting the onehot code to include N+1 elements; when the identifier corresponding to the behavior is M, setting the Mth element of the onehot code to 1, and the remaining elements to 0.

[0050] By adopting the method for determining the malicious degree of behavior provided in this embodiment, a behavior sequence and a behavior dictionary are constructed using API names, which can not only accurately characterize the characteristics of the behavior and help to accurately determine malicious behavior, but also has simple processing logic; when constructing the behavior dictionary, it is constructed based on the historical operation log of the sandbox to ensure that the behavior dictionary can more comprehensively cover the running behavior of the software to be identified in the sandbox to vectorize the behavior; in the process of vectorizing the behavior, for the behavior dictionary including N API names, a onehot code is set to include N+1 elements. When the actual software to be detected behaves in the sandbox terminal and an API name that is not in the behavior dictionary appears, the onehot code can still be converted normally.

[0051] Optionally, in one embodiment, the step of constructing a behavior dictionary through API names in multiple operation logs includes: for each operation log in the multiple operation logs, extracting the API names in the operation log in the order of behavior execution to obtain a first sequence; removing the API names before the API name TryToAnalyze and after the API name AnalyzeStop in the first sequence to obtain a second sequence; aggregating the second sequences corresponding to the multiple operation logs to obtain an API name set; removing the same API names in the API name set to obtain a behavior dictionary. The step of forming a behavior sequence through API names in the operation log includes: extracting the API names in the operation log corresponding to the software in the order of behavior execution to obtain a third sequence; removing the API names before the API name TryToAnalyze and after the API name AnalyzeStop in the third sequence to obtain a fourth sequence; when the number of API names in the fourth sequence is greater than the first threshold and less than or equal to the second threshold, determining that the fourth sequence is a behavior sequence, and when the number of API names in the fourth sequence is greater than the second threshold, intercepting the first second threshold number of API names in the fourth sequence as the behavior sequence.

[0052] Specifically, the inventors have found that no matter the software is non-malware or malware, the API names in the corresponding sandbox operation log before the start of TryToAnalyze analysis and after the end of AnalyzeStop analysis are the same. Therefore, whether setting the behavior dictionary or building the behavior sequence, removing the API names before TryToAnalyze and after AnalyzeStop can avoid unnecessary redundant calculations without affecting the accuracy of malware identification, thereby saving computing resources; limiting the behavior sequence between the first threshold and the second threshold can, on the one hand, ensure the accuracy of software identification, and on the other hand, avoid redundant data calculations caused by too long a behavior sequence. The first threshold is preferably 10, and the second threshold is preferably between 5000 and 10000.

[0053] Optionally, in one embodiment, a deep learning model is used to convert the input vector into high-level features of multiple channels. When the software belongs to malware, the step of calculating the thermal value corresponding to the behavior in the behavior sequence based on the high-level features includes: calculating the sensitivity of the high-level features of each channel to the malware category; determining the weight corresponding to the high-level features based on the sensitivity; weighted summing the high-level features of each channel according to the weights corresponding to the high-level features to obtain the thermal distribution corresponding to the behavior sequence; and determining the thermal value based on the thermal distribution corresponding to the behavior sequence.

[0054] Specifically, when the deep learning model adopts a multi-channel model, the input vector is converted into high-level features of multiple channels. When calculating the thermal value corresponding to the behavior in the behavior sequence based on the high-level features, the sensitivity of the high-level features of each channel on the malware category is first calculated, and then the weight corresponding to the high-level features is calculated based on the sensitivity. For example, the sensitivity is directly used as the weight, and then the weight is multiplied by the high-level features of the channel to obtain a product corresponding to each channel. All products are then added together to obtain the thermal distribution corresponding to the behavior sequence, that is, the thermal distribution formed by all behaviors in the behavior sequence, and then the thermal value corresponding to each behavior is determined.

[0055] Among them, when the deep learning model determines the category of the software based on the high-level features, it outputs the score of the software in the malware category based on the high-level features. The higher the score, the greater the probability that the software belongs to malware. Based on this, when calculating the sensitivity of the high-level features of each channel to the malware category, the specific steps include: calculating the partial derivative of the score with respect to the high-level features; when the high-level features are two-dimensional feature maps, taking the global average of the width and height dimensions of the partial derivatives to obtain the sensitivity; when the high-level features are one-dimensional feature vectors, taking the global average of the width dimension of the partial derivatives to obtain the sensitivity.

[0056] Specifically, when the deep learning model includes a two-dimensional convolutional layer, the high-level feature is a two-dimensional feature map, and the partial derivative of the score with respect to the feature map of each channel of the last convolutional layer in the deep learning model is calculated. Then, the partial derivative of each channel is globally averaged in width and height dimensions to obtain the sensitivity of the feature map of each channel to the malware category. The sensitivity is used as a weight to perform weighted summation on the feature maps of each channel to obtain the thermal distribution corresponding to the behavior sequence. The thermal distribution at this point is also a two-dimensional heat map, including multiple thermal vectors corresponding to the behaviors one by one. At this time, when determining the thermal value corresponding to a behavior according to the two-dimensional heat map corresponding to the behavior sequence, the maximum value in the thermal vector corresponding to the behavior is extracted, or the average value of the positive values ​​in the heat vector corresponding to the behavior is calculated. Among them, the two-dimensional heat map corresponding to the behavior sequence expresses the "positive correlation" between the behavior and the score of the software belonging to malware. Each element in the heat map has a positive value, 0 or a negative value. If the value obtained by weighting the sensitivity of a certain position on the feature map is negative, then the information expressed by this position is more likely to belong to a category that is not malware. Therefore, the thermal value corresponding to the behavior only focuses on the positive value in the heat vector.

[0057] When the deep learning model includes a one-dimensional convolutional layer, the high-level features are one-dimensional feature vectors. The partial derivatives of the scores with respect to the feature vectors of each channel of the last convolutional layer in the deep learning model are calculated, and then the partial derivatives of each channel are globally averaged in a wide dimension to obtain the sensitivity of the feature vectors of each channel to the malware category. The sensitivity is used as a weight to perform weighted summation on the feature vectors of each channel to obtain the thermal distribution corresponding to the behavior sequence. The thermal distribution at this point is also a one-dimensional thermal vector, which includes multiple elements corresponding to the behaviors one by one. At this time, when determining the thermal value corresponding to a behavior according to the one-dimensional heat vector corresponding to the behavior sequence, the elements corresponding to each behavior in the one-dimensional heat vector can be extracted accordingly.

[0058] Optionally, in one embodiment, after the step of determining the thermal value according to the thermal distribution corresponding to the behavior sequence, the method for determining the degree of maliciousness of the behavior also includes: processing the thermal value corresponding to each behavior in the behavior sequence, wherein if the thermal value is less than a preset threshold, the thermal value is set to 0, and if the thermal value is greater than or equal to the preset threshold, the thermal value is kept unchanged; normalizing the processed thermal value to [0,255]; and mapping the normalized thermal value to RGB space for display.

[0059] Specifically, corresponding to the lower limit of the thermal value of important behaviors that need attention, a preset threshold is set to filter the behaviors that need attention. After determining the thermal value corresponding to the behavior, the thermal value is processed, and the thermal values ​​less than the preset threshold are set to 0, and then normalized to [0, 255]. Among them, the following calculation formula can be used to normalize each thermal value hi to [0, 255]: hi'=int[hi / max(hi)*255], and then the normalized thermal value hi' is mapped to the RGB space.

[0060] When mapping the thermal value hi' to the RGB space, it can be set that the darker the color, the greater the thermal value corresponding to the behavior, and the greater the probability that the behavior is malicious. The gradient of any color system can be specified. Preferably, a color system with strong color distinction is selected. In one embodiment, two colors can be specified and then converted to the HSV space for interpolation, the color corresponding to the intermediate thermal value is calculated, and then the normalized thermal value is converted back to the RGB space; in another embodiment, interpolation or normalization can be performed directly in the RGB space. Suppose the currently specified darkest color is RGB = (r, g, b), then a certain thermal value hi' needs to display the color RGB = (int((r / 255-1)*hi'+255), int((g / 255-1)*hi'+255), int((b / 255-1)*hi'+255)), which realizes the mapping of the thermal value hi' to the RGB space.

[0061] Taking the red series as an example, taking white (255,255,255) to dark red (128,0,0) as an example, dark red RGB = (128,0,0) represents the most malicious behavior, and the lightest color white RGB = (255,255,255) represents the least malicious behavior. The thermal value hi' corresponding to a certain behavior is 200, and it is mapped to the RGB space. The specific colors to be displayed are:

[0062] RGB=(int((128 / 255-1)*200+255),int((0 / 255-1)*200+255),int((0 / 255-1)*200+255))

[0063] =(155,55,55).

[0064] By using the method for determining the maliciousness degree of a behavior provided in this embodiment, after determining the thermal value corresponding to the behavior, the thermal value is mapped to the RGB space for display, which can intuitively show the degree to which the behavior is malicious, thereby facilitating analysts to analyze malware.

[0065] Embodiment 2

[0066] When analyzing whether the software is malware by analyzing the sandbox behavior log, the classification result can be directly determined by using a deep learning model. However, simply determining the classification result does not make the basis for the classification clear, and cannot guide the sandbox behavior determination rules. In this application, on the basis of determining whether the software is malware, it can automatically calculate which behaviors are more suspicious when the software is running in the sandbox, implement the model's behavioral interpretation, determine which behaviors are more likely to reflect malice, and provide the basis for the model to judge the software as malware, thereby guiding security analysts to operate key software samples, and at the same time using the important features learned by machine to compare the sandbox behavior rules, find out missed or other valuable typical behaviors, and optimize the engine rules.

[0067] Figure 2 This is a flow chart of a method for determining the maliciousness of a behavior provided in Example 2 of the present application, such as Figure 2 As shown in Figure 1, the method for determining the maliciousness of the behavior mainly includes five parts: building a training set, training a model, data preprocessing, model prediction, and behavior feature visualization.

[0068] 1. Build a training set

[0069] Get a sandbox report in XML or JSON format. The report content is the running log of the software in the sandbox environment. The running log consists of multiple behaviors. Each behavior at least includes the API name corresponding to the behavior (api_name and Chinese name), the malicious level of the behavior (level <= 0 is safe, 1 is unknown, 2 is sensitive, and 3 is dangerous) and a description of the behavior.

[0070] For example:

[0071]

[0072] Then, the behavior sequence corresponding to the software is generated according to the api_name in each log. Among them, the api_name before the TryToAnalyze analysis and after the AnalyzeStop analysis of each log is the same, which can be removed and does not need to participate in machine learning. The generated behavior sequence is, for example: (NtQueryAttributesFile, NtQueryAttributesFile, LoadLibraryExW, ...), which is called a valid behavior sequence. Then, these valid behavior sequences are used to construct the training set.

[0073] The valid behavior sequence selected into the training set needs to meet the following two conditions:

[0074] (1) The length of the effective behavior sequence of both black and white samples must be greater than or equal to 10. Behavior sequences less than 10 are not included in the training. When the software is predicting, in order to ensure the accuracy of the prediction, only the behavior sequences with a length greater than or equal to 10 are predicted;

[0075] (2) Each black sample must have at least one behavior that meets the level requirements, such as at least one behavior with a level of 1, 2, or 3. If the level of each behavior of a black sample is <= 0, it cannot be added to the training set. The level field is only used for training data screening and does not participate in the model training process. There is no such requirement for dialogue samples.

[0076] The black and white attributes of a sample, i.e., the machine learning label, can be obtained through the following four methods: (1) static analysis method; (2) dynamic analysis method: that is, the judgment result given by the sandbox report; (3) judgment through external data, such as VirusTotal; (4) comprehensive analysis: use at least two of the first three methods to comprehensively judge and determine the black and white attributes.

[0077] After extracting the valid behavior sequence, some data have different original software files with the same valid behavior sequence but with different md5. This is data redundancy and the same valid behavior sequence in the training set needs to be deduplicated and only one of the multiple identical sequences needs to be retained.

[0078] The final training set is the valid behavior sequence that meets the above conditions and the corresponding black and white attribute labels (0 means white, i.e. normal; 1 means black, i.e. malicious). The maximum length of the valid behavior sequence is set to a fixed value L. According to the actual data length statistics and business experience, L can be within 5000 to 10000. When the length of the valid behavior sequence exceeds L, the part exceeding L will be truncated and will not participate in the model training.

[0079] At the same time, count all non-repeated api_name in the above valid behavior sequence, assuming that a total of N api_name Through this N api_name Build a behavior dictionary based on each api_name.

[0080] 2. Model training

[0081] Figure 3 This is a schematic diagram of deep learning model training in the method for determining the maliciousness of behavior provided in Example 2 of the present application, such as Figure 3 As shown in the figure, after obtaining the training set, the behavior sequence of each sample in the training set, that is, the api_name sequence, is converted into a one-hot encoding. Specifically, considering that an api_name that is not in the training set may appear in the actual sandbox log to be predicted, an api_name needs to be reserved as Unknown, so the one-hot encoding is set to L rows and N api_name +1 column vector, where when the api_name sequence is converted into onehot encoding, the ID of api_name in the behavior dictionary is queried. For example, if the id of NtQueryAttributesFile is 2, the second bit of the corresponding vector is 1, and the others are 0.

[0082] The machine learning model can use a deep neural network with a CNN (convolutional neural network) type structure, such as a one-dimensional TextCNN and its improved network with a deeper convolution layer, or a network with a threshold convolution layer, or a two-dimensional common image CNN model. Set the initial hyperparameters to start training the model until the loss function value, accuracy and other indicators on the training set and the validation set converge and achieve the preset effect, so as to obtain a trained machine learning model, which can be used for software prediction in the future.

[0083] 3. Data preprocessing

[0084] Before predicting the unknown software running in the sandbox, obtain the running log of the software in the sandbox and perform data preprocessing. The specific method is basically the same as the method of obtaining the training set samples mentioned above. The behavior sequence corresponding to the software can be obtained through the running log of the software. The behavior sequence is also generated according to api_name, and the api_name before TryToAnalyze starts the analysis and after AnalyzeStop ends the analysis is removed. If the length of the valid behavior sequence is <10, the behavior sequence is discarded and no prediction is made. Only the behavior sequence with a length of >=10 is predicted to ensure the validity of the prediction. At the same time, for behavior sequences with a length greater than L, the part greater than L is truncated before model prediction.

[0085] 4. Model prediction

[0086] The model prediction here refers to converting the valid behavior sequence to be predicted into onehot encoding as the input vector of the model, and then calculating it through the trained deep learning model parameters, and outputting the score of the software as malware. For example, when the activation function of the output layer of the deep learning network uses the softmax function, the value range of the score must be between 0 and 1. A threshold can be determined based on a certain amount of actual data test results to divide the predicted attributes. For example, if the threshold is set to 0.99, a score of ≥ 0.99 is considered malware.

[0087] 5. Visualization of behavioral characteristics

[0088] Once the model training is complete and can predict whether unknown software is malware, the behavior feature visualization technology can be used to analyze, calculate and display the importance of each behavior in the sandbox log. The specific steps are as follows:

[0089] (1) Calculate the partial derivatives of the softmax score (i.e., confidence, probability) of the malicious category output by the machine learning model with respect to all high-level features of the last convolutional layer (for two-dimensional CNN, the high-level features are feature maps; for one-dimensional CNN, the high-level features are feature vectors).

[0090] (2) Perform global averaging on the above partial derivatives to obtain the sensitivity of each high-level feature to the malicious category.

[0091] (3) Using the above “sensitivities” as weights, calculate the weighted sum of each high-level feature of the last convolutional layer to obtain the thermal distribution (for 2D CNN, the thermal distribution is a heat map, and for 1D CNN, the thermal distribution is a heat vector). The calculation results at this time are positive and negative, and the values ​​less than a certain threshold are set to 0. The threshold can be 0 or a positive number, depending on the lower limit of the importance of the feature of interest. Optionally, set the threshold to 0 and use the ReLu function to set negative values ​​to 0.

[0092] (4) When the machine learning model uses a two-dimensional CNN, it is necessary to calculate a thermal value for each row of the two-dimensional "heat map", for example, the maximum value in the "heat vector" corresponding to a behavior (api_name) or the average value of positive values. When the machine learning model uses a one-dimensional CNN, the original color in the heat vector is obtained to obtain the thermal value corresponding to the behavior (api_name). Ultimately, whether using a one-dimensional CNN or a two-dimensional CNN, each behavior (api_name) corresponds to a thermal value.

[0093] (5) Each thermal value hi is normalized to [0, 255], hi' = int [hi / max(hi)*255].

[0094] (6) The normalized thermal value, i.e., the importance of the behavioral feature, is mapped to the RGB space. The darker the color, the more important the behavioral feature. You can specify any color gradient. To enhance the display effect, choose a color with strong color distinction. There are at least two ways to map the thermal value to the RGB space: one is to specify two colors and then convert them to the HSV space for interpolation, calculate the color corresponding to the intermediate thermal value, and then convert them back to the RGB space; the other is to directly interpolate or normalize in the RGB space. In practice, the second method is simple and can meet the needs of manual observation. The following takes white (255,255,255) to dark red (128,0,0) as an example. Assume that the currently specified darkest color is RGB=(r,g,b), then the RGB of the color to be displayed for a characteristic thermal value hi' is RGB=(int((r / 255-1)*hi'+255),int((g / 255-1)*hi'+255),int((b / 255-1)*hi'+255)). Taking the red color system as an example, dark red RGB=(128,0,0) represents the most important behavior feature, and the lightest color white RGB=(255,255,255) represents the least important or unconcerned feature. The i-th thermal value hi'=200. Calculate the color to be displayed RGB=(int((128 / 255-1)*200+255),int((0 / 255-1)*200+255),int((0 / 255-1)*200+255))=(155,55,55).

[0095] The method for determining the maliciousness of behavior provided by this embodiment can not only identify malware based on the behavior of the software in the sandbox, but also automatically calculate which behaviors of the software are more suspicious when running in the sandbox, and which behaviors cause the model to judge the software as malicious. The behavioral features are further visualized, and their importance, that is, the maliciousness level, is represented by color levels, which are clear at a glance. The model discrimination results combined with the behavioral feature visualization results help analysts to efficiently analyze malware samples, and at the same time use the important features learned by machine learning to compare the sandbox behavior rules, especially when the sandbox has missed detections, analyze the reasons for the missed detections or find valuable typical behaviors, and then optimize the engine rules.

[0096] Embodiment 3

[0097] Corresponding to the above-mentioned embodiment 1, embodiment 3 of the present application provides a device for determining malicious behavior. The corresponding technical feature details and corresponding technical effects can be referred to the above-mentioned embodiment 1 and will not be repeated in this embodiment. Figure 4 A block diagram of a device for determining malicious behavior provided in Embodiment 3 of the present application, such as Figure 4 As shown, the device includes: a generating module 201, a constructing module 202, an input module 203, a calculating module 204 and a determining module 205.

[0098] The generation module 201 is used to generate a behavior sequence according to the behavior of the software in the sandbox environment; the construction module 202 is used to construct an input vector of a preset deep learning model according to the behavior sequence; the input module 203 is used to input the input vector into the preset deep learning model, wherein the deep learning model is used to convert the input vector into high-level features, and determine the category of the software according to the high-level features, and the category includes malware and non-malware software; the calculation module 204 is used to calculate the thermal value corresponding to the behavior in the behavior sequence according to the high-level features when the software belongs to malware; and the determination module 205 is used to determine the maliciousness of the behavior in the behavior sequence according to the thermal value, wherein the larger the thermal value, the more malicious the behavior.

[0099] Optionally, in one embodiment, the deep learning model is used to convert the input vector into high-level features of multiple channels, and the calculation module 204 includes: a first calculation unit, used to calculate the sensitivity of the high-level features of each channel to the malware category; a second calculation unit, used to determine the weights corresponding to the high-level features based on the sensitivity; a third calculation unit, used to weighted sum the high-level features of each channel according to the weights corresponding to the high-level features to obtain the thermal distribution corresponding to the behavior sequence; a first determination unit, used to determine the thermal value based on the thermal distribution corresponding to the behavior sequence.

[0100] Optionally, in one embodiment, the deep learning model determines the category of the software according to the high-level features by: outputting the score of the software on the malware category according to the high-level features, and when the first computing unit calculates the sensitivity of the high-level features of each channel to the malware category, the specific steps executed include: calculating the partial derivative of the score with respect to the high-level features; when the high-level features are two-dimensional feature graphs, taking the global average of the width and height dimensions of the partial derivatives to obtain the sensitivity; when the high-level features are one-dimensional feature vectors, taking the global average of the width dimension of the partial derivatives to obtain the sensitivity.

[0101] Optionally, in one embodiment, when the high-level feature is a two-dimensional feature graph, the thermal distribution includes multiple thermal vectors corresponding one-to-one to the behaviors, and when the first determination unit determines the thermal value according to the thermal distribution corresponding to the behavior sequence, the specific execution steps include: extracting the maximum value in the thermal vector or calculating the average value of the positive values ​​in the thermal vector to obtain the thermal value corresponding to the behavior.

[0102] Optionally, in one embodiment, the malicious behavior determination device also includes: a processing module and a display model, wherein the processing module is used to process the thermal value corresponding to each behavior in the behavior sequence after the first determination unit determines the thermal value according to the thermal distribution corresponding to the behavior sequence, wherein if the thermal value is less than the preset threshold, the thermal value is set to 0, and if the thermal value is greater than or equal to the preset threshold, the thermal value is kept unchanged, and the processed thermal value is normalized to [0,255], and the display module is used to map the normalized thermal value to RGB space for row display.

[0103] Optionally, in one embodiment, the construction module 202 includes: a search unit, used to search for an identifier corresponding to the behavior in the behavior sequence in the behavior dictionary corresponding to the sandbox; and a mapping unit, used to convert the identifier corresponding to the behavior into a onehot code, wherein the onehot code corresponding to the behavior sequence is used as an input vector of the deep learning model.

[0104] Optionally, in one embodiment, the generation module 201 includes: an acquisition unit, used to obtain the operation log of the software in the sandbox environment, wherein the operation log includes multiple behaviors, and the behaviors include API names; a processing unit, used to form the behavior sequence through the API names in the operation log, wherein the order of the API names in the behavior sequence is consistent with the execution order of the behaviors.

[0105] Optionally, in one embodiment, the behavior dictionary corresponding to the sandbox is constructed by the following steps: obtaining multiple operation logs of the sandbox within a preset time period; and constructing the behavior dictionary according to the API names in the multiple operation logs.

[0106] Optionally, in one embodiment, the behavior dictionary includes N API names, and when the search unit searches for an identifier corresponding to a behavior in the behavior sequence in the behavior dictionary corresponding to the sandbox, the specific steps performed include: searching for the API name in the behavior sequence in the behavior dictionary; when the API name is in the behavior dictionary, determining that the identifier corresponding to the behavior where the API name is located is the position number of the API name in the behavior dictionary; when the API name is not in the behavior dictionary, determining that the identifier corresponding to the behavior where the API name is located is N+1.

[0107] Optionally, in one embodiment, when the mapping unit converts the identifier corresponding to the behavior into a onehot code, the specific steps performed include: setting the onehot code to include N+1 elements; when the identifier corresponding to the behavior is M, setting the Mth element of the onehot code to 1 and the remaining elements to 0.

[0108] Optionally, in one embodiment, the step of constructing the behavior dictionary using the API names in the multiple operation logs includes: for each of the multiple operation logs, extracting the API names in the operation logs in the order of behavior execution to obtain a first sequence; removing the API names before the API name TryToAnalyze and after the API name AnalyzeStop in the first sequence to obtain a second sequence; aggregating the second sequences corresponding to the multiple operation logs to obtain an API name set; and deduplicating the same API names in the API name set to obtain the behavior dictionary.

[0109] Optionally, in one embodiment, when the processing unit forms the behavior sequence through the API names in the operation log, the specific execution steps include: extracting the API names in the corresponding operation log of the software in the order of behavior execution to obtain a third sequence; removing the API names before the API name TryToAnalyze and after the API name AnalyzeStop in the third sequence to obtain a fourth sequence; when the number of API names in the fourth sequence is greater than the first threshold and less than or equal to the second threshold, determining that the fourth sequence is the behavior sequence; when the number of API names in the fourth sequence is greater than the second threshold, intercepting the first second threshold number of API names in the fourth sequence as the behavior sequence.

[0110] Embodiment 4

[0111] This fourth embodiment also provides a computer device, such as a smart phone, tablet computer, laptop computer, desktop computer, rack server, blade server, tower server or cabinet server (including an independent server or a server cluster composed of multiple servers) that can execute programs. Figure 5 As shown, the computer device 01 of this embodiment includes at least but is not limited to: a memory 011 and a processor 012 which can be interconnected via a system bus. Figure 5 It should be pointed out that Figure 5 Only a computer device 01 having components memory 011 and processor 012 is shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0112] In this embodiment, the memory 011 (i.e., readable storage medium) includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 011 can be an internal storage unit of the computer device 01, such as a hard disk or memory of the computer device 01. In other embodiments, the memory 011 can also be an external storage device of the computer device 01, such as a plug-in hard disk equipped on the computer device 01, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. Of course, the memory 011 can also include both the internal storage unit of the computer device 01 and its external storage device. In this embodiment, the memory 011 is generally used to store the operating system and various application software installed on the computer device 01, such as the program code of the malicious behavior determination device of the third embodiment. In addition, the memory 011 can also be used to temporarily store various types of data that have been output or are to be output.

[0113] In some embodiments, the processor 012 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips. The processor 012 is generally used to control the overall operation of the computer device 01. In this embodiment, the processor 012 is used to run the program code stored in the memory 011 or process data, such as a method for determining the maliciousness of a behavior.

[0114] Embodiment 5

[0115] The fifth embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a disk, an optical disk, a server, an App application store, etc., on which a computer program is stored, and the program implements the corresponding function when executed by the processor. The computer-readable storage medium of this embodiment is used to store a malicious behavior determination device, and when executed by the processor, the method for determining the malicious degree of behavior of the first embodiment is implemented.

[0116] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0117] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0118] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method.

[0119] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for determining the maliciousness of an action, characterized in that: include: Generate behavior sequences based on the software's behavior in the sandbox environment; constructing an input vector of a deep learning model according to the behavior sequence; Inputting the input vector into the deep learning model, wherein the deep learning model is used to convert the input vector into high-level features of multiple channels, and outputting a score of the software on the malware category according to the high-level features to determine the category of the software, wherein the category includes malware and non-malware; When the software belongs to malware, calculating the sensitivity of the high-level features of each channel to the malware category, including: calculating the partial derivative of the score with respect to the high-level features, when the high-level features are two-dimensional feature graphs, taking the global average of the width and height dimensions of the partial derivatives to obtain the sensitivity, and when the high-level features are one-dimensional feature vectors, taking the global average of the width dimension of the partial derivatives to obtain the sensitivity; Determining a weight corresponding to the high-level feature according to the sensitivity; Performing weighted summation on the high-level features of each channel according to the weights corresponding to the high-level features to obtain a thermal distribution corresponding to the behavior sequence; Determining the thermal value corresponding to the behavior in the behavior sequence according to the thermal distribution corresponding to the behavior sequence; and The maliciousness of the behavior in the behavior sequence is determined according to the thermal value, wherein the greater the thermal value, the greater the maliciousness of the behavior.

2. The method for determining the maliciousness of a behavior according to claim 1, characterized in that: When the high-level feature is a two-dimensional feature graph, the thermal distribution includes multiple thermal vectors corresponding to the behaviors one by one, and the step of determining the thermal value according to the thermal distribution corresponding to the behavior sequence includes: extracting the maximum value in the thermal vector or calculating the average value of the positive values ​​in the thermal vector to obtain the thermal value corresponding to the behavior.

3. The method for determining the maliciousness of a behavior according to claim 1, characterized in that: After the step of determining the thermal value according to the thermal distribution corresponding to the behavior sequence, the method for determining the maliciousness of the behavior further includes: Processing the thermal value corresponding to each behavior in the behavior sequence, wherein if the thermal value is less than a preset threshold, the thermal value is set to 0, and if the thermal value is greater than or equal to the preset threshold, the thermal value is kept unchanged; Normalize the processed thermal values ​​to [0,255]; and Map the normalized thermal values ​​to RGB space for display.

4. The method for determining the maliciousness of a behavior according to claim 1, characterized in that: The step of constructing an input vector of a deep learning model according to the behavior sequence includes: In the behavior dictionary corresponding to the sandbox, searching for an identifier corresponding to the behavior in the behavior sequence; Converting the identifier corresponding to the behavior into a onehot code; and The onehot encoding corresponding to the behavior sequence is used as an input vector of the deep learning model.

5. The method for determining the maliciousness of a behavior according to claim 4, characterized in that: The steps to generate a behavior sequence based on the behavior of the software in the sandbox environment include: Obtaining a running log of the software in a sandbox environment, wherein the running log includes a plurality of behaviors, and the behaviors include an API name; The behavior sequence is formed by using the API names in the operation log, wherein the order of the API names in the behavior sequence is consistent with the execution order of the behaviors; and / or, The behavior dictionary corresponding to the sandbox is constructed using the following steps: Obtain multiple operation logs of the sandbox within a preset time period; Building the behavior dictionary by using the API names in the multiple operation logs; and / or, The behavior dictionary includes N API names. The step of searching the behavior dictionary corresponding to the sandbox for an identifier corresponding to the behavior in the behavior sequence includes: Searching the behavior dictionary for an API name in the behavior sequence; When the API name is in the behavior dictionary, determining that the identifier corresponding to the behavior where the API name is located is the position number of the API name in the behavior dictionary; When the API name is not in the behavior dictionary, determining that the identifier corresponding to the behavior where the API name is located is N+1; and / or, The steps of converting the identifier corresponding to the behavior into a onehot encoding include: Set the onehot encoding to include N+1 elements; When the identifier corresponding to the behavior is M, the Mth element of the onehot encoding is set to 1, and the remaining elements are set to 0.

6. The method for determining the maliciousness of an action according to claim 5, characterized in that: The step of constructing the behavior dictionary by using the API names in the plurality of operation logs comprises: For each of the multiple operation logs, extract the API name in the operation log according to the behavior execution order to obtain a first sequence; Remove the API names before the API name TryToAnalyze and after the API name AnalyzeStop in the first sequence to obtain a second sequence; Aggregate the second sequences corresponding to the multiple operation logs to obtain an API name set; Deduplicating identical API names in the API name set to obtain the behavior dictionary; The step of forming the behavior sequence according to the API name in the operation log includes: Extracting the API names in the corresponding operation log of the software according to the behavior execution order to obtain a third sequence; Remove the API names before the API name TryToAnalyze and after the API name AnalyzeStop in the third sequence to obtain a fourth sequence; When the number of API names in the fourth sequence is greater than the first threshold and less than or equal to the second threshold, the fourth sequence is determined to be the behavior sequence; when the number of API names in the fourth sequence is greater than the second threshold, the first second threshold number of API names in the fourth sequence are intercepted as the behavior sequence.

7. A device for determining malicious behavior, characterized in that: include: A generation module, used for generating a behavior sequence according to the behavior of the software in the sandbox environment; A construction module, used for constructing an input vector of a deep learning model according to the behavior sequence; An input module, configured to input the input vector into the deep learning model, wherein the deep learning model is configured to convert the input vector into high-level features of multiple channels, and output a score of the software on the malware category according to the high-level features to determine the category of the software, wherein the category includes malware and non-malware; A calculation module, used for calculating the sensitivity of the high-level features of each channel to the malware category when the software belongs to malware, including: calculating the partial derivative of the score with respect to the high-level features, when the high-level features are two-dimensional feature graphs, taking the global average of the width and height dimensions of the partial derivatives to obtain the sensitivity, and when the high-level features are one-dimensional feature vectors, taking the global average of the width dimension of the partial derivatives to obtain the sensitivity; Determining a weight corresponding to the high-level feature according to the sensitivity; Performing weighted summation on the high-level features of each channel according to the weights corresponding to the high-level features to obtain a thermal distribution corresponding to the behavior sequence; Determining the thermal value corresponding to the behavior in the behavior sequence according to the thermal distribution corresponding to the behavior sequence; and A determination module is used to determine the maliciousness of the behavior in the behavior sequence according to the thermal value, wherein the larger the thermal value, the greater the maliciousness of the behavior.

8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.