Detection and tracing method for denial of firewall attack

By constructing a deny firewall attack model and using Renyi entropy to calculate information distance, combined with packet marking and path reconstruction technology, the problem of difficulty in detecting and tracing the source of deny firewall attacks in the existing technology is solved, achieving efficient attack detection and traceability, and reducing System overhead and deployment costs are eliminated.

CN118540140APending Publication Date: 2024-08-23CIVIL AVIATION UNIV OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410728735.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-06
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Existing technologies are difficult to effectively detect and trace back firewall attacks, especially DDoS attacks, which lead to firewall paralysis and affect network performance and service continuity.

Method used

By building a denial firewall attack model, Renyi entropy is used to calculate the information distance between background traffic and attacked traffic, and combined with packet marking and path reconstruction technology, attack detection and source tracing are achieved.

Benefits of technology

It improves the attack detection rate, achieves efficient detection and source tracing of denial of firewall attacks, reduces system overhead and deployment costs, and can accurately identify and track attackers when attacks occur.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118540140A
    Figure CN118540140A
Patent Text Reader

Abstract

The invention provides a firewall attack denial detection and traceability method. The method comprises the following steps: constructing a firewall attack denial model; according to the constructed firewall attack rejection model, comparing the probability distribution of the background traffic with the traffic distribution during attack, and judging whether DoF attack exists or not by calculating the information distance between the background traffic and the attacked traffic; an attack traceability model is constructed on the basis of attack detection, and attack traceability is realized through data packet marking, traceability and path reconstruction. According to the method, firewall attack denial detection and traceability are realized from three aspects of attack optimization, attack detection and attack traceability, experimental results show that the method provided by the invention shows a relatively high detection rate in the aspect of attack detection, attack traceability can be performed through path reconstruction when the attack is initiated, and the detection efficiency is improved. And meanwhile, the system overhead and the deployment cost are lower.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of network security, and in particular relates to a method for detecting and tracing attacks on a firewall. Background Art

[0002] A firewall is a network security system located at the boundary of internal and external networks. Its core functions include regional isolation, access control, attack protection, and redundant design. However, firewalls also face many security challenges. Among them, DDoS attacks against firewalls are called denial of service (DoF) attacks. The BlackaNurse attack is a typical DoF attack. It is not only cheap to launch, but also has a significant impact on individuals, enterprises, and governments around the world. This not only causes economic losses, but also threatens information security and service continuity, prompting relevant parties to continue to seek more effective defense strategies and technologies. Even when using relatively few bandwidth resources, this attack can cause consequences to the target, including network performance degradation, service interruption, and in some cases, complete service unavailability. Studying the mechanism and countermeasures of DoF attacks has become an important challenge in the field of network security.

[0003] In recent years, distributed denial of service (DDoS) attacks have been widely recognized as one of the major security threats in the Internet field. Such attacks not only cause serious damage to network infrastructure, making it impossible for legitimate users to get effective responses to normal requests, but also have a negative impact on the country and society that cannot be ignored. Although firewalls play a key role in protecting networks and services, firewalls themselves are also easily targeted by DDoS attacks, which are called denial of service firewall attacks (DoF). DoF attacks abuse firewall resources to overload them, causing firewalls to fail and thus affecting the operation of the entire system. Attackers can flood firewalls with redundant data packets by sending a large amount of malicious traffic. In addition, attackers can also cause more lasting effects on firewalls by sending a small number of specially crafted malicious data packets. The existing DoF attacks can be divided into two categories: one is DoF attacks targeting the firewall rule base, and the other is DoF attacks targeting the firewall session table. The common purpose of these two attack methods is to make the firewall add new session entries until the session table is filled, so that the processing results of legitimate user requests cannot be added to the session table. This will cause the firewall to start discarding new connection requests, thereby infringing the rights and interests of legitimate users. In 2016, Danish cybersecurity company TDC Security Labs discovered a special type of ICMP attack, named BlackNurse attack, which is a typical DoF attack. This attack exploits a vulnerability in the ICMP protocol and sends a small amount of low-bandwidth ICMP traffic to the target system, exhausting the session table resources of the target firewall, resulting in the inability to respond to legitimate users' requests. According to TDC Security Labs, an ordinary computer can paralyze the target server by launching an attack. In order to improve network security and ensure that the network resources of legitimate users are not violated, it is of great significance to study the detection method of DoF attacks. Summary of the invention

[0004] In view of this, the present invention aims to overcome the deficiencies of the above-mentioned problems in the prior art and proposes a method for detecting and tracing firewall attacks.

[0005] To achieve the above object, the technical solution of the present invention is achieved as follows:

[0006] A first aspect of the present invention provides a method for detecting and tracing a firewall attack, comprising the following steps:

[0007] Step 1: Build a firewall attack rejection model;

[0008] Step 2: Based on the firewall attack rejection model constructed in step 1, the probability distribution of background traffic is compared with the traffic distribution during the attack, and the information distance between the background traffic and the attacked traffic is calculated to determine whether there is a DoF attack;

[0009] Step 3: Based on attack detection, attack source tracing is performed through packet marking, source tracing, and path reconstruction.

[0010] Furthermore, in step 1, building a firewall attack rejection model includes:

[0011] Define a function to generate a random IP address from 1.0.0.0 to 225.255.255.255;

[0012] Set the IP address of the target to be attacked;

[0013] Call the function that generates a random IP address and use it to set the source IP address of the attacker;

[0014] Randomly generate an integer between 900 and 901 as the size of the attack packet;

[0015] Use the hping3 tool to launch an attack. The specific attack command settings are as follows: hping_command = ["hping3","-1","-C","3","-K","3","-i","u20","--rand-source","--data",f"{packet_size}",target_ip];

[0016] The parameters are:

[0017] hping3: call the hping3 tool;

[0018] -1: specifies that the type of data packet sent is ICMP;

[0019] -C 3: Set the type of ICMP data packet sent to 3;

[0020] -K 3: Set the sent ICMP packet code to 3;

[0021] -i u20: Set the packet sending rate to one every 20 microseconds;

[0022] --rand-source: Randomly select the source attack packet address;

[0023] --data: Set the attack data packet size to packet_size;

[0024] -target_ip: specifies the target IP address.

[0025] Furthermore, the step 2 specifically includes:

[0026] The background traffic is sampled and the probability statistics of the sampled traffic are recorded as P = (p1, p2, ... p n ), P represents the probability distribution of background traffic;

[0027] The link between the firewall and its nearest hop router is sampled, and the sampled traffic is statistically analyzed. The probability distribution of all sampled traffic on the link is calculated, including the data packet length and source IP, which is recorded as Q = (q1, q2, ... q n ), Q represents the probability distribution of mixed traffic;

[0028] Calculate the information distance between background traffic and mixed traffic, and compare the obtained information distance with the pre-set threshold. If the calculated value is greater than the set threshold, it means that the system has detected attack traffic and randomly triggers an attack warning. If the calculated value is less than the set threshold, it means that the system has not found an attack and will return to the traffic sampling state to continue detection.

[0029] Furthermore, the information divergence expression of Renyi entropy between the probability distribution P of background traffic and the probability distribution Q of mixed traffic is as follows:

[0030]

[0031] The information distance is defined as follows:

[0032]

[0033] Furthermore, in step 3, the data packet marking includes:

[0034] The probability-based packet marking method is adopted, which makes full use of the non-participation nature of the routing device to perform probabilistic marking multiple times through multiple devices, and adds a special field to the packet header, where 'Distance' represents the distance between the node and the current router, 'edge' is the address hash value of the storage operation, and p is the set threshold;

[0035] Call bit interleaving and hash functions to generate a highly random and unpredictable data R';

[0036] Calculate the number of non-overlapping segments k to determine the number of non-overlapping fragments the packet is split into. Non-overlapping means that each fragment only appears in a specific position in the packet, rather than overlapping other fragments;

[0037] Store tagged packets;

[0038] Traverse all packets;

[0039] Generate a random number x in the range of 0 to 1;

[0040] If x>p, when the generated random number is greater than the threshold, the data packet is marked;

[0041] Assign o a random number from 0 to k-1 for subsequent random selection of offset segments;

[0042] The generated R' is inserted into the segment at a specific offset of the data packet according to the value of o;

[0043] Write segment information into data packets;

[0044] If the packet information distance is 0, the segment and R' information are obtained at the packet fragment offset;

[0045] Differentiate the data packets by their current segments and update the information distance of the data packets;

[0046] Returns the marked packet.

[0047] Furthermore, in step 3, tracing the source includes:

[0048] Define probability thresholds for probabilistic labeling;

[0049] If the random number generated by the system is greater than the set threshold, the data packet is marked, otherwise, it is not marked;

[0050] For the marked data packet, the Distance value is recorded as 0, and the Edge value in the data packet is XORed with the IP of the current router, and the data packet is updated;

[0051] Forward the data packet. If the next hop is marked with a distance value plus 1, repeat the previous step.

[0052] Iterates over the frames in the specified range. For each frame, it checks if there is an IP header, then extracts the identification field and prints the relevant information;

[0053] A program to convert the hash value back to an IP address, using Python's hashlib module to calculate the hash value;

[0054] The IP addresses are classified according to the distance value, and the IP address with the largest probability value in each group is extracted for path reconstruction.

[0055] Furthermore, in step 3, the routing reconstruction includes:

[0056] The enumeration function iterates over the packet list and returns the index and value of the packet;

[0057] Let i be the value of the returned data packet. If the start frame <= i <= end frame, check whether there is an IP header in the data packet.

[0058] Extract the identification field of the IP header;

[0059] Extract the contents of the identification field, distance and edge of the IP header from the specified number of frames;

[0060] Output all IP address information and determine the IP address with the highest probability of appearing based on the Distance value;

[0061] Perform XOR operations step by step to deduce the address of the potential attacker.

[0062] A second aspect of the present invention provides a firewall attack detection and tracing system, comprising:

[0063] Model building module, used to build a denial firewall attack model;

[0064] An attack judgment module is used to compare the probability distribution of background traffic with the traffic distribution during the attack based on the denial firewall attack model constructed by the model construction module, and to judge whether there is a DoF attack by calculating the information distance between the background traffic and the attacked traffic;

[0065] The attack source tracing module is used to achieve attack source tracing through packet marking, tracing and path reconstruction based on attack detection.

[0066] A third aspect of the present invention provides a computer device, comprising: a processor and a memory communicatively connected to the processor;

[0067] The memory stores a computer program;

[0068] The processor executes the computer program stored in the memory to implement the above-mentioned firewall attack detection and tracing method.

[0069] A fourth aspect of the present invention provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, it is used to implement the above-mentioned firewall attack detection and tracing method.

[0070] A fifth aspect of the present invention provides a computer program product, including a computer program, which, when executed by a processor, implements the above-mentioned firewall attack detection and tracing method.

[0071] Compared with the prior art, the method for detecting and tracing a denial-of-firewall attack described in the present invention has the following advantages:

[0072] The present invention realizes the detection and tracing of denial firewall attacks from three aspects: attack optimization, attack detection and attack tracing. Experimental results show that the method proposed in the present invention shows a high detection rate in attack detection, can trace the attack source through path reconstruction when the attack is launched, and has lower system overhead and deployment cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:

[0074] Figure 1 A schematic diagram of a firewall attack rejection mechanism in an embodiment of the present invention;

[0075] Figure 2 It is an experimental topology diagram in an embodiment of the present invention;

[0076] Figure 3 is a detection flow chart in an embodiment of the present invention;

[0077] Figure 4 Schematic diagram of probability distribution of packet lengths of background traffic and mixed traffic in an embodiment of the present invention;

[0078] Figure 5 It is a schematic diagram of entropy values ​​of background traffic and mixed traffic for DOF attack detection based on data packet length in an embodiment of the present invention;

[0079] Figure 6 is a schematic diagram of training data in an embodiment of the present invention;

[0080] Figure 7 It is a schematic diagram of experimental data in an embodiment of the present invention;

[0081] Figure 8 Schematic diagram of the probability density of source IP distribution of background traffic and mixed traffic in an embodiment of the present invention;

[0082] Fig. 9 It is the entropy value of the background traffic and mixed traffic for the DOF attack detection based on the source IP in the embodiment of the present invention;

[0083] Fig.10 A schematic diagram of a threshold training method based on source IP distribution in an embodiment of the present invention;

[0084] Fig.11 It is a schematic diagram of experimental results in an embodiment of the present invention;

[0085] Fig.12 The figure is a schematic diagram of the attack tracing process of the present invention. DETAILED DESCRIPTION

[0086] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.

[0087] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and the like are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first", "second", and the like may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "multiple" means two or more.

[0088] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood by specific circumstances.

[0089] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0090] Embodiment 1:

[0091] The present invention provides a method for detecting and tracing a firewall attack, comprising the following steps:

[0092] Step 1: Build a firewall attack rejection model;

[0093] Step 2: Based on this model, a DoF attack detection method based on Renyi entropy is proposed, and the two features of packet length and random source IP address are used to detect this attack;

[0094] Step 3: Based on attack detection, an attack tracing method is proposed, which includes probability-based packet marking and path reconstruction technology.

[0095] In step 1, firewalls can be mainly divided into two types: packet filtering firewalls and stateful inspection firewalls. Among them, DoF attack is an attack method against network firewalls. This type of attack aims to weaken or bypass the protection of the firewall so that the attacker can further invade the target network or bypass security measures. The targets of the attack are mainly the rule base of the firewall or the session table of the firewall. The models of the two attack methods are as follows Figure 1 shown.

[0096] The tool for launching the attack can use Hping 3. The present invention constructs a firewall attack rejection model. The specific steps are as follows:

[0097] 1. Define a function to generate a random IP address from 1.0.0.0 to 225.255.255.255;

[0098] 2. Set the IP address of the target to be attacked;

[0099] 3. Call the function that generates a random IP address and use it to set the source IP address of the attacker;

[0100] 4. Randomly generate an integer between 900 and 901 as the size of the attack packet;

[0101] 5. Use the hping3 tool to launch an attack. The specific attack command needs to be set as follows: hping_command = ["hping3","-1","-C","3","-K","3","-i","u20","--rand-source","--data",f"{packet_size}",target_ip];

[0102] The parameters are: hping3: call the hping3 tool;

[0103] -1: specifies that the type of data packet sent is ICMP;

[0104] -C 3: Set the type of ICMP data packet sent to 3;

[0105] -K 3: Set the sent ICMP packet code to 3;

[0106] -i u20: Set the packet sending rate to one packet every 20 microseconds, that is, 50,000 packets per second;

[0107] --rand-source: Randomly select the source attack packet address (hping3 command has its own source address random generation function);

[0108] --data: Set the attack data packet size to packet_size;

[0109] -target_ip: specifies the target IP address.

[0110] In step 2, DOF attacks usually cause imbalance in network traffic, making the network traffic distribution unbalanced. Rényi entropy is an extension of Shannon entropy, which aims to provide more information about probability distribution and introduces a parameter that determines how entropy is calculated. The Renyi entropy with order α is defined as follows:

[0111]

[0112] In Renyi entropy, when α>1, for high probability events, the performance of generalized entropy is better than Shannon entropy. When α<1, for low probability events, the performance of generalized entropy is better than Shannon entropy. In the process of DoF attack detection, we adjust the value of α in generalized information entropy to obtain better detection effect.

[0113] In the detection of DoF attacks, the traffic distribution caused by DoF attacks is quite different and has obvious deviations compared with background traffic. The probability distribution of background traffic can be compared with the traffic distribution during the attack. By calculating the information distance between background traffic and attacked traffic, it is possible to determine whether a DoF attack exists.

[0114] Assume that P represents the probability distribution of background traffic and Q represents the probability distribution of mixed traffic. Both P and Q belong to the discrete total probability distribution, where P = (p1, p2, ... p n ), Q=(q1,q2,......q n ),and i={1,2,......n}. Where 0≤p i ≤1,0≤q i ≤1. Then the information divergence expression of Renyi entropy between P and Q is as follows:

[0115]

[0116] The information divergence expression of Tsallis entropy between P and Q is as follows:

[0117]

[0118] In order to more intuitively express the difference between background traffic and traffic under attack, we introduce information distance, which is defined as follows:

[0119]

[0120] According to the Renyi entropy method, the packet length and source IP address of DoF attack are used as the main detection features and substituted into the information entropy formula for detection analysis. The flow chart of the detection algorithm is shown in the figure below. Figure 3 shown.

[0121] like Figure 3 As shown, the background traffic is first sampled, and the sampled traffic is subjected to probability statistics, which is recorded as P = (p1, p2, ... p n Then, we sample the link between the firewall and its nearest router and collect statistics on the sampled traffic. We calculate the probability distribution of all sampled traffic on the link (including data packet length and source IP), which is recorded as Q = (q1, q2, ... q n ). Then calculate the information distance between the background traffic and the mixed traffic. Compare the obtained information distance with the preset threshold. If the calculated value is greater than the set threshold, it means that the system has detected attack traffic and randomly triggers an attack warning. On the contrary, if the calculated value is less than the set threshold, it means that the system has not found an attack and will return to the traffic sampling state to continue detection.

[0122] The experimental results of the detection method are shown below.

[0123] (1) Experimental environment:

[0124] The experiment was completed in VMware Workstation environment. The experimental platform was GNS3 and GNS3 VM. The attacker used Kali virtual machine and used Hping3 to launch the attack. The background traffic used in the experiment came from the CIC-IDS2017 Monday background traffic data set. The experimental topology diagram is shown in the figure below. Figure 2 shown.

[0125] (2) Analysis of DOF attack detection results based on data packet length

[0126] Figure 4 The probability density distribution of the data packet length of background traffic (CIC-IDS2017) and mixed traffic (including attack traffic and background traffic) is shown. The attackers in LAN 1 and LAN 2 adopt a polling attack strategy. Based on the above statistical information, the entropy values ​​of background traffic and mixed traffic are calculated respectively, and the value of parameter α is adjusted. The calculation results are shown in Figure 5 shown.

[0127] pass Figure 5 The analysis shows that the entropy value of the mixed flow is significantly greater than that of the background flow, which indicates that the mixed flow is more disordered than the background flow. In addition, as the parameter α increases, the entropy value decreases.

[0128] In order to achieve effective detection, it is particularly important to set the threshold reasonably. Therefore, we continuously adjusted the attack parameters and measured the information distance of the detection method based on the data packet length under different attack conditions. We conducted a total of 200 attack processes as training data. It included 6 attack methods under extreme conditions, that is, the data packet length of all attack traffic was the same. Figure 6 The information distances of background traffic and mixed traffic under all attack conditions are shown (α=2).

[0129] After obtaining the training data, we found through analysis that in most cases, the information distance between background traffic and mixed traffic is distributed between 4 and 6. The minimum value is 1.9371. We set 10% of the minimum value as the tolerance interval, denoted as θ, and the calculation formula of the threshold σ is as follows:

[0130] σ=D min (P,Q)-θ

[0131] Therefore, in this attack scenario, we set the threshold to 1.7434. To verify the effectiveness of the detection method, we conducted 50 system attacks and calculated the system information distance under each attack scenario. The specific experimental results are as follows: Figure 7 shown.

[0132] According to the experimental results, the information distance of 49 out of 50 attacks exceeded the set threshold, thus triggering an attack warning. Therefore, the detection method based on data packet length showed an accuracy of 98%. It was further pointed out that if the training sample size is large enough, the detection accuracy is expected to reach 100%. Therefore, we concluded that this detection algorithm is reliable and effective.

[0133] (3) Analysis of DOF attack detection results based on source IP

[0134] When a distributed denial of service attack occurs, the distribution of attack traffic usually shows a more disordered characteristic than background traffic. The present invention adopts the method of bringing the source IP distribution into Renyi entropy for detection. Fig. 9 The probability density distribution of source IPs of background traffic and mixed traffic is shown.

[0135] The detection method based on source IP distribution ensures that the experimental scenario is consistent with the previous one. Based on the above statistical results, we further calculated the entropy value under different parameters α. The specific results are shown in Fig. 9 .

[0136] The results show that the detection method based on source IP distribution. Under the same parameter conditions, the mixed traffic also has a larger entropy value than the background traffic and appears more disordered. Under the same experimental environment, the threshold of the detection method based on source IP distribution was trained. We launched 200 attacks on the system and captured the traffic in the data link through Wireshark during each attack. Subsequently, all traffic within the sampling interval was statistically analyzed to derive the information distance of the source IP distribution detection algorithm. By calculating the information distance, the results are as follows Fig.10 As shown:

[0137] After threshold training, the minimum information distance obtained during this training process is 3.0063. Substituting this value into the formula, the threshold is calculated to be 2.7057. To verify the effectiveness of the detection algorithm based on source IP distribution, we changed the attack method and attacked the system 50 times. The experimental results are shown in the figure. Fig.11 As shown:

[0138] The experimental results were compared and analyzed in detail with the pre-set threshold. The results show that under all attack conditions, the information distance exceeds the set threshold, indicating that the proposed detection algorithm can achieve 100% detection accuracy under different attack scenarios, showing excellent detection results.

[0139] In step 3, when encountering a network attack, a key challenge faced by the victim is that it is impossible to determine the true identity and location of the attacker, mainly because the source IP address of the data packet can be forged. To solve this problem, we designed an attack tracing solution. It aims to trace the network attacker without relying on the source IP address. The solution consists of two parts: packet marking and path reconstruction. The flowchart of the attack tracing model is shown below. Fig.12 As shown:

[0140] (1) First, a probability-based packet marking method is adopted, which makes full use of the non-participation nature of routing devices to perform probabilistic marking multiple times through multiple devices, and adds special fields to the packet header. Among them, 'Distance' represents the distance between the node and the current router, 'edge' is the address hash value of the storage operation, and p is the set threshold.

[0141] 1. Call bit interleaving and hash functions to generate a highly random and unpredictable data R';

[0142] 2. Calculate the number of non-overlapping segments k to determine the number of non-overlapping fragments the packet is divided into. Non-overlapping means that each fragment only appears in a specific position in the packet, rather than overlapping other fragments;

[0143] 3. Store the labeled data packets;

[0144] 4. Traverse all data packets;

[0145] 5. Generate 12 random numbers x ranging from 0 to 1;

[0146] 6. If x>p, when the generated random number is greater than the threshold, the data packet is marked;

[0147] 7. Assign o a random number from 0 to k-1 for subsequent random selection of offset segments;

[0148] 8. The generated R' is inserted into the segment at a specific offset of the data packet according to the value of o;

[0149] 9. Write the segment information into the data packet;

[0150] 10. If the packet information distance is 0, get the segment and R' information at the packet fragment offset;

[0151] 11. Differentiate the data packets by their current segments and update the information distance of the data packets;

[0152] 12. Return the marked data packet.

[0153] In this algorithm, a fragment at a specific offset in R' is selected by generating a random number o. This random selection process further increases the randomness of the marking, making it more difficult for attackers to predict and analyze the marking method.

[0154] In the process of calculating k, the number of non-overlapping fragments is taken into account. This means that through the process of probabilistic packet marking, the marked fragments are non-overlapping in R'. Such a design can improve the diversity of marking and prevent attackers from inferring the rules of the marking algorithm by analyzing the marking information of multiple data packets. The algorithm generates a highly random and unpredictable data (R') for use in the subsequent packet marking process. Through bit interleaving and hash functions, the original data is mapped into a form that is not easily cracked by attackers while maintaining its characteristics, which enhances the security of the marking algorithm.

[0155] The generated R' acts as a key intermediate data in the entire marking process, through which the marked fragments are selected, thereby introducing uncertainty and randomness in network communication and improving the confidentiality and security of data transmission.

[0156] (2) The process of tracing back to the source:

[0157] 1. Define the probability threshold for probabilistic labeling;

[0158] 2. If the random number generated by the system is greater than the set threshold, the data packet is marked; otherwise, it is not marked;

[0159] 3. For the marked data packet, the Distance value is recorded as 0. The Edge value in the data packet is XORed with the IP of the current router, and the data packet is updated;

[0160] 4. Forward the data packet. If the next hop is marked with a Distance value plus 1, repeat the previous step;

[0161] 5. Iterates over the frames in the specified range. For each frame, it checks whether the IP header exists, then extracts the identification field and prints the relevant information.

[0162] 6. A program to convert the hash value back to an IP address, using Python's hashlib module to calculate the hash value;

[0163] 7. Classify the IP addresses according to the Distance value, extract the IP address with the largest probability value in each group, and reconstruct the path.

[0164] (3) Path reconstruction

[0165] Path reconstruction is a key step in attack tracing, and its purpose is to track and locate potential attackers. In this stage, parsing suspicious attack packets captured in the path is a crucial step. The specific steps are:

[0166] 1. The enumeration function traverses the data packet list and returns the index and value of the data packet;

[0167] 2. Let i be the value of the returned data packet. If the start frame <= i <= end frame, check whether there is an IP header in the data packet.

[0168] 3. Extract the identification field of the IP header;

[0169] 4. Extract the contents of the identification field, distance and edge of the IP header from the specified number of frames;

[0170] 5. Output all IP address information and determine the IP address with the highest probability of appearing based on the Distance value;

[0171] 6. By performing XOR operations step by step, the address of the potential attacker can be derived.

[0172] Embodiment 2

[0173] A denial of service firewall attack detection and tracing system, comprising:

[0174] Model building module, used to build a denial firewall attack model;

[0175] An attack judgment module is used to compare the probability distribution of background traffic with the traffic distribution during the attack based on the denial firewall attack model constructed by the model construction module, and to judge whether there is a DoF attack by calculating the information distance between the background traffic and the attacked traffic;

[0176] The attack source tracing module is used to achieve attack source tracing through packet marking, tracing and path reconstruction based on attack detection.

[0177] Embodiment three:

[0178] A computer device comprises: a processor and a memory communicatively connected to the processor;

[0179] The memory stores a computer program;

[0180] The processor executes the computer program stored in the memory to implement the above-mentioned firewall attack detection and tracing method.

[0181] Embodiment 4:

[0182] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it is used to implement the above-mentioned firewall attack detection and tracing method.

[0183] Embodiment five:

[0184] A computer program product includes a computer program, and when the computer program is executed by a processor, the computer program implements the above-mentioned firewall attack detection and tracing method.

[0185] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for detecting and tracing a firewall attack, characterized in that: The steps include: Step 1: Build a firewall attack rejection model; Step 2: Based on the firewall attack rejection model constructed in step 1, the probability distribution of background traffic is compared with the traffic distribution during the attack, and the information distance between the background traffic and the attacked traffic is calculated to determine whether there is a DoF attack; Step 3: Based on attack detection, attack source tracing is performed through packet marking, source tracing, and path reconstruction.

2. A method for detecting and tracing a firewall attack according to claim 1, characterized in that: In step 1, building a firewall attack rejection model includes: Define a function to generate a random IP address from 1.0.0.0 to 225.255.255.255; Set the IP address of the target to be attacked; Call the function that generates a random IP address and use it to set the source IP address of the attack initiator; Randomly generate an integer between 900 and 901 as the size of the attack packet; Use the hping3 tool to launch an attack. The specific attack command settings are as follows: hping_command = ["hping3","-1","-C","3","-K","3","-i","u20","--rand-source","--data",f"{packet_size}",target_ip]; The parameters are: hping3: call the hping3 tool; -1: specifies that the type of data packet sent is ICMP; -C 3: Set the type of ICMP data packet sent to 3; -K 3: Set the sent ICMP packet code to 3; -i u20: Set the packet sending rate to one every 20 microseconds; --rand-source: Randomly select the source attack packet address; --data: Set the attack data packet size to packet_size; -target_ip: specifies the target IP address.

3. A method for detecting and tracing a firewall attack according to claim 1, characterized in that: The step 2 specifically includes: The background traffic is sampled and the probability statistics of the sampled traffic are recorded as P = (p1, p2, ... p n ), P represents the probability distribution of background traffic; The link between the firewall and its nearest hop router is sampled, and the sampled traffic is statistically analyzed. The probability distribution of all sampled traffic on the link is calculated, including the data packet length and source IP, which is recorded as Q = (q1, q2, ... q n ), Q represents the probability distribution of mixed traffic; Calculate the information distance between background traffic and mixed traffic, and compare the obtained information distance with the pre-set threshold. If the calculated value is greater than the set threshold, it means that the system has detected attack traffic and randomly triggers an attack warning. If the calculated value is less than the set threshold, it means that the system has not found an attack and will return to the traffic sampling state to continue detection.

4. A method for detecting and tracing a denial-of-firewall attack according to claim 3, characterized in that: The information divergence expression of Renyi entropy between the probability distribution P of background traffic and the probability distribution Q of mixed traffic is as follows: Among them, α is the order; The information distance is defined as follows:

5. A method for detecting and tracing a firewall attack according to claim 1, characterized in that: In step 3, the data packet marking includes: The probability-based packet marking method is adopted, which makes full use of the non-participation nature of the routing device to perform probabilistic marking multiple times through multiple devices, and adds a special field to the packet header, where 'Distance' represents the distance between the node and the current router, 'edge' is the address hash value of the storage operation, and p is the set threshold; Call bit interleaving and hash functions to generate a highly random and unpredictable data R'; Calculate the number of non-overlapping segments k to determine the number of non-overlapping fragments the packet is split into. Non-overlapping means that each fragment only appears at a specific position in the packet and does not overlap other fragments. Store tagged packets; Traverse all packets; Generate a random number x in the range of 0 to 1; If x>p, when the generated random number is greater than the threshold, the data packet is marked; Assign o a random number from 0 to k-1 for subsequent random selection of offset segments; The generated R' is inserted into the segment at a specific offset of the data packet according to the value of o; Write segment information into data packets; If the packet information distance is 0, the segment and R' information are obtained at the packet fragment offset; Differentiate the data packets by their current segments and update the information distance of the data packets; Returns the marked packet.

6. A method for detecting and tracing a firewall attack according to claim 5, characterized in that: In step 3, tracing the source includes: Define probability thresholds for probabilistic labeling; If the random number generated by the system is greater than the set threshold, the data packet is marked, otherwise, it is not marked; For the marked data packet, the Distance value is recorded as 0, and the Edge value in the data packet is XORed with the IP of the current router, and the data packet is updated; Forward the data packet. If the next hop is marked with a distance value plus 1, repeat the previous step. Iterates over the frames in the specified range. For each frame, it checks whether the IP header exists, then extracts the identification field and prints the relevant information. A program to convert the hash value back to an IP address, using Python's hashlib module to calculate the hash value; The IP addresses are classified according to the distance value, and the IP address with the largest probability value in each group is extracted for path reconstruction.

7. A method for detecting and tracing a firewall attack according to claim 6, characterized in that: In step 3, the route reconstruction includes: The enumeration function iterates over the packet list and returns the index and value of the packet; Let i be the value of the returned data packet. If the start frame <= i <= end frame, check whether there is an IP header in the data packet. Extract the identification field of the IP header; Extract the contents of the identification field, distance and edge of the IP header from the specified number of frames; Output all IP address information and determine the IP address with the highest probability of appearing based on the Distance value; Perform XOR operations step by step to deduce the address of the potential attacker.

8. A firewall attack detection and tracing system, characterized by: include: Model building module, used to build a denial firewall attack model; An attack judgment module is used to compare the probability distribution of background traffic with the traffic distribution during the attack based on the denial firewall attack model constructed by the model construction module, and to judge whether there is a DoF attack by calculating the information distance between the background traffic and the attacked traffic; The attack source tracing module is used to achieve attack source tracing through packet marking, tracing and path reconstruction based on attack detection.

9. A computer device comprising: A processor and a memory communicatively connected to the processor; The memory stores a computer program; The processor executes the computer program stored in the memory to implement a method for detecting and tracing a firewall attack as described in any one of claims 1 to 7.

10. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, it is used to implement a method for detecting and tracing a denial firewall attack as described in any one of claims 1 to 5.

11. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method for detecting and tracing a denial-of-firewall attack as claimed in any one of claims 1 to 7 is implemented.