A method and device for detecting network attack behavior
By building a lonely tree model to analyze the abnormal scores of client feature data, the problem that the decision tree cannot judge new types of network attacks in a timely manner is solved, and the rapid detection and response to unknown attacks is achieved, and network security is improved.
Patent Information
- Application Number
- CN202210295856.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-23
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2042-03-23
AI Technical Summary
The existing decision tree method cannot make timely judgments when facing unknown or new types of network attacks, resulting in misjudgment and delayed responses, affecting network security.
By building a model based on loneliness tree, the client uses the multi-dimensional feature data to analyze the anomaly scores to quickly determine whether the client is at risk of being attacked, including receiving feature data, building loneliness trees and calculating the anomaly scores to determine the risk of attack.
Timely detection of unknown and new types of network attacks is achieved, misjudgment is reduced, network security and user experience is improved, and potential losses caused by latency response are avoided.
Smart Images

Figure CN114666136B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and more specifically, to a method and device for detecting network attack behaviors. Background Art
[0002] With the continuous development of network security technology, there are more and more methods of network attacks on clients in risk confrontation scenarios, which may cause losses to customers. Therefore, it is particularly important to make early judgments on network attacks on clients.
[0003] At present, when judging the type of network attack suffered by the client, a decision tree is usually used to implement it. A decision tree is a multi-classification model that uses a tree model to make decisions. The decision tree can be used to judge the type of network attack suffered by the client. However, the decision tree is constructed based on the relevant features of known types of network attacks. When the client is attacked by an unknown, new network attack, the decision tree cannot judge and may even give a wrong judgment that the client has not been attacked. Since the decision tree cannot judge new types of network attacks, only when the network attack suffered by the client has serious consequences and attracts the attention of technical personnel, will the technical personnel be asked to determine whether the client has been attacked by a new type of network attack. At this time, it is a bit slow to adjust the attack and defense strategy for the newly discovered network attack type.
[0004] Therefore, how to detect new types of network attacks in a timely manner has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] The present application provides a method and device for detecting network attack behaviors, so as to timely discover new types of network attacks.
[0006] In a first aspect, the present application provides a method for detecting network attack behavior, the method comprising: receiving feature data of at least one dimension from a client; determining an anomaly score based on the feature data of the at least one dimension and a pre-constructed model, the model comprising at least one lonely tree corresponding one-to-one to the at least one dimension, each lonely tree being constructed based on the feature data of the corresponding dimension in historical data; based on the anomaly score, determining whether the client is at risk of being attacked.
[0007] In the second aspect, the present application provides a device for detecting network attack behaviors, the device comprising: a transceiver module and a processing module. The transceiver module is used to receive feature data of at least one dimension from a client; the processing module is used to determine an abnormality score based on the feature data of at least one dimension and a pre-built model, the model comprising at least one lonely tree corresponding to the at least one dimension, each lonely tree being constructed based on the feature data of the corresponding dimension in historical data; and is used to determine whether the client is at risk of being attacked based on the abnormality score.
[0008] It should be understood that each module can realize corresponding functions by executing computer programs.
[0009] In a third aspect, the present application provides a device for detecting network attack behaviors, the device comprising a processor for executing a computer program so that the device implements the method in the first aspect.
[0010] A fourth method, the present application provides a computer program product, including a computer program, which implements the method in the first aspect when the computer program is executed.
[0011] In a fifth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the processor implements the method in the first aspect.
[0012] Regardless of whether the client is under a network attack or whether the network attack is an unknown, new type of network attack, its network behavior can be reflected by the characteristic data of at least one dimension of the client. The method provided by the present application constructs a model based on the characteristic data of various dimensions involved in network behavior, so that the constructed model can analyze the characteristic data of the newly received network behavior, characterize the degree of deviation from the normal network behavior through the abnormal score, and then determine whether the client may be attacked according to the abnormal score. For example, if the abnormal score is high, it is considered that the network behavior deviates from the normal network behavior to a high degree, and the risk of being attacked is greater; if the abnormal score is low, it is considered that the network behavior deviates from the normal network behavior to a low degree, and the risk of being attacked is small. Therefore, whether the client is under a known type of network attack or an unknown, new type of network attack, the abnormal score can be used to make a preliminary judgment, and timely determine whether the client is at risk of being attacked, especially for unknown, new types of network attacks, without waiting until the network attack has serious consequences before detection. In this way, it is possible to respond to the attacked client, such as manual analysis, adjustment of corresponding attack and defense strategies, etc., thereby improving network security and user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 is a schematic diagram of an embodiment of the present application using a decision tree to determine the type of network attack;
[0014] Figure 2 is a schematic flow chart of the model building method provided in the embodiment of the present application;
[0015] Figure 3 It is a schematic diagram of a model provided in an embodiment of the present application;
[0016] Figure 4 is a schematic flow chart of a method for detecting network attack behaviors provided in an embodiment of the present application;
[0017] Figure 5 is a schematic flow chart of determining anomaly scores of clients provided in an embodiment of the present application;
[0018] Figure 6 It is a schematic diagram of a network attack behavior detection device provided in an embodiment of the present application;
[0019] Figure 7 It is another schematic block diagram of the network attack behavior detection device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0020] The technical solution in this application will be described below in conjunction with the accompanying drawings.
[0021] The technical solution provided in this application can be applied to the field of network security, especially in scenarios with fierce attack and defense such as device risks, traffic promotion, and game cheating.
[0022] Figure 1 It is a schematic diagram of using a decision tree to determine the type of network attack provided in an embodiment of the present application. Figure 1 The decision tree shown may include a root node, internal nodes, and leaf nodes. Among them, the root node may be the barrier-free mode, the internal nodes may be the number of restarts and the number of applications, and the leaf nodes are the final categories, namely, type A attacks, type B attacks, and type C attacks. In addition to the leaf nodes, each node has a corresponding logical judgment condition. For example, at the barrier-free mode, it is necessary to judge whether the barrier-free mode is turned on, at the number of restarts node, it is necessary to judge whether the number of restarts is less than 10 times, and at the number of applications node, it is necessary to judge whether the number of applications is less than 15 times. At the leaf node, the final attack category is output, for example, it can be determined that the network attack is type A attack, type B attack, or type C attack. In short, a decision tree is a multi-classification model that uses a tree model to make decisions.
[0023] When the client reports the feature data of various dimensions to the server, the server uses the layer nodes of the model and the logical judgment conditions at each node to determine what type of network attack the client has been subjected to. It should be understood that when the feature data of various dimensions reported by the client does not meet the judgment logic in the decision tree, it is considered that the client has not been subjected to a network attack.
[0024] It should be understood that Figure 1 The structure of the decision tree shown is for exemplary purposes only. Those skilled in the art may set up a decision tree containing more internal nodes, more leaf nodes, or even more complex logical judgment conditions according to actual needs, and this application does not impose any restrictions on this.
[0025] At present, in the scenario of network security risk confrontation, technicians build decision trees based on the relevant features of known types of network attacks. That is, when using decision trees to judge the types of network attacks suffered by clients, they can only judge known types of network attacks, for example, Figure 1 The decision tree in the example can only judge three types of attacks. However, with the continuous development of the black industry, new types of network attacks are constantly iterating. The decision tree cannot determine whether the client has been attacked by a new type of network attack, and may even give a false judgment that the client has not been attacked. Only when the network attack suffered by the client has serious consequences can the technical staff determine whether the client has been attacked by a new network attack. At this time, it is a bit slow to adjust the attack and defense strategy.
[0026] In view of this, the present application provides a method and device for detecting network attack behaviors. A model is constructed based on feature data of various dimensions involved in network behaviors, so that the constructed model can analyze the feature data of newly received network behaviors, characterize the degree of deviation from normal network behaviors through abnormal scores, and then determine whether the client may be attacked based on the abnormal scores. Therefore, whether the client is subjected to a known type of network attack or an unknown, new type of network attack, a preliminary judgment can be made through the abnormal score to promptly determine whether the client is at risk of being attacked, especially for unknown, new types of network attacks, without having to wait until the network attack has serious consequences before detection. In this way, a response can be made to the attacked client, such as manual analysis, adjustment of corresponding attack and defense strategies, etc., thereby improving network security and user experience.
[0027] The following will describe in detail the network attack behavior detection method provided by the embodiment of the present application in conjunction with the accompanying drawings.
[0028] To facilitate understanding of the method provided in the embodiments of the present application, the following is first combined with Figure 2The model building method provided in the embodiment of the present application is described in detail, and then combined with Figure 4 The network attack behavior detection method provided in the embodiment of the present application is described in detail.
[0029] Figure 2 A schematic flowchart of the model building method provided in the embodiments of the present application. Figure 2 The model building method 200 shown may include step 201 and step 202. It should be understood that the model building method can be executed by a model building device, which can be a server or other device. This application does not limit this. For ease of explanation, this application takes the server as an example for explanation. It should also be understood that the model building method can be an offline construction, or it can also be an online construction, or it can be first offline construction and then online construction to update the model in real time. This application does not limit this.
[0030] The following details Figure 2 The various steps in the model building method 200 are shown.
[0031] Step 201: The server obtains feature data of multiple dimensions from historical data.
[0032] Specifically, the server can obtain multiple groups of data from historical data within a preset time period in the past. For example, the server has obtained five hundred groups of historical data in the past week. Each group of data contains feature data of multiple dimensions, wherein the multiple dimensions may include one or more of the following: operating system version, whether it is developer mode, whether it is charging status, whether barrier-free mode is turned on, whether it is debugging mode, whether a lock screen password is set, whether it is always on when charging, whether debugging mode connection authentication is turned off, number of restarts, startup time, number of applications, and installation time of the application. Among them, the debugging mode can be, for example, the debugging bridge (android bebug bridge, ADB) mode of the Android system. Therefore, the dimensions of the feature data contained in different groups of data may be different, may be partially the same, or may be all the same. In the present application, the multiple groups of data obtained by the server may be historical data from different clients.
[0033] In network behavior, the client may generate normal network behavior or abnormal network behavior, but the probability of abnormal network behavior is relatively small. Therefore, the multiple sets of historical data obtained by the server may include feature data of normal network behavior or feature data of abnormal network behavior, and feature data of abnormal network behavior accounts for a relatively small proportion of historical data.
[0034] It should be understood that those skilled in the art may set the preset time period according to actual needs, and this application does not limit this.
[0035] In step 202, the server constructs a model based on feature data of multiple dimensions. The model includes multiple isolation trees corresponding to the multiple dimensions. Each isolation tree in the multiple isolation trees is constructed by the feature data of the corresponding dimension.
[0036] It should be understood that Isolation Forest is a fast anomaly detection method with linear time complexity and high accuracy, and can be used to detect abnormal data without defining black and white samples. Explained in statistics, in the data space, sparsely distributed areas indicate that the probability of data occurring in this area is very low, so the data falling in these areas can be considered abnormal. That is, abnormal data can be points that are sparsely distributed and far away from the high-density group.
[0037] Specifically, after the server obtains multiple sets of data, since each set of data contains feature data of multiple dimensions, the server can extract feature data sets of different dimensions. Based on the feature data sets of different dimensions, combined with the lonely forest algorithm, lonely trees for representing different dimensions can be constructed. It should be understood that since the dimensions contained in different sets of data can be different or partially the same, the amount of data contained in the feature data sets of different dimensions can also be different.
[0038] Exemplarily, it is assumed that the server obtains seven sets of data, and each set of data contains twelve dimensions of feature data, including operating system version, whether it is developer mode, whether it is charging status, whether to turn on barrier-free mode, whether it is debugging mode, whether to set a lock screen password, whether it is always on when charging, whether to turn off debugging mode connection authentication, number of restarts, startup time, number of applications, and installation time of the application. For the dimension of the number of restarts, the server can extract the corresponding number of restarts from each set of data, thereby obtaining a feature data set containing information about the seven restarts. Based on this feature data set, using the lonely forest algorithm, a lonely tree can be constructed to characterize the dimension of the number of restarts. Therefore, in the same way, for feature data sets of different dimensions, twelve lonely trees for characterizing twelve different dimensions can be constructed.
[0039] It should be understood that the above construction of lonely trees of twelve different dimensions is only an exemplary description, and those skilled in the art can construct lonely trees of more or fewer dimensions according to actual needs, and this application does not impose any limitation on this.
[0040] It should also be understood that when actually acquiring historical data, the server acquires tens of thousands of groups of data. For ease of understanding, this application uses seven groups of data for illustrative purposes, which does not constitute a limitation on this application.
[0041] Furthermore, the specific process of constructing lonely trees for representing different dimensions based on feature data sets of different dimensions in combination with the lonely forest algorithm can be as follows.
[0042] After determining the feature data set of a certain dimension, the server determines the maximum and minimum values of the data in the feature data set under the dimension. The feature is used as the starting node, and a value is randomly selected between the maximum and minimum values of the feature. The data in the feature data set that is less than the value is divided into the left branch, and the data that is greater than or equal to the value is divided into the right branch. Then, the above process is repeated in the left and right branch data to construct a binary tree, that is, a lonely tree. In this way, a lonely tree can be constructed for each dimension of the feature data set.
[0043] It should be understood that the data can no longer be divided into left and right branches when the following conditions are met: the data cannot be divided under the branch, that is, the branch contains only one piece of data, or the data in the branch is the same and cannot be divided into left and right branches; or the binary tree reaches a limited maximum depth.
[0044] For example, the following is combined with Figure 3 The construction process of the lonely tree is explained.
[0045] like Figure 3 As shown in (a) in the figure, the process of constructing a lonely tree under the dimension of the number of restarts is shown.
[0046] Assume that the server determines a feature data set containing information on seven restart times, in which the restart times of the seven data are restart 1, restart 2, restart 4, restart 5, restart 6, restart 8 and restart 16 respectively.
[0047] When constructing a lonely tree, we use the restart times as the starting node, and determine that the maximum restart times among the seven data is 16 times, and the minimum is 1 time. Then we can randomly select a value, such as 10 times, and divide the data with restart times less than 10 times into the left branch, and divide the data with restart times greater than or equal to 10 times into the right branch. In this way, the left branch with restart times less than 10 will be divided into 6 data, and the right branch with restart times greater than or equal to 10 will be divided into only 1 data.
[0048] Since the data of the right branch with a restart number greater than or equal to 10 only contains one data, the next division is not performed. For the left branch with a restart number less than 10, the maximum restart number is re-determined to be 10 times and the minimum restart number is 1 time, and then a value can be randomly selected, such as 5 times, and the data with a restart number less than 5 times is further divided into the left branch, and the data with a restart number greater than or equal to 5 times is divided into the right branch. In this way, the left branch with a restart number less than 5 and the right branch with a restart number greater than or equal to 5 are divided into three data respectively.
[0049] Further, for the left branch with a restart number less than 5 and the right branch with a restart number greater than or equal to 5, a value is randomly selected again, for example, the left branch with a restart number less than 5 selects a restart number of 3 times again, and the right branch with a restart number greater than or equal to 5 selects a restart number of 7 times again. Then, the left branch with a restart number less than 5 further divides the data with a restart number less than 3 times into the left branch, and divides the data with a restart number greater than or equal to 3 times into the right branch. At this time, the branch with a restart number greater than or equal to 3 times only contains one data and is no longer divided. The branch with a restart number less than 3 times can randomly select a value again, such as selecting 2 times, then the left branch with a restart number less than 2 and the right branch with a restart number greater than or equal to 2 are obtained again, and both branches contain only one data and are no longer divided. Similarly, the division method of the right branch with a restart number greater than or equal to 5 selecting a restart number of 7 times again is the same as the above-mentioned division method of the left and right branches, which will not be repeated here. In this way, after the above-mentioned division of each layer of left and right branches, each data can be divided out, thereby obtaining a constructed lonely tree.
[0050] It should be understood that the construction method of lonely trees in other dimensions can also refer to Figure 3 The description and implementation of (a) in the above description will not be repeated here.
[0051] It should also be understood that for dimensions that cannot be represented by specific values, such as whether it is developer mode, whether it is charging mode, whether to set a lock screen, whether it is always on when charging, whether to turn off debug mode connection authentication, when determining the maximum and minimum values of the starting node of the lonely tree, for the case of "yes", the value can be set to 1, and for the case of "no", the value can be set to 0. Therefore, when dividing the left and right branches, a value between 0 and 1 can be randomly selected.
[0052] The above data division process can also be expressed in the spatial dimension. Figure 3 (b) in the figure shows a schematic diagram of data cutting in a one-dimensional plane, that is, Figure 3The coordinate axis in (b) can represent the dimension of the restart times. When the server determines the aforementioned feature data set containing the seven restart times, the seven data can be displayed on a one-dimensional plane, and according to the aforementioned principle of dividing the left and right branches, a value is continuously randomly selected on the one-dimensional plane. After multiple splits, each data can be split out. It can be seen that the data point with 16 restart times is relatively alienated from the other data, and it can be separated by one split, while the other data points are clustered together and require more splits to separate them. Therefore, the data point with 16 restart times can be considered as an abnormal data point, and the other data points can be considered as normal data points.
[0053] It should be understood that each lonely tree can correspond to a dimension. When there are multiple lonely trees, the segmentation of data in space is also a multi-dimensional segmentation. At this time, each dimension can correspond to a coordinate axis.
[0054] Combine the following Figure 4 This paper introduces the detection method of network attack behavior.
[0055] Figure 4 It is a schematic flowchart of a method for detecting network attack behavior provided in an embodiment of the present application. Figure 4 The method 400 shown may be applied to a server. Figure 4 The method 400 shown may include steps 401 to 403. Each step in the method 400 is described in detail below.
[0056] Step 401: The server receives feature data of at least one dimension from the client.
[0057] Specifically, the software development kit (SDK) in the client can report the feature data containing at least one dimension to the server in real time. The server can receive feature data of only one client at the current moment, or can receive feature data of multiple clients at the same time.
[0058] The feature data reported by the SDK may also include one or more of the following dimensions: operating system version, whether it is developer mode, charging status, whether accessibility mode is turned on, whether debugging mode is turned on, whether a lock screen password is set, whether the light is always on while charging, whether debugging mode connection authentication is turned off, number of restarts, startup time, number of applications, and application installation time.
[0059] In step 402, the server determines an abnormality score based on the feature data of the at least one dimension and a pre-built model, wherein the model includes at least one lonely tree corresponding to the at least one dimension, and each lonely tree is constructed based on the feature data of the corresponding dimension in the historical data.
[0060] In the present application, for each feature data sent by a client, the server can determine the anomaly score based on the feature data sent by each client containing at least one dimension, combined with a pre-built lonely tree of the corresponding dimension.
[0061] It should be understood that since the above has been combined Figure 2 and Figure 3 The method of model construction has been explained in detail and will not be repeated here.
[0062] Optionally, refer to Figure 5 , step 402 can be specifically implemented through steps 4021 and 4022.
[0063] In step 4021, the server inputs the feature data of each dimension in the feature data of at least one dimension into the corresponding lonely tree to determine the depth value of the feature data of each dimension in the lonely tree.
[0064] Specifically, after receiving the feature data from any client, the server can determine which dimensions the feature data contains, thereby determining the lonely tree of the corresponding dimension among the pre-constructed multiple lonely trees, and inputting the feature data of each dimension into the lonely tree of the corresponding dimension, thereby determining the depth value of the feature data of each dimension in the lonely tree of each corresponding dimension.
[0065] The depth value h(x) of the feature data of any dimension on the corresponding lonely tree of any dimension can be calculated by the following formula:
[0066] h(x)=e+C(T.size)
[0067] Among them, e represents the number of edges that the feature data of a certain dimension passes through from the root node to the leaf node of the lonely tree of the corresponding dimension, T.size represents the number of feature data that also fall on the leaf node where the feature data is located, and C(T.size) is a correction value, which represents the average path length of the binary tree constructed with T.size data.
[0068] At this time, the calculation formula of C(T.size) is as follows:
[0069]
[0070] Among them, H(T.size-1) can be estimated by ln(T.size-1)+0.5772156649.
[0071] In this application, when the server receives characteristic data from a client, T.size can take the value of 0.
[0072] Exemplarily, the server receives feature data from client A, which includes feature data of the following dimensions: number of restarts, startup time, and number of applications. Then, the server finds a lonely tree under the dimension of number of restarts, a lonely tree under the dimension of startup time, and a lonely tree under the dimension of number of applications from multiple pre-built lonely trees. These three feature data are input into three lonely trees respectively, and it is determined on which leaf node of the three lonely trees these three feature data will fall. Assuming that the number of restarts of client A is 15 times, combined with Figure 3 As shown in the constructed lonely tree, we know that e = 1. And, since the server has only received the feature data of client A at present, T.size = 0 at this time. Then, the depth value of the lonely tree of client A's feature data in the restart number dimension can be determined in combination with the aforementioned h(x). Therefore, the server can determine the three depth values of the feature data of client A in the three dimensions on the three lonely trees in the same way as above.
[0073] In the present application, when the server receives feature data from multiple clients, the value of T.size depends on how many clients' feature data contain feature data of the corresponding dimension of the lonely tree, and how many feature data in the lonely tree also fall on the leaf node where the feature data is located.
[0074] For example, when the server receives the feature data of 500 clients, if only 400 of the 500 clients' feature data contain the number of restarts, then 400 data fall on the root node of the lonely tree under the restart number dimension. After dividing the nodes where each data is located, that is, each data finds its own leaf node. Assuming that the server wants to determine the depth value of the number of restarts of client A in the lonely tree, if it is found that the leaf node where the number of restarts of client A is located also has data of 30 other clients, then T.size can be 30.
[0075] In step 4022, the server determines the abnormality score based on the depth value of the feature data of the at least one dimension in the corresponding lonely tree.
[0076] Specifically, for any client, after determining the depth value of the feature data of each dimension of the client in the lonely tree of the corresponding dimension, the server can determine the abnormal score Score(x) by the following formula:
[0077]
[0078] Among them, E(h(x)) represents the average depth value of the client's feature data on multiple lonely trees, ψ is the number of feature data falling on the starting node in a single lonely tree, and C(ψ) represents the average path length of the binary tree constructed with ψ data.
[0079] At this time, the calculation formula of C(ψ) is as follows:
[0080]
[0081] Among them, H(ψ-1) can be estimated by ln(ψ-1)+0.5772156649.
[0082] It should be understood that when the server receives feature data from one client, ψ = 1. When the server receives feature data from multiple clients, ψ depends on how many clients' feature data contain feature data of the corresponding dimension of the lonely tree. For example, when the server receives feature data from 500 clients, if 400 of the 500 clients' feature data contain the number of restarts, then ψ = 400.
[0083] Step 403: The server determines whether the client is at risk of being attacked based on the anomaly score.
[0084] Optionally, step 403 may specifically include: when the abnormality score is greater than or equal to a preset threshold, the server determines that the client is at risk of being attacked; or, when the abnormality score is less than a preset threshold, the server determines that the client is not at risk of being attacked.
[0085] Specifically, after the server determines the abnormal score of the client, when the abnormal score is greater than or equal to the preset threshold, it means that the feature data of at least one dimension sent by the client is abnormal. For example, the depth value of the feature data of each dimension in the corresponding lonely tree of each dimension is small, or the depth value of the feature data of some dimensions in the corresponding lonely tree of some dimensions is small. In other words, there is a situation where the feature data of some or all dimensions deviates greatly from the normal feature data. The server can then determine that the client is at risk of being attacked, and the attack on the client may be a known type of network attack, or it may be an unknown, new type of network attack. On the contrary, when the abnormal score is less than the preset threshold, it means that the feature data sent by the client is normal, and the server can determine that the client is not at risk of being attacked.
[0086] It should be understood that those skilled in the art may set the specific size of the preset threshold according to actual needs, for example, the preset threshold may be set to 0.6, and this application does not impose any limitation on this.
[0087] Optionally, after the server determines that the client is at risk of being attacked, method 400 may further include:
[0088] The server outputs an anomaly score for manual analysis; obtains a manual analysis result, which is obtained based on the manual analysis and indicates whether the client is attacked.
[0089] Specifically, when the server determines that the client is at risk of being attacked, it means that the client may have been attacked by the black industry, and the black industry may have carried out known types of network attacks or new types of network attacks. Alternatively, the client may not have been attacked by the black industry, but the client mistakenly sent abnormal feature data, and the model produced a judgment error. At this time, the server can output the abnormal score to the technician, and the technician will further analyze to determine whether the client has been attacked, what type of attack it has been attacked, and whether it has been attacked by a new type of network attack. Among them, the technician can determine the degree of client abnormality based on the size of the abnormal score. When the degree of abnormality is relatively large, it can be analyzed based on feature data of more dimensions; when the degree of abnormality is relatively small, it can be analyzed based on feature data of fewer dimensions. After manual analysis, the technician can feed back the results of the analysis to the server.
[0090] Optionally, after obtaining the manual analysis result, the server may further include: optimizing the model based on the manual analysis result and feature data of at least one dimension from the client.
[0091] Specifically, based on the manual analysis results and feature data of at least one dimension from the client, one or more of the following are performed: adding a lonely tree to the model; deleting one or more lonely trees in the model; and updating one or more lonely trees in the model.
[0092] When the client is attacked by manual analysis, if it is determined that the attack type on the client is a known network attack type, one or more lonely trees in the model can be updated based on the feature data of at least one dimension sent from the client to improve the accuracy of the model; if it is determined that the attack type on the client is an unknown, newly generated network attack type, new lonely trees can be added to the model by analyzing the relevant features of the new network attack method, so that when the same type of network attack occurs later, the client can be quickly identified to be abnormal. When the client is not attacked by manual analysis, it means that the accuracy of the current model is not high enough, and lonely trees can be added to the model according to the actual situation, or one or more lonely trees in the model can be deleted, or one or more lonely trees in the model can be updated using the feature data of at least one dimension reported by the client to improve the accuracy of the model.
[0093] Regardless of whether the client is under a network attack or whether the network attack is an unknown, new type of network attack, its network behavior can be reflected by the characteristic data of at least one dimension of the client. The method provided by the present application constructs a model based on the characteristic data of various dimensions involved in network behavior, so that the constructed model can analyze the characteristic data of the newly received network behavior, characterize the degree of deviation from the normal network behavior through the abnormal score, and then determine whether the client may be attacked according to the abnormal score. For example, if the abnormal score is high, it is considered that the network behavior deviates from the normal network behavior to a high degree, and the risk of being attacked is greater; if the abnormal score is low, it is considered that the network behavior deviates from the normal network behavior to a low degree, and the risk of being attacked is small. Therefore, whether the client is under a known type of network attack or an unknown, new type of network attack, the abnormal score can be used to make a preliminary judgment, and timely determine whether the client is at risk of being attacked, especially for unknown, new types of network attacks, without waiting until the network attack has serious consequences before detection. In this way, it is possible to respond to the attacked client, such as manual analysis, adjustment of corresponding attack and defense strategies, etc., thereby improving network security and user experience.
[0094] Above, combined Figures 2 to 5 The method provided by the embodiment of the present application is described in detail. Figure 6 to Figure 7 The device provided in the embodiments of the present application is described in detail.
[0095] Figure 6 is a schematic block diagram of a network attack behavior detection device provided in an embodiment of the present application. Figure 6 As shown, the detection device 600 may include: a transceiver module 610 and a processing module 620. Each module in the detection device 600 may be used to implement the corresponding process of the server in the above method embodiment.
[0096] Specifically, the transceiver module 610 can be used to receive feature data of at least one dimension from the client; the processing module 620 can be used to determine the anomaly score based on the feature data of the at least one dimension and a pre-constructed model, the model including at least one lonely tree corresponding to the at least one dimension, each lonely tree being constructed based on the feature data of the corresponding dimension in the historical data; based on the anomaly score, determine whether the client is at risk of being attacked.
[0097] Optionally, the processing module 620 can be specifically used to input the feature data of each dimension of the feature data of the at least one dimension into the corresponding lonely tree to determine the depth value of the feature data of each dimension in the lonely tree; and determine the abnormality score based on the depth value of the feature data of the at least one dimension in the corresponding lonely tree.
[0098] Optionally, the processing module 620 may be specifically used to determine that the client is at risk of being attacked when the abnormality score is greater than or equal to a preset threshold; or to determine that the client is not at risk of being attacked when the abnormality score is less than a preset threshold.
[0099] Optionally, the processing module 620 can also be used to output the abnormality score of the client for manual analysis; obtain the manual analysis result, which is obtained based on the manual analysis, and the manual analysis result indicates whether the client is attacked.
[0100] Optionally, the processing module 620 may also be used to optimize the model based on manual analysis results and feature data of at least one dimension from the client.
[0101] Optionally, based on the manual analysis results and feature data of at least one dimension from the client, one or more of the following are performed: adding a lonely tree to the model; deleting one or more lonely trees in the model; and updating one or more lonely trees in the model.
[0102] Optionally, the processing module 620 can also be used to obtain feature data of multiple dimensions from historical data; build a model based on the feature data of multiple dimensions, the model includes multiple lonely trees corresponding to the multiple dimensions, each of the multiple lonely trees is constructed by the feature data of the corresponding dimension.
[0103] Optionally, the multiple dimensions include one or more of the following: operating system version, whether it is developer mode, charging status, whether accessibility mode is turned on, whether it is debugging mode, whether a lock screen password is set, whether the light is always on while charging, whether debugging mode connection authentication is turned off, number of restarts, startup time, number of applications, and installation time of the application.
[0104] It should be understood that the division of modules in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional module in each embodiment of the present application may be integrated into a processor, or may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of software functional modules.
[0105] Figure 7 700 is another schematic block diagram of a detection device for network attack behavior provided in an embodiment of the present application. The detection device 700 can be used to implement the function of the server in the above method 400. The device 700 can be a chip system. In the embodiment of the present application, the chip system can be composed of a chip, or can include a chip and other discrete devices.
[0106] like Figure 7 As shown, the detection device 700 may include at least one processor 710, which is used to implement the functions of the server in the above method embodiment.
[0107] Optionally, the detection device 700 may also include a communication interface 720 for communicating with other devices via a transmission medium, so that the detection device 700 can communicate with other devices. When the detection device 700 is used to implement the function of the server, the other device may be a client. The communication interface 730 may be, for example, a transceiver, an interface, a bus, a circuit, or a device capable of implementing a transceiver function. The processor 710 may use the communication interface 730 to send and receive data and / or information, and to implement Figure 4 The method executed by the server in the corresponding embodiment.
[0108] Exemplarily, when the device 700 is used to implement the function of the server in the above method embodiment, the processor 710 can be used to control the communication interface 720 to receive feature data of at least one dimension from the client; and can be used to determine the abnormal score based on the feature data of the at least one dimension and a pre-built model, the model includes at least one lonely tree corresponding to the at least one dimension, each lonely tree is constructed based on the feature data of the corresponding dimension in the historical data; based on the abnormal score, determine whether the client is at risk of being attacked. Please refer to the detailed description in the method example for details, which will not be repeated here.
[0109] The detection device 700 may also include at least one memory 730 for storing program instructions and / or data. The memory 730 is coupled to the processor 710. The coupling in the embodiment of the present application is an indirect coupling or communication connection between devices, units or modules, which may be electrical, mechanical or other forms, and is used for information exchange between devices, units or modules. The processor 710 may operate in coordination with the memory 730. The processor 710 may execute program instructions stored in the memory 730. At least one of the at least one memory may be included in the processor.
[0110] The specific connection medium between the processor 710, the communication interface 720 and the memory 730 is not limited in the embodiment of the present application. Figure 7 In the embodiment, the processor 710, the communication interface 720 and the memory 730 are connected via a bus. Figure 7 The connection between other components is only for schematic illustration and is not intended to be limiting. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0111] It should be understood that the processor in the embodiment of the present application can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method embodiment can be completed by the hardware integrated logic circuit or software instructions in the processor. The above processor can be a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or the hardware and software modules in the decoding processor can be combined to perform. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0112] It should also be understood that the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0113] The present application also provides a chip, which includes at least one processor, for implementing the above Figure 2 , Figure 4 or Figure 5 Functions involved in the server in the illustrated embodiment.
[0114] In one possible design, the chip also includes a memory, which is used to store program instructions and data, and the memory is located inside or outside the processor.
[0115] The present application also provides a computer-readable storage medium, which stores a computer program (also referred to as code or instruction). When the computer program is executed, the computer executes the following Figure 2 , Figure 4 or Figure 5 The method of the illustrated embodiment.
[0116] The present application also provides a computer program product, including a computer program, which, when enabled, implements the following Figure 2 , Figure 4 or Figure 5 The method of the illustrated embodiment.
[0117] The terms "unit", "module" and the like used in this specification may be used to represent a computer-related entity, hardware, firmware, a combination of hardware and software, software, or software in execution.
[0118] It will be appreciated by those skilled in the art that the various illustrative logical blocks and steps described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or in combination with computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application. In the several embodiments provided in this application, it should be understood that the disclosed devices, equipment and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the unit is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0119] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0120] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0121] In the above embodiments, the functions of each functional unit can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions (programs). When the computer program instructions (programs) are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital video disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0122] If this function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0123] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for detecting network attack behavior, characterized in that: include: Receiving feature data of at least one dimension from a client; Determining an anomaly score based on the feature data of the at least one dimension and a pre-built model, wherein the model includes at least one lonely tree corresponding to the at least one dimension, each lonely tree being built based on feature data of a corresponding dimension in historical data from different clients; Based on the anomaly score, determining whether the client is at risk of being attacked; Before receiving feature data of at least one dimension from the client, the method further includes: Obtain multiple sets of data from historical data from different clients, each set of data contains feature data of multiple dimensions; For each of the multiple dimensions, a value is randomly selected between the maximum value and the minimum value in the feature data set of the dimension, the feature data set is divided into two branches according to the randomly selected value, and for each branch, the above process of dividing the feature data set is repeated to obtain a lonely tree corresponding to the dimension; the model includes a plurality of lonely trees corresponding to the multiple dimensions, and each of the plurality of lonely trees is constructed by the feature data of the corresponding dimension; After determining that the client is at risk of being attacked, the method further includes: Outputting the abnormality score for manual analysis; Obtaining a manual analysis result, the manual analysis result being obtained based on the manual analysis, the manual analysis result indicating whether the client is attacked; The model is optimized based on the manual analysis result and feature data of at least one dimension from the client.
2. The method according to claim 1, characterized in that The determining of the abnormality score based on the feature data of the at least one dimension and a pre-built model includes: Inputting the feature data of each dimension of the feature data of the at least one dimension into the corresponding lonely tree to determine the depth value of the feature data of each dimension in the lonely tree; The abnormality score is determined based on the depth values of the feature data of the at least one dimension in the corresponding lonely tree.
3. The method according to claim 1, characterized in that The determining, based on the abnormality score, whether the client has a risk of being attacked includes: When the abnormality score is greater than or equal to a preset threshold, determining that the client is at risk of being attacked; or When the abnormal score is less than the preset threshold, it is determined that the client does not have a risk of being attacked.
4. The method according to claim 1, characterized in that The optimizing the model based on the manual analysis result and the feature data of at least one dimension from the client includes: Based on the manual analysis result and the feature data of at least one dimension from the client, perform one or more of the following: Adding lonely trees to the model; deleting one or more lonely trees in the model; and One or more lonely trees in the model are updated.
5. The method according to claim 4, characterized in that The multiple dimensions include one or more of the following: operating system version, whether it is developer mode, whether it is charging status, whether accessibility mode is turned on, whether it is debugging mode, whether a lock screen password is set, whether it is always on when charging, whether debugging mode connection authentication is turned off, number of restarts, startup time, number of applications, and installation time of the application.
6. A network attack behavior detection device, characterized in that: Comprising means for performing the method as claimed in any one of claims 1 to 5.
7. A network attack behavior detection device, characterized in that: The device comprises a processor configured to execute the computer program so as to enable the device to implement the method according to any one of claims 1 to 5.
8. A computer program product, characterized in that The invention comprises a computer program, which, when being executed, implements the method according to any one of claims 1 to 5.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor is caused to implement the method according to any one of claims 1 to 5.
