Botnet detection method, apparatus and device, storage medium and program product

By constructing a directed graph and calculating attack similarity, the botnet probability is identified, which solves the problem of low botnet detection accuracy in the existing technology, improves the detection accuracy and reduces the false alarm rate.

CN118869259AActive Publication Date: 2024-10-29CHINA MOBILE INFORMATION TECHNOLOGY CO LTD +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410851655.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-10-29
Estimated Expiration
2044-06-27

AI Technical Summary

Technical Problem

The accuracy of botnet detection in the existing technology is low, and it is easy to misjudge normal network traffic patterns as botnet activities, resulting in high rates of false negatives and false positives.

Method used

By obtaining the network alarm records of the target network group, construct a directed graph, calculate the attack similarity of the edges, retain the edges and nodes with similarity greater than the preset value, form a second directed graph, and calculate the botnet probability of the connected subgraph. Then obtain the test results.

Benefits of technology

It improves the accuracy of botnet detection, reduces feature dimension interference, reduces the false alarm rate, and enhances the ability to identify botnets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118869259A_ABST
    Figure CN118869259A_ABST
Patent Text Reader

Abstract

The invention discloses a botnet detection method, device and equipment, a storage medium and a program product, and relates to the technical field of network security, and the disclosed botnet detection method comprises the following steps: obtaining a plurality of network alarm records of a target network group; constructing a first directed graph according to the plurality of network alarm records; aiming at any edge of the directed graph, calculating attack similarity between an outgoing edge of a target node of the edge and the edge; reserving a target edge of which the attack similarity is greater than a preset attack similarity in the first directed graph and a node associated with the target edge to obtain a second directed graph; and calculating to obtain botnet probabilities respectively corresponding to the connected sub-graphs in the second directed graph, and obtaining a botnet detection result. According to the invention, the botnet detection accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network security technology, and in particular to a botnet detection method, device, equipment, storage medium and program product. Background Art

[0002] At present, in order to prevent hackers from using botnets to launch distributed denial of service attacks, steal user data and privacy information, and cause website or server paralysis and property losses, related technologies mainly detect botnets based on abnormal network traffic or abnormal network behavior characteristics.

[0003] Among them, when using network traffic for detection, some normal network traffic patterns may be similar to botnet activities, such as the communication patterns of certain software updates or remote management tools, which can easily be misjudged as botnet activities, resulting in low accuracy in botnet detection. Summary of the invention

[0004] The main purpose of this application is to provide a botnet detection method, device, equipment, storage medium and program product, aiming to solve the technical problem of low botnet detection accuracy.

[0005] To achieve the above objectives, the present application proposes a botnet detection method, comprising:

[0006] Obtain multiple network alarm records of the target network group;

[0007] Constructing a first directed graph according to the plurality of network alarm records; wherein the nodes of the first directed graph are communication objects in the network alarm records, and when there is at least one network alarm record between any two communication objects, an edge between the corresponding two nodes is generated;

[0008] For any edge of the first directed graph, calculate the attack similarity between the outgoing edge of the target node of the edge and the edge;

[0009] Retain the target edge whose attack similarity is greater than the preset attack similarity and the nodes associated with the target edge in the first directed graph to obtain a second directed graph;

[0010] The botnet probabilities corresponding to each connected subgraph in the second directed graph are calculated to obtain a botnet detection result.

[0011] In one embodiment, the steps of calculating the botnet probabilities corresponding to the connected subgraphs in the second directed graph and obtaining the botnet detection results include:

[0012] According to the total number of attack paths in the connected subgraph, the similar attack content of the connected subgraph is obtained;

[0013] According to the numerical relationship between the total number of nodes in the connected subgraph and the total number of target edges, the network group connectivity of the connected subgraph is obtained;

[0014] According to the numerical relationship between the number of attack types and the total number of target edges in the connected subgraph, the network group attack complexity of the connected subgraph is obtained; wherein, the attack type to which each target edge belongs is obtained according to the alarm type in the corresponding network alarm record;

[0015] According to the numerical relationship between the number of alarm records and the total number of target edges in the connected subgraph, the network group attack fluctuation degree of the connected subgraph is obtained;

[0016] According to the similar attack content, network group connectivity, network group attack complexity and network group attack fluctuation degree, the botnet probability is calculated and the botnet detection result is obtained.

[0017] In one embodiment, the similar attack content is obtained using Formula 1, which includes: S 1 =log 10 (x 1 +1), where S 1 Represents similar attack content, x 1 Represents the total number of attack paths; and / or

[0018] The network group connectivity is obtained using Formula 2, which includes: Among them, S 2 represents the network group connectivity, x 2 Indicates the total number of nodes, x 3 represents the total number of target edges; and / or

[0019] The complexity of network group attack is obtained using Formula 3, which includes: Among them, S 3 represents the complexity of network group attack, x 4 Indicates the number of attack types; and / or

[0020] The fluctuation degree of network group attack is obtained using Formula 4, which includes: Among them, S 4 Indicates the fluctuation degree of network group attack, x 5 Indicates the number of alarm records.

[0021] In one embodiment, the botnet probability is calculated based on similar attack content, network group connectivity, network group attack complexity, and network group attack fluctuation, and the steps of obtaining botnet detection results include:

[0022] The ratio of the number of features greater than the preset threshold to the total number of features in similar attack content, network group connectivity, network group attack complexity, and network group attack fluctuation is used as the probability of a botnet;

[0023] If the probability is not less than the preset probability, the botnet detection result of the target network group is determined to be a botnet.

[0024] In one embodiment, for any edge of the first directed graph, the step of calculating the attack similarity between the outgoing edge of the target node of the edge and the edge includes:

[0025] According to multiple network alarm records, obtain all first alarm names corresponding to the edges and all second alarm names corresponding to the outgoing edges of the target nodes of the edges;

[0026] According to the similarities between all the first alarm names and all the second alarm names, the attack similarities between the outgoing edges are obtained.

[0027] In one embodiment, the step of obtaining the attack similarity between outgoing edges according to the similarity between all first alarm names and all second alarm names includes:

[0028] All first alarm names are taken as a first alarm name set, and all second alarm names are taken as a second alarm name set;

[0029] Taking the union of the first alarm name set and the second alarm name set to obtain a reference name set;

[0030] generating a first vector in the space vector corresponding to the reference name set according to whether each element in the reference name set exists in the first alarm name set;

[0031] generating a second vector in the space vector corresponding to the reference name set according to whether each element in the reference name set exists in the second alarm name set;

[0032] The cosine similarity between the first vector and the second vector is calculated, and the cosine similarity is used as the attack similarity.

[0033] In addition, to achieve the above purpose, the present application also proposes a botnet detection device, which includes:

[0034] An acquisition module is used to acquire multiple network alarm records of a target network group;

[0035] A construction module, used to construct a first directed graph according to a plurality of network alarm records; wherein the nodes of the first directed graph are communication objects in the network alarm record, and when there is at least one network alarm record between any two communication objects, an edge between the corresponding two nodes is generated;

[0036] A first calculation module, for calculating, for any edge of the first directed graph, an attack similarity between an outgoing edge of a target node of the edge and the edge;

[0037] A retaining module, used for retaining a target edge whose attack similarity is greater than a preset attack similarity and a node associated with the target edge in the first directed graph, to obtain a second directed graph;

[0038] The second calculation module is used to calculate the botnet probabilities corresponding to each connected subgraph in the second directed graph, and obtain the botnet detection result.

[0039] In addition, to achieve the above objectives, the present application also proposes a botnet detection device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the botnet detection method as described above.

[0040] In addition, to achieve the above purpose, the present application also proposes a storage medium, which is a computer-readable storage medium. A computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the botnet detection method as described above are implemented.

[0041] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the botnet detection method as described above are implemented.

[0042] One or more technical solutions proposed in this application have at least the following technical effects:

[0043] In the present application, multiple network alarm records of a target network group are obtained; a first directed graph is constructed based on the multiple network alarm records; wherein the nodes of the first directed graph are communication objects in the network alarm records, and an edge between any two communication objects is generated when there is at least one network alarm record between the two corresponding nodes; for any edge of the first directed graph, the attack similarity between the outgoing edge of the target node of the edge and the edge is calculated; the target edges in the first directed graph whose attack similarity is greater than a preset attack similarity and the nodes associated with the target edges are retained to obtain a second directed graph; the botnet probabilities corresponding to each connected subgraph in the second directed graph are calculated to obtain botnet detection results.

[0044] Compared with the related art of using traffic to detect botnets, this embodiment can use network alarm records with higher data value to construct a first directed graph during the process of detecting botnets, and then calculate the attack similarity between the edge and the outgoing edge of the target node in the first directed graph. The attack similarity is used to remove the edges and related nodes in the first directed graph whose attack similarity is less than the preset attack similarity, thereby dividing the network group containing the botnet from other groups, reducing the interference of the feature dimension, and improving the accuracy of botnet detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0047] Figure 1 A flowchart of the first embodiment of the botnet detection method of the present application is provided;

[0048] Figure 2 A schematic diagram showing the existence of a network alarm record between two communication objects in this application;

[0049] Figure 3 A schematic diagram of the outgoing edge of the target node of the edge of this application;

[0050] Figure 4 This is a schematic diagram of the module structure of the botnet detection device according to an embodiment of the present application;

[0051] Figure 5 Schematic diagram of the device structure of the hardware operating environment involved in the botnet detection method in the embodiment of the present application.

[0052] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0053] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0054] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0055] The main solution of the embodiment of the present application is: obtaining multiple network alarm records of the target network group; constructing a first directed graph based on the multiple network alarm records; wherein the nodes of the first directed graph are communication objects in the network alarm records, and an edge between any two communication objects is generated when there is at least one network alarm record between the two corresponding nodes; for any edge of the first directed graph, calculating the attack similarity between the outgoing edge of the target node of the edge and the edge; retaining the target edge in the first directed graph whose attack similarity is greater than the preset attack similarity and the nodes associated with the target edge to obtain a second directed graph; calculating the botnet probabilities corresponding to each connected subgraph in the second directed graph, and obtaining the botnet detection result.

[0056] A botnet is a group of malicious computers controlled by hackers. These computers are implanted with malicious programs without the knowledge of the hacker and become tools of the hacker. Computers implanted with malicious programs will automatically connect to the Internet, send text messages, clear communication records, etc. without the user's consent, causing many instabilities to the user.

[0057] In addition, hackers can also use computers implanted with malicious programs to launch distributed denial of service attacks, causing websites or servers to crash and affecting normal network operations. At the same time, hackers can also use computers implanted with malicious programs to steal user data and private information, and even perform database collisions and account takeovers, thereby stealing users' property and privacy.

[0058] At present, in order to prevent hackers from using botnets to launch distributed denial of service attacks, steal user data and privacy information, and cause website or server paralysis and property losses, related technologies mainly detect botnets based on abnormal network traffic or abnormal network behavior characteristics.

[0059] Among them, when using network traffic for detection, there are mainly the following defects:

[0060] 1. When using network traffic for detection, it is necessary to obtain training data from historical security data, so that the accuracy of botnet detection mainly depends on the accuracy of security logs in the data. When there are botnet behaviors that are not identified by security devices, it is impossible to detect the botnet behaviors that are not identified by security devices, and there is a high possibility of underreporting;

[0061] 2. When the time difference between two adjacent requests is used to calculate the request interval similarity and the request interval similarity is used as the main basis for judging the botnet, the false alarm rate of the botnet is high because traffic behaviors with similar request frequencies are not only generated by botnets, but also by other machines.

[0062] 3. Although some botnets can be detected by clustering network traffic, attackers can use compromised hosts to simulate normal network traffic for botnet attacks that are more concealed. Therefore, it is difficult to accurately distinguish botnets from normal networks using simple clustering algorithms.

[0063] Therefore, when using network traffic to detect botnets, the accuracy of botnet detection is low due to the inability to identify botnet behavior and to distinguish between normal network traffic and abnormal network traffic.

[0064] The present application provides a solution. Compared with the related art of using traffic to detect botnets, the present embodiment can construct a first directed graph using network alarm records with higher data value during the process of detecting botnets, and then calculate the attack similarity between the edge and the outgoing edge of the target node in the first directed graph. The attack similarity is used to remove the edges and related nodes in the first directed graph whose attack similarity is less than a preset attack similarity, thereby dividing the network group containing the botnet from other groups, reducing the interference of the feature dimension, and improving the accuracy of botnet detection.

[0065] It should be noted that the execution subject of this embodiment may be a botnet detection device, and the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, etc. The botnet detection device is taken as an example to illustrate this embodiment and the following embodiments.

[0066] Based on this, the present application embodiment provides a botnet detection method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the botnet detection method of the present application.

[0067] In this embodiment, the botnet detection method includes steps S10 to S50:

[0068] Step S10, obtaining multiple network alarm records of the target network group.

[0069] In this embodiment, each network alarm record may include the start time of the alarm, the end time of the alarm, the source IP (Internet Protocol), the target IP, the source port, the target port, the source host resource pool, the target host resource pool, the alarm name, the alarm load data, and at least one of the IP internal and external network identifiers.

[0070] Specifically, the botnet detection device can communicate with multiple security devices, such as NTA (Network Terminal Appliance, network traffic analyzer), IDS (Intrusion Detection System, intrusion detection system), IPS (Intrusion Prevention System, intrusion prevention system), WAF (Web Application Firewall, Web Application Firewall) and other devices. The botnet detection device can receive network alarm data regularly sent by security network devices. After receiving the network alarm data, the botnet detection device can extract multiple valid alarm information from the network alarm data and use each extracted valid alarm information as a network alarm record.

[0071] After obtaining multiple network alarm records, in order to facilitate the management of network alarm records, multiple network alarm records can be grouped according to source IP and target IP to obtain multiple groups of network alarm record groups. For each group of network alarm record groups, the alarm name is deduplicated to obtain the deduplicated alarm name, and the alarm type is counted based on the deduplicated alarm name. After deduplicating the alarm name, the number of network alarm records in this group is counted to obtain the number of alarm records. After obtaining the number of alarm records, the earliest alarm start time and the latest alarm end time are determined, and the alarm load data and IP internal and external network identifiers are deduplicated to obtain the deduplicated alarm load data and the deduplicated IP internal and external network identifiers.

[0072] Perform the above operation for each group of network alarm information groups to obtain the deduplicated alarm name, alarm type, number of alarm records, earliest alarm start time, latest alarm end time, deduplicated alarm load data and deduplicated IP internal and external network identifications corresponding to each source IP and target IP. The deduplicated alarm name, alarm type, number of alarm records, earliest alarm start time, latest alarm end time, deduplicated alarm load data and deduplicated IP internal and external network identifications can be saved as an alarm data table to facilitate the management of network alarm records.

[0073] It should be noted that since different security devices have different naming methods for alarm events, in order to facilitate the subsequent improvement of the efficiency of botnet detection using network alarm records, after extracting valid alarm information from the network alarm data, the alarm valid information can be standardized according to unified standards, so that data from different sources can be processed into the same data format and the field naming can be unified.

[0074] Step S20: construct a first directed graph according to the plurality of network alarm records.

[0075] The nodes of the first directed graph are communication objects in the network alarm record, and when there is at least one network alarm record between any two communication objects, an edge between the corresponding two nodes is generated.

[0076] Specifically, when constructing a first directed graph using multiple network alarm records, in order to quickly determine the number of nodes in the directed graph, the source IP, the resource pool to which the source IP belongs, and the source port in the network alarm record can be concatenated to obtain a first concatenated string, and the first concatenated string can be hashed to obtain a first identifier corresponding to the first communication object. Correspondingly, the target IP, the resource pool to which the target IP belongs, and the target port in the network alarm record can be concatenated to obtain a second concatenated string, and the second concatenated string can be hashed to obtain a second identifier corresponding to the second communication object. The number of identifiers of the first identifier and the second identifier is counted, and the number of identifiers is used as the number of nodes in the first directed graph.

[0077] It should be noted that among multiple network alarm records, there may be multiple network alarm records for the same attack event in the same communication object. In order to avoid the appearance of multiple identical nodes in the directed graph, when using multiple network alarm records to construct the first directed graph, the multiple network alarm records can be deduplicated to obtain deduplicated network alarm records. Finally, the source IP, source IP resource pool and source port in the deduplicated network alarm records are used to obtain the first identifier, and the deduplicated target IP, target IP resource pool and target port are used to obtain the second identifier.

[0078] After determining the number of nodes in the first directed graph, the first communication object corresponding to the first identifier and the second communication object corresponding to the second identifier can be used as nodes in the first directed graph, and the first identifier and the second identifier can be used as node names of the corresponding nodes, that is, the communication objects in the network alarm record are used as nodes in the first directed graph. After obtaining the initial directed graph, when there is at least one network alarm record between any two communication objects, an edge corresponding to the two nodes is generated to connect the corresponding two nodes to obtain the first directed graph. Among them, the network alarm record between any two communication objects can be as follows: Figure 2 As shown, IP1 is the first communication object, and IP2 is the second communication object.

[0079] After obtaining the first directed graph, the source IP, target IP, and IP internal and external network identifiers can be used as node attributes and stored in the corresponding nodes, and the alarm name, alarm type, number of alarm records, earliest alarm start time, latest alarm end time, and deduplicated alarm load data can be used as edge attributes and stored in the corresponding edges.

[0080] Step S30: For any edge of the first directed graph, calculate the attack similarity between the outgoing edge of the target node of the edge and the edge.

[0081] Specifically, after obtaining the first directed graph, for any edge in the first directed graph, determine the target node of the edge. After determining the target node, count the out-degree of the target node, that is, the number of edges from the target node to other nodes, and take the edges from the target node to other nodes as out-edges. When the out-degree is 0, it is determined that the target node does not point to other nodes. Correspondingly, when the out-degree is not 0, it is determined that the target node points to at least one other node. For example, when the out-degree is 2, it is determined that the number of other nodes pointed to by the target node is 2, that is, the number of out-edges is 2.

[0082] It should be noted that when calculating the attack similarity between an edge and an outgoing edge, the attack similarity between the edges can be calculated using the attributes of the edge and the outgoing edge. Based on the above, both the edge and the outgoing edge have multiple attributes. When calculating the attack similarity between the edge and the outgoing edge using the attributes of the edge and the outgoing edge, further, as an optional implementation, step S30 specifically includes:

[0083] Step S31, according to a plurality of network alarm records, obtain all first alarm names corresponding to the edges and all second alarm names corresponding to the outgoing edges of the target nodes of the edges.

[0084] Step S32: Obtain attack similarities between outgoing edges according to the similarities between all first alarm names and all second alarm names.

[0085] Specifically, after constructing a first directed graph using multiple network alarm records, for any node in the first directed graph, when the node has an edge pointing to other nodes, the target network alarm record corresponding to the two nodes connected to the edge is determined, and a mapping relationship between the target network alarm record and the edge is constructed, so that subsequently, all network alarm records corresponding to the edge and all network alarm records corresponding to the outgoing edge can be directly obtained from the multiple network alarm records based on the mapping relationship, and all first alarm names can be extracted from all network alarm records corresponding to the edge, and all second alarm names can be extracted from all network alarm records corresponding to the outgoing edge.

[0086] It should be noted that when using all the first alarm names and all the second alarm names to calculate the attack similarity between the edge and the outgoing edge, when the first alarm name and the second alarm name are the same, they are in the same dimension and can be directly calculated at this time. However, when the first alarm name and the second alarm name are different, since different alarm names are in different dimensions, the first alarm name and the second alarm name cannot be used to directly calculate the similarity between the edge and the outgoing edge. Therefore, when using all the first alarm names and all the second alarm names to calculate the attack similarity between the edge and the outgoing edge, in order to unify the dimensions of the calculation, further, as an optional implementation method, step S32 specifically includes:

[0087] Step S321: All first alarm names are taken as a first alarm name set, and all second alarm names are taken as a second alarm name set.

[0088] Step S322: Take the union of the first alarm name set and the second alarm name set to obtain a reference name set.

[0089] Step S323 , generating a first vector in the space vector corresponding to the reference name set according to whether each element in the reference name set exists in the first alarm name set.

[0090] Step S324: Generate a second vector in the space vector corresponding to the reference name set according to whether each element in the reference name set exists in the second alarm name set.

[0091] Step S325, calculating the cosine similarity between the first vector and the second vector, and using the cosine similarity as the attack similarity.

[0092] Specifically, after obtaining all the first alarm names and all the second alarm names, all the first alarm names can be used as the first alarm name set, all the second alarm names can be used as the second alarm name set, and the first alarm name set and the second alarm name set can be taken as the union to obtain a reference name set. After obtaining the reference name set, a first vector can be generated in the space vector corresponding to the reference name set based on whether each element in the reference name set exists in the first alarm name set. Correspondingly, a second vector can be generated in the space vector corresponding to the reference name set based on whether each element in the reference name set exists in the second alarm name set. Finally, the cosine similarity between the first vector and the second vector is calculated, and the cosine similarity is used as the attack similarity.

[0093] To facilitate a better understanding of this embodiment, a specific example is provided below.

[0094] Specifically, refer to Figure 3As shown, assuming that the target node is node b, the edge of node b is E1, the outgoing edge of node b is E2, all the first alarm names corresponding to edge E1 are obtained as a, b, c, and the first alarm name set is determined to be {a, b, c}, all the second alarm names corresponding to the outgoing edge E2 are c, d, e, and the second alarm name set is determined to be {c, d, e}.

[0095] Take the union of the first alarm name set and the second alarm name set to obtain a reference name set of {a, b, c, d, e}. After obtaining the reference name set, it can be determined that the elements of the reference name set in the first alarm name set are a, b, c, so the first vector generated in the vector space corresponding to the reference name set is V1 = [1, 1, 1, 0, 0]. Correspondingly, for the second alarm name set, it can be determined that the elements of the reference name set in the second alarm name set are c, d, e, so the second vector generated in the vector space corresponding to the reference name set is V2 = [0, 0, 1, 1, 1].

[0096] After obtaining the first vector and the second vector, it can be calculated that the cosine similarity between the first vector and the second vector is cos(V1, V2)=0.33, that is, it can be obtained that the attack similarity between the edge E1 and the outgoing edge E2 is 0.33.

[0097] Step S40, retaining the target edge whose attack similarity is greater than the preset attack similarity and the nodes associated with the target edge in the first directed graph to obtain a second directed graph.

[0098] In this embodiment, the second directed graph may include multiple connected subgraphs, and the connected subgraph may be a relationship graph in which at least one edge exists between any two nodes.

[0099] Specifically, based on the foregoing, after calculating the attack similarity between the edge and the outgoing edge, when the attack similarity is greater than the preset attack similarity, the outgoing edge is taken as the edge, and the outgoing edge of the next target node is determined, and step S30 is repeated until the attack similarity is less than the preset attack similarity, or the target node of the edge has no outgoing edge.

[0100] After calculating the attack similarity between any edge and its corresponding outgoing edge, the edge with attack similarity greater than the preset attack similarity is taken as the target edge, and the target edge and the nodes associated with the target edge are retained to obtain a second directed graph.

[0101] In this embodiment, the target edge and the nodes related to the target edge in the first directed graph whose attack similarity is greater than the preset attack similarity are retained to obtain the second directed graph, so that the target edge and the nodes related to the target edge in the second directed graph can constitute a deep attack path with similar attack methods, and when there is any common node between two similar attack paths, the two similar attack paths are regarded as belonging to the same attack range, that is, by removing the connected subgraph that does not contain the similar attack path in the first directed graph, the group containing the botnet is distinguished from other groups, thereby reducing the interference of the feature dimension, improving the accuracy of the detection of the botnet, and thus reducing the false alarm rate of the detection result.

[0102] Step S50, calculating and obtaining the botnet probabilities corresponding to each connected subgraph, and obtaining the botnet detection result.

[0103] When calculating the botnet probability for each connected subgraph in the second directed graph, in order to improve the accuracy of the calculation result, the botnet probability can be calculated using the feature combination of the botnet, that is, similar attack content, network group connectivity, network group attack complexity and network group attack fluctuation degree are taken as an overall feature, and the botnet probability is calculated using similar attack content, network group connectivity, network group attack complexity and network group attack fluctuation degree. Further, as an optional implementation, step S50 specifically includes:

[0104] Step S51, obtaining the similar attack content of the connected subgraph according to the total number of attack paths in the connected subgraph.

[0105] Step S52, obtaining the network group connectivity of the connected subgraph according to the numerical relationship between the total number of nodes in the connected subgraph and the total number of target edges.

[0106] Step S53, obtaining the network group attack complexity of the connected subgraph according to the numerical relationship between the number of attack types and the total number of target edges in the connected subgraph.

[0107] The attack type of each target edge is obtained according to the alarm type in the corresponding network alarm record.

[0108] Step S54, obtaining the network group attack fluctuation degree of the connected subgraph according to the numerical relationship between the number of alarm records and the total number of target edges in the connected subgraph.

[0109] In this embodiment, the similar attack content may be a linear transformation of the number of attack paths contained in a connected subgraph. The network group connectivity may be the comparison degree of nodes and edges contained in a connected subgraph. The network group attack complexity may be the complexity of attack types in a connected subgraph. The network group attack fluctuation degree may be the distribution of the number of alarm records contained in a connected subgraph.

[0110] Specifically, in the same connected subgraph, after determining the total number of attack paths, the total number of nodes, the total number of edges, the number of attack types, and the number of alarm records in the connected subgraph, the similar attack content can be calculated using Formula 1, which includes: S 1 =log 10 (x 1 +1), where S 1 Represents similar attack content, x 1 Represents the total number of attack paths. Correspondingly, the network group connectivity is obtained using Formula 2, which includes: Among them, S 2 represents the network group connectivity, x 2 Indicates the total number of nodes, x 3 represents the total number of target edges; the network group attack complexity is obtained using Formula 3, which includes: Among them, S 3 represents the complexity of network group attack, x 4 Indicates the number of attack types; the fluctuation degree of network group attack is obtained using Formula 4, which includes: Among them, S 4 Indicates the fluctuation degree of network group attack, x 5 Indicates the number of alarm records.

[0111] Step S55, calculating the botnet probability and obtaining the botnet detection result according to the similar attack content, network group connectivity, network group attack complexity and network group attack fluctuation degree.

[0112] When the botnet probability is calculated by using similar attack content, network group connectivity, network group attack complexity and network group attack fluctuation, in order to associate the existence of the botnet with the attack behavior so that security maintenance personnel can better understand the threat level in the network, further, as an optional implementation method, step S55 specifically includes:

[0113] Step S551: The ratio of the number of features greater than a preset threshold to the total number of features in similar attack content, network group connectivity, network group attack complexity, and network group attack fluctuation degree is used as the probability of a botnet.

[0114] Step S552: If the probability is not less than the preset probability, the botnet detection result of the target network group is determined to be a botnet.

[0115] Specifically, after calculating the similar attack content, network group connectivity, network group attack complexity and network group attack fluctuation degree based on the above steps, the similar attack content, network group connectivity, network group attack complexity and network group attack fluctuation degree can be compared with the preset thresholds respectively, and the number of features greater than the preset thresholds can be counted, and finally the ratio of the number of features to the total number of features is used as the probability of a botnet.

[0116] To better illustrate this embodiment, a specific example is provided below.

[0117] Specifically, for a connected subgraph, based on the above steps, S is calculated. 1 =0.6, S 2 =0.7, S 3 =0.55, S 4 =0.2, and the preset threshold is 0.5, it can be determined that among the similar attack content, network group connectivity, network group attack complexity, and network group attack fluctuation, the number of features greater than the preset threshold is 3, and the total number of features is 4. According to the ratio of the number of features to the total number of features, it can be obtained that the probability that the connected subgraph is a botnet is 0.75.

[0118] In this embodiment, similar attack content, network group connectivity, network group attack complexity and network group attack fluctuation are features built around the characteristics of botnets. When calculating the probability of botnets, the above features are used as a whole to calculate the probability of botnets, which can make it easier to find botnet groups in the space formed by the combination of features, so as to avoid the situation where the detection results are inaccurate due to the addition or reduction of features, so as to reduce the false alarm rate of the detection results. At the same time, the ratio of the number of features greater than the preset threshold to the total number of features is used as the probability of botnets, which can link the existence of botnets with attack behaviors and quantify them into a probability value, which can help security maintenance personnel better understand the threat level in the network and give priority to high-risk situations.

[0119] It should be noted that, for general security protection scenarios, when a connected subgraph is evaluated as a botnet with a probability of 100%, it can be determined that a botnet host group exists in the target network group.

[0120] In this embodiment, compared with the related art of using traffic to detect botnets, this embodiment can use network alarm records with higher data value to construct a first directed graph during the process of detecting botnets, and then calculate the attack similarity between the edge and the outgoing edge of the target node in the first directed graph. The attack similarity is used to remove the edges and related nodes in the first directed graph whose attack similarity is less than the preset attack similarity, thereby dividing the network group containing the botnet from other groups, reducing the interference of the feature dimension, and improving the accuracy of botnet detection.

[0121] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the botnet detection method of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.

[0122] This application also provides a botnet detection device, please refer to Figure 4 , the botnet detection device includes:

[0123] An acquisition module 10 is used to acquire multiple network alarm records of a target network group;

[0124] A construction module 20 is used to construct a first directed graph according to the plurality of network alarm records; wherein the nodes of the first directed graph are communication objects in the network alarm record, and when there is at least one network alarm record between any two communication objects, an edge between the corresponding two nodes is generated;

[0125] A first calculation module 30 is used to calculate the attack similarity between the outgoing edge of the target node of the edge and the edge for any edge of the first directed graph;

[0126] A retaining module 40 is used to retain the target edge whose attack similarity is greater than a preset attack similarity and the nodes associated with the target edge in the first directed graph to obtain a second directed graph;

[0127] The second calculation module 50 is used to calculate the botnet probabilities corresponding to each connected subgraph in the second directed graph, and obtain the botnet detection result.

[0128] The botnet detection device provided by the present application adopts the botnet detection method in the above embodiment, which can solve the technical problem of low accuracy of botnet detection. Compared with the related art, the beneficial effects of the botnet detection device provided by the present application are the same as the beneficial effects of the botnet detection method provided by the above embodiment, and other technical features in the botnet detection device are the same as the features disclosed in the above embodiment method, which will not be described in detail here.

[0129] The present application provides a botnet detection device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the botnet detection method in the above-mentioned embodiment 1.

[0130] Reference below Figure 5 , which shows a schematic diagram of the structure of a botnet detection device suitable for implementing the embodiment of the present application. The botnet detection device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The botnet detection device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0131] like Figure 5As shown, the botnet detection device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the botnet detection device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the botnet detection device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a botnet detection device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0132] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0133] The botnet detection device provided by the present application adopts the botnet detection method in the above embodiment, which can solve the technical problem of low accuracy of botnet detection. Compared with the related art, the beneficial effects of the botnet detection device provided by the present application are the same as the beneficial effects of the botnet detection method provided by the above embodiment, and other technical features in the botnet detection device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0134] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0135] 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.

[0136] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the botnet detection method in the above-mentioned embodiment.

[0137] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0138] The computer-readable storage medium may be included in the botnet detection device; or may exist independently without being assembled into the botnet detection device.

[0139] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by a botnet detection device, the botnet detection device: obtains multiple network alarm records of a target network group; constructs a first directed graph based on the multiple network alarm records; wherein the nodes of the first directed graph are communication objects in the network alarm records, and an edge between any two communication objects is generated when there is at least one network alarm record between the two corresponding nodes; for any edge of the first directed graph, the attack similarity between the outgoing edge of the target node of the edge and the edge is calculated; the target edge in the first directed graph whose attack similarity is greater than a preset attack similarity and the nodes associated with the target edge are retained to obtain a second directed graph; the botnet probabilities corresponding to each connected subgraph in the second directed graph are calculated to obtain a botnet detection result.

[0140] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0141] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0142] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0143] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned botnet detection method, and can solve the technical problem of low detection accuracy of botnets. Compared with the related art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the botnet detection method provided in the above-mentioned embodiment, and will not be elaborated here.

[0144] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned botnet detection method when executed by a processor.

[0145] The computer program product provided by this application can solve the technical problem of low accuracy in detecting botnets. Compared with the related art, the beneficial effects of the computer program product provided by this application are the same as those of the botnet detection method provided by the above embodiment, which will not be elaborated here.

[0146] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A botnet detection method, characterized in that: The method comprises: Obtain multiple network alarm records of the target network group; Constructing a first directed graph according to the plurality of network alarm records; wherein the nodes of the first directed graph are communication objects in the network alarm records, and when there is at least one network alarm record between any two communication objects, an edge between the corresponding two nodes is generated; For any edge of the first directed graph, calculating the attack similarity between an outgoing edge of a target node of the edge and the edge; Retain the target edge whose attack similarity is greater than a preset attack similarity and the nodes associated with the target edge in the first directed graph to obtain a second directed graph; The botnet probabilities corresponding to each connected subgraph in the second directed graph are calculated to obtain a botnet detection result.

2. The method according to claim 1, characterized in that The step of calculating and obtaining the botnet probabilities corresponding to the connected subgraphs in the second directed graph and obtaining the botnet detection results comprises: According to the total number of attack paths in the connected subgraph, obtaining the similar attack content of the connected subgraph; Obtaining the network group connectivity of the connected subgraph according to the numerical relationship between the total number of nodes in the connected subgraph and the total number of target edges; According to the numerical relationship between the number of attack types in the connected subgraph and the total number of target edges, the network group attack complexity of the connected subgraph is obtained; wherein the attack type to which each target edge belongs is obtained according to the alarm type in the corresponding network alarm record; According to the numerical relationship between the number of alarm records in the connected subgraph and the total number of target edges, the network group attack fluctuation degree of the connected subgraph is obtained; According to the similar attack content, the network group connectivity, the network group attack complexity and the network group attack fluctuation degree, the botnet probability is calculated to obtain the botnet detection result.

3. The method according to claim 2, characterized in that The similar attack content is obtained using Formula 1, which includes: S1 = log 10 (x1+1), where S1 represents the similar attack content, x1 represents the total number of attack paths; and / or The network group connectivity is obtained using Formula 2, which includes: Wherein, S2 represents the network group connectivity, x2 represents the total number of nodes, and x3 represents the total number of target edges; and / or The network group attack complexity is obtained using Formula 3, which includes: Wherein, S3 represents the complexity of the network group attack, x4 represents the number of attack types; and / or The network group attack fluctuation degree is obtained by using Formula 4, which includes: Among them, S4 represents the fluctuation degree of the network group attack, and x5 represents the number of alarm records.

4. The method according to claim 2, characterized in that The step of calculating the botnet probability according to the similar attack content, the network group connectivity, the network group attack complexity and the network group attack fluctuation degree to obtain the botnet detection result comprises: The ratio of the number of features greater than a preset threshold to the total number of features among the similar attack content, the network group connectivity, the network group attack complexity, and the network group attack fluctuation degree is used as the probability of the botnet; If the probability is not less than the preset probability, the botnet detection result of the target network group is determined to be a botnet.

5. The method according to claim 1, characterized in that The step of calculating the attack similarity between the outgoing edge of the target node of any edge of the first directed graph and the edge comprises: According to the multiple network alarm records, obtain all first alarm names corresponding to the edges and all second alarm names corresponding to the outgoing edges of the target nodes of the edges; According to the similarities between all the first alarm names and all the second alarm names, the attack similarities between the outgoing edge and the edge are obtained.

6. The method according to claim 5, characterized in that The step of obtaining the attack similarity between the outgoing edge and the edge according to the similarity between all the first alarm names and all the second alarm names comprises: Taking all the first alarm names as a first alarm name set, and taking all the second alarm names as a second alarm name set; Taking the union of the first alarm name set and the second alarm name set to obtain a reference name set; generating a first vector in the space vector corresponding to the reference name set according to whether each element in the reference name set exists in the first alarm name set; generating a second vector in the space vector corresponding to the reference name set according to whether each element in the reference name set exists in the second alarm name set; The cosine similarity between the first vector and the second vector is calculated, and the cosine similarity is used as the attack similarity.

7. A botnet detection device, characterized in that: The device comprises: An acquisition module is used to acquire multiple network alarm records of a target network group; A construction module, configured to construct a first directed graph according to the plurality of network alarm records; wherein the nodes of the first directed graph are communication objects in the network alarm records, and when there is at least one network alarm record between any two communication objects, an edge between the corresponding two nodes is generated; A first calculation module, configured to calculate, for any edge of the first directed graph, an attack similarity between an outgoing edge of a target node of the edge and the edge; A retaining module, used for retaining the target edge whose attack similarity is greater than a preset attack similarity and the nodes associated with the target edge in the first directed graph, to obtain a second directed graph; The second calculation module is used to calculate the botnet probabilities corresponding to each connected subgraph in the second directed graph, and obtain the botnet detection result.

8. A botnet detection device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the botnet detection method according to any one of claims 1 to 6.

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

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the botnet detection method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • NetFlow based botnet network detection system and detection method

    CN104618377A

  • Botnet detection system and method in software-defined network

    CN108011894A

  • Method, device and system for determining safety event of electric power monitoring system

    CN110213077A

  • Attack chain detection method, device and equipment

    CN116488941A

  • Graph stream mining pipeline for efficient subgraph detection

    US20200358815A1