Detection and device for challenging black hole attack, electronic equipment and storage medium
By analyzing the characteristic data of multiple target periods and the number of visits in sub-attack periods, the target detection model is used to identify challenge black hole attacks, which solves the problem of low detection accuracy in the existing technology and achieves efficient and accurate challenge black hole attack detection.
Patent Information
- Application Number
- CN202310268208.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-17
- Publication Date
- 2024-09-20
AI Technical Summary
Existing challenge black hole attack detection methods have low accuracy and are difficult to accurately identify challenge black hole attacks in distributed denial-of-service attacks, resulting in frequent false positives and false negatives.
By obtaining the characteristic data of multiple target periods, the target detection model is used to analyze whether a challenge black hole attack occurs in each period, and the detection results are determined based on the number of visits in the sub-attack periods to achieve accurate detection of challenge black hole attacks.
It improves the accuracy of challenging black hole attack detection, reduces the detection time for operation and maintenance personnel, improves detection efficiency, and reduces false positives and false negatives.
Smart Images

Figure CN118677629A
Abstract
Description
Technical Field
[0001] The present application relates to the field of information security technology, and more specifically, to a detection device, electronic device and storage medium for challenging black hole attacks. Background Art
[0002] CC (Challenge Collapsar) attack is a type of DDoS (Distributed Denial of Service) attack, which uses a large number of widely available free proxy servers to send a large number of seemingly legitimate requests to the victim server. Many free proxy servers support anonymous mode, which makes tracking very difficult.
[0003] Currently, operation and maintenance personnel can determine whether a page exhibits attack symptoms by observing the access log data of the page in the server and the status of various server indicators.
[0004] However, the accuracy of detecting black hole attacks on pages using existing methods is low. Summary of the invention
[0005] In view of this, the embodiments of the present application propose a detection device, an electronic device and a storage medium for challenging black hole attacks.
[0006] In a first aspect, an embodiment of the present application provides a method for detecting a challenge black hole attack, the method comprising: obtaining characteristic data of each of a plurality of target time periods, the characteristic data of each of the target time periods representing the access situation of a target page in the target time period; inputting the characteristic data of each of the target time periods into a target detection model to obtain a model detection result of each of the target time periods, the model detection result of each of the target time periods representing whether a challenge black hole attack occurs to the target page in the target time period; determining a plurality of sub-attack time periods according to the attack time period, the attack time period referring to a target time period for which a model detection result indicates that a challenge black hole attack occurs; and determining a challenge black hole attack detection result of the target page according to the number of visits to each of the sub-attack time periods.
[0007] In the second aspect, an embodiment of the present application provides a detection device for a challenge black hole attack, the device comprising: an acquisition module, used to obtain characteristic data of each of a plurality of target time periods, the characteristic data of each target time period characterizing the access situation of a target page in the target time period; a model detection module, used to input the characteristic data of each target time period into a target detection model to obtain a model detection result of each target time period, the model detection result of each target time period characterizing whether a challenge black hole attack occurs to the target page in the target time period; a time period determination module, used to determine a plurality of sub-attack time periods according to an attack time period, the attack time period refers to a target time period for which a model detection result indicates that a challenge black hole attack occurs; a result determination module, used to determine the challenge black hole attack detection result of the target page according to the number of visits to each sub-attack time period.
[0008] Optionally, the target period includes multiple sub-periods; the acquisition module is also used to obtain the number of visits to the target page within a preset time period as the first number of visits; obtain the number of visits to the target page within the target period as the second number of visits; obtain the maximum number of visits from the number of visits of each of the multiple sub-periods as the third number of visits; obtain the minimum number of visits from the number of visits of each of the multiple sub-periods as the fourth number of visits; calculate the difference between the third number of visits and the fourth number of visits as the number of visits difference; count the number of times the target page is abnormal in multiple sub-periods as the target number of abnormalities; obtain the first number of visits, the second number of visits, the third number of visits, the fourth number of visits, the number of visits difference and the target number of abnormalities as the characteristic data of the target period.
[0009] Optionally, the acquisition module is also used to obtain the number of website requests for the target website where the target page is located, the number of page visits to the target page, and the request concentration of the target page in each sub-period, and the request concentration of each sub-period represents the attention of the target page in the target website in the sub-period; if the number of website requests corresponding to the sub-period is greater than a first threshold, the number of page requests is greater than a second threshold, and the request concentration is greater than a third threshold, it is determined that an abnormality has occurred in the target page in the sub-period.
[0010] Optionally, the time period determination module is also used to obtain a time period of a first duration before the attack period as a first recall period; obtain a time period of a second duration after the attack period as a second recall period; merge the first recall period, the second recall period and the attack period to obtain a target recall period; and divide the target recall period to obtain multiple sub-attack periods.
[0011] Optionally, the result determination module is also used to obtain a visit volume threshold of the target page for the attack period; select a sub-attack period whose visit volume reaches the visit volume threshold from multiple sub-attack periods as a preliminary period; and determine the challenge black hole attack detection result of the target page based on the preliminary period.
[0012] Optionally, the result determination module is further configured to calculate an average of the number of visits in multiple sub-attack periods as a number of visit thresholds.
[0013] Optionally, the preliminary time period includes multiple; the result determination module is also used to obtain the earliest preliminary time period among the multiple preliminary time periods as the starting time period; obtain the latest preliminary time period among the multiple preliminary time periods as the ending time period; according to the number of visits to each of the multiple preliminary time periods, the number of visits to the preliminary time periods between the starting time period and the ending time period is subjected to continuity fitting processing to obtain the challenge black hole attack detection result of the target page.
[0014] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory; one or more programs are stored in the memory and configured to be executed by the processor to implement the above method.
[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a program code is stored, wherein the above method is executed when the program code is executed by a processor.
[0016] In a fifth aspect, an embodiment of the present application provides a computer program product or a computer program, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device performs the above method.
[0017] The embodiments of the present application provide a detection, device, electronic device and storage medium for a challenge black hole attack. In the present application, an attack period is determined in multiple target time periods through a target detection model, and the challenge black hole attack detection result of the target page is determined according to the number of visits to the sub-attack period corresponding to the attack period. The number of visits to the sub-attack period can accurately characterize whether a challenge black hole attack has occurred in the sub-attack period, so that the accuracy of determining the challenge black hole attack detection result of the target page according to the number of visits to each sub-attack period is high. At the same time, there is no need for operation and maintenance personnel to manually perform challenge black hole attack detection, which reduces the detection time and improves the detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1is a schematic diagram of an application scenario shown according to an embodiment of the present application;
[0020] Figure 2 A flow chart of a method for detecting a black hole attack challenge provided by an embodiment of the present application is shown;
[0021] Figure 3 A schematic diagram of access log data in an embodiment of the present application is shown;
[0022] Figure 4 A flowchart of a method for detecting a black hole attack challenge provided by another embodiment of the present application is shown;
[0023] Figure 5 A curve relationship diagram of the visit volume and time of a target page in an embodiment of the present application is shown;
[0024] Figure 6 A block diagram of a detection device for challenging a black hole attack proposed in one embodiment of the present application is shown;
[0025] Figure 7 A structural block diagram of an electronic device for executing a detection method for challenging a black hole attack according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. According to the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0027] In the following description, the terms "first\second" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0029] CC (Challenge Collapsar, Challenge Black Hole) attack is a type of DDoS (Distributed Denial of Service) attack, which uses a large number of widely available free proxy servers to send a large number of seemingly legitimate requests to the victim server. Many free proxy servers support anonymous mode, which makes tracking very difficult
[0030] The principle of CC attack is that the attacker controls certain hosts to continuously send a large number of data packets to the other server, causing the server resources to be exhausted until it crashes. CC attack is mainly used to attack network pages. For example, when a web page has a large number of visitors, it will be very slow to open the web page. CC attack simulates multiple users sending a large number of access requests in a short period of time to access pages that require a large amount of data operations, resulting in a waste of server resources, the CPU is at 100% for a long time, and there are always endless connections until the network is congested and normal access is terminated.
[0031] Currently, operation and maintenance personnel can determine whether a page exhibits attack symptoms by observing the access log data of the page in the server and the status of various server indicators.
[0032] For example, when a network application is under CC attack, the data transmission in the network application becomes seriously high, the network occupancy reaches more than 99%, and the CPU utilization rate of the server soars, etc. The operation and maintenance personnel can determine whether a CC attack has occurred based on the data transmission, network utilization and CPU utilization rate of the server.
[0033] In addition, to achieve automatic detection of CC attacks, it is also possible to determine whether a page has been attacked by CC by using information such as request IP whitelists, threshold judgment of real-time request data, and statistics of the number of visits and concentration of request IPs. However, when using these methods to detect CC attacks, there are still a large number of false positives and missed negatives, resulting in a low accuracy rate for CC attack detection.
[0034] To solve the above problems, the inventors have proposed a challenge black hole attack detection device, electronic device and storage medium. The number of visits in a sub-attack period can accurately characterize whether a challenge black hole attack has occurred in the sub-attack period, so that the challenge black hole attack detection result of the target page is determined based on the number of visits in each sub-attack period with a high accuracy. At the same time, there is no need for operation and maintenance personnel to manually perform challenge black hole attack detection, which reduces the detection time and improves the detection efficiency.
[0035] Figure 1A schematic diagram of an implementation environment provided by an exemplary embodiment of the present application is shown. The implementation environment includes a terminal 110 and a server. The terminal 110 and the server 120 perform data communication via a communication network. Optionally, the communication network may be a wired network or a wireless network, and the communication network may be at least one of a local area network, a metropolitan area network, and a wide area network.
[0036] The terminal 110 is a terminal used to obtain the challenge black hole attack detection result of the target page according to the characteristic data of each of the multiple target time periods, and the terminal includes but is not limited to a mobile phone, a computer, an intelligent voice interaction device, a smart home appliance, a car terminal, etc., which is not limited in the embodiments of the present application. In some embodiments, the terminal 110 is a terminal used by a scorer, and the scorer can be a teacher or a professional.
[0037] Server 120 is the server where the target page is located. It can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), as well as big data and artificial intelligence platforms.
[0038] The target page can refer to a website page, an e-commerce page, or a product page in an e-commerce website.
[0039] In a possible implementation, when a challenge black hole attack detection is required, the terminal 110 obtains characteristic data of each of the multiple target time periods from the server 120, and the terminal 110 analyzes the characteristic data of each of the multiple target time periods through a target detection model (the server 120 trains the target detection model and sends the target detection model to the terminal 110) to obtain a challenge black hole attack detection result of the target page, and feeds back the challenge black hole attack detection result of the target page to the server 120. The terminal 110 may also train the target detection model and store the target detection model locally.
[0040] In another possible implementation, when it is necessary to train a detection model for challenging black hole attacks, the server 120 obtains characteristic data of each of the multiple target time periods from itself, and the server 120 analyzes the characteristic data of each of the multiple target time periods through the target detection model to obtain the challenge black hole attack detection result of the target page.
[0041] For the convenience of description, in the following embodiments, the detection method for challenging a black hole attack is described by taking the method being executed by an electronic device as an example.
[0042] See also Figure 2 , Figure 2 A flowchart of a method for detecting a black hole attack challenge provided by an embodiment of the present application is shown. The method can be used for electronic devices (such as Figure 1 The method comprises:
[0043] S110: Acquire characteristic data of each of a plurality of target time periods, wherein the characteristic data of each target time period represents the access situation of the target page in the target time period.
[0044] In this embodiment, the target page may refer to a page to be challenged with a black hole attack detection, and the target page may be, for example, a website page, an e-commerce page, or a product page in an e-commerce website, etc. A server that provides service support for the target page is used as the target server.
[0045] The target server may include an operation and maintenance system, and the operation and maintenance system includes access log data of the target server. The access log data may be stored in a json format.
[0046] See also Figure 3 , Figure 3 A schematic diagram of access log data in an embodiment of the present application is shown, wherein the field description of the access log data refers to Table 1, which is as follows:
[0047] Table 1
[0048]
[0049]
[0050] The target period may refer to the period of time during which the black hole attack challenge is to be detected, and the target period may be set based on demand. Each target period is non-overlapping, and the duration of each target period may be a fixed duration. For example, a day of 24 hours is taken as the total duration, and the duration of each target period is determined to be 1 hour, thereby dividing a day into 24 target periods. A fixed duration may be divided into multiple target periods by a time window of a specific duration. For example, 10 hours may be divided into 10 target periods by a time window of 1 hour.
[0051] In a possible implementation, each target period may be a discontinuous period, and there may be intervals between each target period. For example, the first target period is from 1:00 to 2:00, and the second target period is from 3:00 to 4:00. The period between the two target periods is not used as a target period and is not used for the detection of the challenge black hole attack.
[0052] The electronic device can obtain access log data from the target server, obtain access log data within each target period from the access log data, and analyze the access log data within each target period to obtain characteristic data of each target period.
[0053] As an implementation mode, the target period includes multiple sub-periods; the method for obtaining characteristic data of the target period includes: obtaining the number of visits to the target page within a preset time period as the first number of visits; obtaining the number of visits to the target page within the target period as the second number of visits; obtaining the maximum number of visits from the number of visits of each of the multiple sub-periods as the third number of visits; obtaining the minimum number of visits from the number of visits of each of the multiple sub-periods as the fourth number of visits; calculating the difference between the third number of visits and the fourth number of visits as the number of visits difference; counting the number of times the target page is abnormal in multiple sub-periods as the target number of abnormalities; obtaining the first number of visits, the second number of visits, the third number of visits, the fourth number of visits, the number of visits difference and the target number of abnormalities as the characteristic data of the target period.
[0054] Each target period can be divided into multiple sub-periods. Access log data in each sub-period is obtained based on the access log data in the target period. The access log data in each sub-period is analyzed to obtain characteristic data of the target period.
[0055] Each target period can be divided into multiple sub-periods by a time window of fixed length. For example, a target period is 1 hour, a sub-period is 1 minute, and the target period is divided into 60 sub-periods by a time window of 1 minute.
[0056] For each sub-period, the access log data obtained from the target server is processed through the time window corresponding to the sub-period: statistics on the number of visits, request data packet length, number of abnormal target pages, number of request IPs, number of abnormal status codes and other indicator characteristics.
[0057] The number of visits in a sub-period refers to the number of access log data in the sub-period (for example, if the sub-period is one minute, the number of visits is the number of access log data in one minute). According to the number of visits in each sub-period in the target period, the third number of visits (maximum number of visits) and the fourth number of visits (minimum number of visits) are determined, and the difference in number of visits is calculated according to the third number of visits and the fourth number of visits.
[0058] In this embodiment, the page views in the target period (second page views) may refer to the sum of page views in each sub-period within the target period.
[0059] The preset duration may be a duration greater than the target period, for example, the target period is 1 hour, and the preset duration may be, for example, 1 day. The access log data obtained from the target server is used to count the number of visits (first number of visits) within the preset duration.
[0060] The request packet length of a sub-period is the average length of the request packet in the access log data within the sub-period (for example, if the sub-period is one minute, the request packet length is the average length of the request packet in the access log data within one minute).
[0061] The number of request IPs in a sub-period refers to the number of client IPs in the access log data within the sub-period (for example, the sub-period is one minute, and the number of request IPs is the number of client IPs in the access log data within one minute).
[0062] The number of abnormal status codes in a sub-period refers to the number of server response status codes in the access log data that are not equal to 200 in the sub-period (for example, if the sub-period is one minute, the number of abnormal status codes is the number of server response status codes in the access log data that are not equal to 200 in one minute.
[0063] The abnormal target page refers to the target page that has an abnormality, and the number of abnormal target pages in the target period refers to the number of times the target page has an abnormality in the target period (that is, the number of abnormal target pages is the above-mentioned target abnormal number). For example, the target period includes 60 sub-periods, and the target page has an abnormality in 20 sub-periods, then the target abnormal number is 20.
[0064] In this embodiment, a method for determining whether a target page is abnormal includes: obtaining the number of website requests for the target page, the number of page visits to the target page, and the request concentration of the target page in each sub-period, the request concentration of each sub-period representing the attention of the target page in the target website in the sub-period; if the number of website requests corresponding to the sub-period is greater than a first threshold, the number of page requests is greater than a second threshold, and the request concentration is greater than a third threshold, it is determined that an abnormality has occurred in the target page in the sub-period.
[0065] The website where the target page is located is referred to as the target website. For example, if the target page is a page of a certain product in a shopping mall, the target website may refer to the shopping mall.
[0066] The number of page visits of the target page in a sub-period refers to the number of log data entries of the target page in the sub-period, and the number of website visits of the target website in the sub-period refers to the number of log data entries of the target website in the sub-period. In this embodiment, the ratio of the number of page visits of the target page in each sub-period to the number of website visits of the target website can be calculated as the request concentration of the sub-period.
[0067] The first threshold, the second threshold and the third threshold may be values set based on demand. For example, the first threshold is 1000, the second threshold is 100, and the third threshold is 20.
[0068] S120, inputting the characteristic data of each target period into the target detection model to obtain the model detection result of each target period, wherein the model detection result of each target period indicates whether the target page has undergone a challenge black hole attack in the target period.
[0069] The characteristic data of each target time period (the above-mentioned first visit volume, second visit volume, third visit volume, fourth visit volume, visit volume difference and target abnormal number) can be input into the target detection model to obtain the model detection result of the target time period predicted by the target detection model.
[0070] The target detection model can be constructed through a neural network model or a decision tree model.
[0071] As an implementation method, the target detection model is constructed by a neural network model, and the characteristic data of the target time period can be input into the target detection model to obtain the probability of a challenge black hole attack occurring in the target time period predicted by the target detection model. If the probability of a challenge black hole attack occurring in the target time period is greater than a probability threshold, a model detection result that a challenge black hole attack occurs in the target time period is obtained; if the probability of a challenge black hole attack occurring in the target time period is not greater than the probability threshold, a model detection result that no challenge black hole attack occurs in the target time period is obtained, wherein the probability threshold can be 0.8, for example.
[0072] As another implementation method, the target detection model is constructed by a decision tree model. The feature data of the target time period can be input into the target detection model to directly obtain the model detection result predicted by the target detection model. The model detection result is whether a challenge black hole attack occurs during the target time period or whether a challenge black hole attack does not occur.
[0073] In this embodiment, feature data of each of the multiple target time periods can be obtained, and the feature data of each target time period can be input into the target detection model to obtain the model detection result of each time period. For example, the target time periods include three: A1 target time period, A2 target time period, and A3 target time period. The feature data of the A1 target time period is input into the target detection model to obtain the model detection result of the A1 target time period; the feature data of the A2 target time period is input into the target detection model to obtain the model detection result of the A2 target time period; the feature data of the A3 target time period is input into the target detection model to obtain the model detection result of the A3 target time period.
[0074] S130. Determine multiple sub-attack time periods according to the attack time period, where the attack time period refers to the target time period in which the model detection result indicates that a challenge black hole attack occurs.
[0075] After obtaining the model detection results of each target time period, the target time period in which the model detection results indicate that the challenge black hole attack occurs is determined as the attack time period.
[0076] Then, multiple sub-attack time periods are determined according to the attack time period. The attack time period can be directly divided (can be evenly divided) into multiple sub-time periods; or the attack time period can be expanded to obtain an extended time period, and then the extended time period is divided (can be evenly divided) into multiple sub-time periods.
[0077] For example, if the attack period is 60 minutes, the attack period can be divided into 60 1-minute sub-periods. For another example, if the attack period is 40 minutes, the 10-minute period before and after the attack period can be determined as the extension of the attack period to obtain a 60-minute extension period. The extension period is then divided into 60 1-minute sub-periods.
[0078] S140: Determine the challenge black hole attack detection result of the target page according to the number of visits in each sub-attack period.
[0079] After obtaining each sub-attack period, the access volume of each sub-attack period (the number of access log data in each sub-attack period) is determined according to the access log data obtained from the target server, and the challenge black hole attack detection result of the target page is determined.
[0080] As an implementation method, the number of visits in each sub-attack period can be plotted as a curve as a challenge black hole attack detection result of the target page.
[0081] In this embodiment, the attack period is determined in multiple target time periods through the target detection model, and the challenge black hole attack detection result of the target page is determined according to the visit volume of the sub-attack period corresponding to the attack period. The visit volume of the sub-attack period can accurately characterize whether a challenge black hole attack has occurred in the sub-attack period, so that the challenge black hole attack detection result of the target page determined according to the visit volume of each sub-attack period has a high accuracy. At the same time, there is no need for operation and maintenance personnel to manually perform challenge black hole attack detection, which reduces the detection time and improves the detection efficiency.
[0082] In addition, in this embodiment, the feature data includes data of multiple dimensions such as the first number of visits, the second number of visits, the third number of visits, the fourth number of visits, the difference in number of visits, and the number of target anomalies. The feature data includes more information, so that the accuracy of the model detection results predicted by the target detection model based on the feature data is higher, thereby improving the accuracy of the challenge black hole attack detection results of the target page obtained based on the model detection results.
[0083] By extracting feature data, we can effectively strengthen the correlation features, such as traffic stratification, the difference between the maximum and minimum visits, and other adjacent features. These strongly correlated features further ensure the high recall and high accuracy of the target detection model, and have strong robustness.
[0084] See also Figure 4 , Figure 4 A flowchart of a method for detecting a black hole attack challenge provided by another embodiment of the present application is shown. The method can be used for electronic devices (such as Figure 1 The method comprises:
[0085] S210, obtaining feature data of each of the plurality of target time periods; inputting the feature data of each target time period into a target detection model to obtain a model detection result of each target time period.
[0086] The description of S210 refers to the description of S110 to S120 above, which will not be repeated here.
[0087] S220, obtaining a time period of a first duration before the attack period as a first recall period; obtaining a time period of a second duration after the attack period as a second recall period; merging the first recall period, the second recall period and the attack period to obtain a target recall period; dividing the target recall period to obtain multiple sub-attack periods.
[0088] The first duration and the second duration may be durations not greater than the target time period. For example, when the target time period is 1 hour, the first duration and the second duration are both 20 minutes.
[0089] The first recall period, the target period, and the second recall period are combined to obtain the target recall period. For example, if the target period is 13:00-14:00, the first duration is 20 minutes, the second duration is 20 minutes, and the determined target recall period is 12:40-14:20.
[0090] When dividing the target time periods, it is possible to cut the attacked time periods apart, so that the target detection model can only predict the target time periods with obvious features, while the target time periods without obvious features and adjacent to the attacked time periods cannot be identified.
[0091] As an implementation manner, the attack period includes a plurality of adjacent attack periods, and for each attack period, the sub-attack periods of each attack period are determined in accordance with S220.
[0092] like Figure 5As shown, rectangular boxes 501 and 502 correspond to two target time periods respectively, and the solid points on the curve are the moments of challenged black hole attacks. It is obvious that the model detection result of the target time period corresponding to rectangular box 502 is the same as the time period that is not challenged by the black hole attack, and the target detection model cannot predict it, but the target time period corresponding to rectangular box 502 includes the moment of challenged black hole attack. For this reason, it is necessary to recall the adjacent target time periods to obtain the target recall time period, thereby improving the accuracy of detection.
[0093] After the target recall period is obtained, the target recall period is divided (for example, evenly divided) to obtain a plurality of sub-attack periods, wherein the sub-attack periods may have the same duration as the above sub-periods.
[0094] S230: Obtain a threshold of the number of visits to the target page during the attack period.
[0095] Different access thresholds can be set for different target pages. The access thresholds for different attack periods (the model detection results are the target periods for black hole attack challenges) of the same target page can be different. Users can set them based on their needs, and this application does not limit them.
[0096] As an implementation, S230 may include: calculating an average of the visits of multiple sub-attack periods as the visit threshold. The average of the visits of multiple sub-attack periods within the attack period may be calculated as the visit threshold of the target page for the attack period.
[0097] S240: Filter out a sub-attack period whose visit volume reaches a visit volume threshold from among the multiple sub-attack period, as a primary selection period.
[0098] For each attack period, a sub-attack period in which the number of visits in the attack period reaches the number of visits threshold is used as a primary selection period for the attack period.
[0099] For example, attack period B1 includes 60 sub-attack periods (60 sub-attack periods are marked with b1-b60), among which the visits of b1-b20 and b45-b60 reach the visit threshold, and it is determined that b1-b20 and b45-b60 are both primary selection periods.
[0100] S250: Determine the challenge black hole attack detection result of the target page according to the preliminary selection period.
[0101] The preliminary selection period can be used as the period when the target page is attacked by the challenge black hole attack to obtain the challenge black hole attack detection result of the target page, wherein the challenge black hole attack detection result of the target page is that the challenge black hole attack occurs in the preliminary selection period.
[0102] As an implementation method, the preliminary selection time period may include multiple; S250 may include: obtaining the earliest preliminary selection time period among the multiple preliminary selection time periods as the starting time period; obtaining the latest preliminary selection time period among the multiple preliminary selection time periods as the ending time period; and performing continuity fitting processing on the visits of the preliminary selection time periods between the starting time period and the ending time period according to the visits of each of the multiple preliminary selection time periods to obtain the challenge black hole attack detection result of the target page.
[0103] The continuity fitting process refers to adjusting the discontinuous portion of the visit volume in the preliminary selection period between the start period and the end period, so that the visit volume of multiple preliminary selection periods (including the start period and the end period) changes continuously.
[0104] In addition, after performing continuity fitting processing on the visits of the preliminary time period between the starting time period and the ending time period, the visits of multiple preliminary time periods (including the starting time period and the ending time period) can be plotted into an access curve, and the drawn access curve can be used as the challenge black hole attack detection result of the target page, which is used to reflect the changes in the visits of the target page under the challenge black hole attack.
[0105] In this embodiment, the visit volume threshold of the attack period is determined by the visit volume of multiple sub-attack periods under the attack period, which improves the accuracy of the visit volume threshold, thereby making the obtained preliminary period more accurate and improving the accuracy of the challenge black hole attack detection result of the target page. At the same time, the visit volume of the preliminary period between the start period and the end period is subjected to continuity fitting processing, so that the visit volume of multiple preliminary periods is more continuous and accurate, further improving the accuracy of the challenge black hole attack detection result of the target page.
[0106] In addition, the detection accuracy is greatly improved through sophisticated operations such as recalling adjacent attack periods, filtering access volume in sub-attack periods, and continuity fitting processing.
[0107] In this application, automatic and accurate detection of CC attacks is achieved, which not only improves operation and maintenance efficiency and effectively reduces operation and maintenance costs, but also detects and defends CC attacks in a timely manner. When detecting the target page of an online store, it can prevent the merchant store from being unable to trade, thereby avoiding losses in transaction volume.
[0108] See also Figure 6 , Figure 6 A block diagram of a detection device for challenging a black hole attack proposed in an embodiment of the present application is shown, and the device 700 includes:
[0109] An acquisition module 710 is used to acquire characteristic data of each of a plurality of target time periods, wherein the characteristic data of each target time period represents the access situation of the target page in the target time period;
[0110] The model detection module 720 is used to input the characteristic data of each target period into the target detection model to obtain the model detection result of each target period, and the model detection result of each target period indicates whether the target page has a challenge black hole attack in the target period;
[0111] A time period determination module 730, configured to determine a plurality of sub-attack time periods according to an attack time period, wherein an attack time period refers to a target time period in which a model detection result indicates that a challenge black hole attack occurs;
[0112] The result determination module 740 is used to determine the challenge black hole attack detection result of the target page according to the number of visits in each sub-attack period.
[0113] Optionally, the target period includes multiple sub-periods; the acquisition module 710 is also used to obtain the number of visits to the target page within a preset time period as the first number of visits; obtain the number of visits to the target page within the target period as the second number of visits; obtain the maximum number of visits from the number of visits of each of the multiple sub-periods as the third number of visits; obtain the minimum number of visits from the number of visits of each of the multiple sub-periods as the fourth number of visits; calculate the difference between the third number of visits and the fourth number of visits as the number of visits difference; count the number of times anomalies occur in the target page in multiple sub-periods as the target number of anomalies; obtain the first number of visits, the second number of visits, the third number of visits, the fourth number of visits, the number of visits difference and the target number of anomalies as the characteristic data of the target period.
[0114] Optionally, the acquisition module 710 is also used to obtain the number of website requests for the target website where the target page is located, the number of page visits to the target page, and the request concentration of the target page in each sub-period, and the request concentration of each sub-period represents the attention of the target page in the target website in the sub-period; if the number of website requests corresponding to the sub-period is greater than the first threshold, the number of page requests is greater than the second threshold, and the request concentration is greater than the third threshold, it is determined that an abnormality has occurred in the target page in the sub-period.
[0115] Optionally, the time period determination module 730 is also used to obtain a time period of a first duration before the attack period as a first recall period; obtain a time period of a second duration after the attack period as a second recall period; merge the first recall period, the second recall period and the attack period to obtain a target recall period; and divide the target recall period to obtain multiple sub-attack periods.
[0116] Optionally, the result determination module 740 is also used to obtain the access volume threshold of the target page for the attack period; select the sub-attack period whose access volume reaches the access volume threshold from multiple sub-attack periods as the preliminary period; and determine the challenge black hole attack detection result of the target page based on the preliminary period.
[0117] Optionally, the result determination module 740 is further configured to calculate an average value of the number of visits in multiple sub-attack periods as a number of visits thresholds.
[0118] Optionally, the preliminary selection time period includes multiple; the result determination module 740 is further used to obtain the earliest preliminary selection time period among the multiple preliminary selection time periods as the starting time period; obtain the latest preliminary selection time period among the multiple preliminary selection time periods as the ending time period; according to the visit volumes of the multiple preliminary selection time periods, the visit volumes of the preliminary selection time periods between the starting time period and the ending time period are subjected to continuity fitting processing to obtain the challenge black hole attack detection result of the target page. .
[0119] It should be noted that the device embodiments in the present application correspond to the aforementioned method embodiments. The specific principles in the device embodiments can be found in the contents of the aforementioned method embodiments and will not be repeated here.
[0120] Figure 7 The structure block diagram of an electronic device for executing the detection method of the challenge black hole attack according to the embodiment of the present application is shown. The electronic device may be Figure 1 In the server, it should be noted that Figure 7 The computer system 1200 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0121] like Figure 7 As shown, the computer system 1200 includes a central processing unit (CPU) 1201, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1202 or the program loaded from the storage part 1208 to the random access memory (RAM) 1203, such as executing the method in the above embodiment. In RAM 1203, various programs and data required for system operation are also stored. CPU 1201, ROM 1202 and RAM 1203 are connected to each other through bus 1204. Input / output (I / O) interface 1205 is also connected to bus 1204.
[0122] The following components are connected to the I / O interface 1205: an input section 1206 including a keyboard, a mouse, etc.; an output section 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the I / O interface 1205 as needed. A removable medium 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1210 as needed so that a computer program read therefrom is installed into the storage section 1208 as needed.
[0123] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes 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 section 1209, and / or installed from a removable medium 1211. When the computer program is executed by a central processing unit (CPU) 1201, various functions defined in the system of the present application are executed.
[0124] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, 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), a 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 the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0125] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, 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 box can also occur in a different order from the order marked in the accompanying drawings. For example, two 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 box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart 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.
[0126] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0127] As another aspect, the present application further provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments; or may exist independently without being assembled into the electronic device. The above computer-readable storage medium carries computer-readable instructions, and when the computer-readable storage instructions are executed by a processor, the method in any of the above embodiments is implemented.
[0128] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the method in any of the above embodiments.
[0129] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0130] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0131] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary techniques in the art that are not disclosed in the present application. It should be understood that the present application is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
[0132] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for detecting a black hole attack, characterized in that: The method comprises: Acquire characteristic data of each of a plurality of target time periods, wherein the characteristic data of each target time period represents the access situation of the target page in the target time period; Inputting the characteristic data of each target period into the target detection model to obtain the model detection result of each target period, wherein the model detection result of each target period indicates whether the target page has a challenge black hole attack in the target period; Determine multiple sub-attack periods according to the attack period, wherein the attack period refers to the target period in which the model detection result indicates that a challenge black hole attack occurs; The challenge black hole attack detection result of the target page is determined according to the number of visits in each sub-attack period.
2. The method according to claim 1, characterized in that The target period includes a plurality of sub-periods; and the method for acquiring the characteristic data of the target period includes: Obtaining the number of page views of the target page within a preset time period as a first number of page views; Obtaining the number of visits to the target page within the target time period as a second number of visits; Obtaining a maximum value of the page views from the page views of each of the plurality of sub-periods as a third page view; Obtaining a minimum value of the page views from the page views of each of the plurality of sub-periods as a fourth page view; Calculating a difference between the third page views and the fourth page views as a page views difference; Counting the number of times the target page is abnormal in the multiple sub-periods as the target abnormal number; The first page views, the second page views, the third page views, the fourth page views, the page views difference, and the target abnormal number are obtained as feature data of the target time period.
3. The method according to claim 2, characterized in that Before counting the number of times the target page is abnormal in the plurality of sub-periods as the target abnormal number, the method further includes: Obtaining the number of website requests of the target website where the target page is located, the number of page visits of the target page, and the request concentration of the target page in each sub-period, wherein the request concentration of each sub-period represents the attention of the target page in the target website in the sub-period; If the number of website requests corresponding to the sub-period is greater than the first threshold, the number of page requests is greater than the second threshold, and the request concentration is greater than the third threshold, it is determined that an abnormality occurs in the target page in the sub-period.
4. The method according to claim 1, characterized in that: The step of determining a plurality of sub-attack time periods according to the attack time period includes: Obtaining a first time period before the attack period as a first recall period; Acquire a second time period after the attack period as a second recall period; Merging the first recall period, the second recall period, and the attack period to obtain a target recall period; The target recall period is divided into a plurality of sub-attack periods.
5. The method according to claim 1, characterized in that Determining the challenge black hole attack detection result of the target page according to the number of visits in each sub-attack period includes: Obtaining a visit volume threshold of the target page for the attack period; Selecting a sub-attack period whose visit volume reaches the visit volume threshold from among the multiple sub-attack period as a primary selection period; According to the preliminary selection period, a challenge black hole attack detection result of the target page is determined.
6. The method according to claim 5, characterized in that The obtaining of the access volume threshold of the target page for the attack period includes: An average value of the visit volumes in the multiple sub-attack time periods is calculated as the visit volume threshold.
7. The method according to claim 5, characterized in that The preliminary selection time period includes multiple time periods; and determining the challenge black hole attack detection result of the target page according to the preliminary selection time period includes: Obtaining the earliest primary selection period among the multiple primary selection periods as the starting period; Obtaining the latest primary election period among the multiple primary election periods as the termination period; According to the visit volumes of each of the multiple preliminary selection time periods, continuity fitting processing is performed on the visit volumes of the preliminary selection time periods between the start time period and the end time period to obtain the challenge black hole attack detection result of the target page.
8. A detection device for challenging a black hole attack, characterized in that: The device comprises: An acquisition module, used to acquire characteristic data of each of a plurality of target time periods, wherein the characteristic data of each target time period represents the access situation of the target page in the target time period; A model detection module, used to input the characteristic data of each target period into a target detection model to obtain a model detection result of each target period, wherein the model detection result of each target period indicates whether a challenge black hole attack occurs to the target page in the target period; A time period determination module, used to determine a plurality of sub-attack time periods according to an attack time period, wherein the attack time period refers to a target time period in which a challenge black hole attack occurs as a result of a model detection; The result determination module is used to determine the challenge black hole attack detection result of the target page according to the number of visits in each sub-attack period.
9. An electronic device, characterized in that: include: one or more processors; Memory; One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs being configured to execute the method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 7.
