Automatic testing method and device for ICMP-Flood, automatic computer and medium

By using paramiko and scapy modules to automatically connect and test the equipment under test, the problem of long-term network configuration in traditional testing methods is solved, and fast and efficient ICMP-Flood testing is achieved.

CN119449679APending Publication Date: 2025-02-14SHENZHEN FENGRUNDA TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411509814.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

Traditional testing methods require complex network configuration before testing, which makes the test take a long time.

Method used

The device under test is connected through the paramiko module of the python library, the security filtering function is enabled, and the ICMP request package and ARP response package are constructed using the scapy module. The automated test results are determined by the device response results.

Benefits of technology

The construction of the ICMP-Flood test environment is simplified, and the testing efficiency is improved through automated testing and reduced testing time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119449679A_ABST
    Figure CN119449679A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic testing method and device for ICMP-Flood, an automatic computer and a medium, and relates to the technical field of automatic testing, and the method comprises the steps: connecting a tested device through a paramiko module of a python library, and issuing a command to the tested device to enable the tested device to start a safety filtering function; an scapy module of the python library is used for constructing an ICMP request packet and an ARP response packet, an automatic test result is determined according to the response result of the tested device for the ICMP request packet and the ARP response packet, the ICMP request packet is composed of a new mac address and a new ip address, and the ARP response packet is composed of an automatic computer mac address, an automatic computer ip address and response content. The test efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of automated testing technology, and in particular to an automated testing method, device, automated computer and medium for ICMP-Flood. Background Art

[0002] In the current technical field, the testing of network devices such as routers and gateways mainly relies on manual operation or other auxiliary equipment. Traditional testing methods usually involve using multiple computers to simulate different network environments to evaluate the performance and stability of the device, but this method requires complex networking configuration before testing, which will make the test time-consuming.

[0003] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0004] The main purpose of this application is to provide an automated testing method, device, automated computer and medium for ICMP-Flood, aiming to solve the technical problem that the traditional testing method requires complex network configuration before testing, resulting in a long testing time.

[0005] To achieve the above objectives, the present application proposes an automated testing method for ICMP-Flood, the automated testing method for ICMP-Flood comprising:

[0006] Connect the device under test through the paramiko module of the python library, and send a command to the device under test to enable the security filtering function of the device under test;

[0007] The scapy module of the python library is used to construct ICMP request packets and ARP reply packets to determine the automated test results according to the response results of the tested device to the ICMP request packets and ARP reply packets, wherein the ICMP request packet consists of a new MAC address and a new IP address, and the ARP reply packet consists of an automated computer MAC address, an automated computer IP address, and a response content.

[0008] In one embodiment, the step of constructing an ICMP request packet and an ARP reply packet using the scapy module of the python library to determine the automated test result according to the response result of the device under test to the ICMP request packet and the ARP reply packet includes:

[0009] Construct an ICMP request packet using the scapy module of the python library, and send the ICMP request packet to the device under test;

[0010] After receiving the ARP query packet of the device under test for the ICMP request packet, constructing an ARP reply packet using the scapy module of the python library;

[0011] The ARP reply packet is sent to the device under test, and an automated test result is determined according to a response result of the device under test to the ICMP request packet.

[0012] In one embodiment, the step of sending the ARP reply packet to the device under test and determining the automated test result according to the response result of the device under test to the ICMP request packet includes:

[0013] After sending the ARP reply packet to the device under test, the response packet of the device under test is captured at the wired network port through the scapy module of the python library;

[0014] The response result of the tested device to the ICMP request packet is determined according to the captured result, and the automated test result is determined according to the response result.

[0015] In one embodiment, the step of determining the response result of the device under test to the ICMP request packet according to the capture result, and determining the automated test result according to the response result includes:

[0016] Determine whether a response packet of the device under test to the ICMP request packet is captured according to the capture result;

[0017] When it is determined according to the capture result that a response packet of the tested device to the ICMP request packet is captured, the automated test result is determined to be a test failure.

[0018] In one embodiment, the step of determining the response result of the device under test to the ICMP request packet according to the capture result, and determining the automated test result according to the response result includes:

[0019] Determine whether a response packet of the device under test to the ICMP request packet is captured according to the capture result;

[0020] When it is determined according to the capture result that the response packet of the tested device to the ICMP request packet is not captured, the automated test result is determined to be a test pass.

[0021] In one embodiment, the step of constructing an ICMP request packet and an ARP reply packet using the scapy module of the python library to determine the automated test result according to the response result of the device under test to the ICMP request packet and the ARP reply packet includes:

[0022] The threading module of the Python library is used to run multiple test processes simultaneously, and different ICMP request packets and ARP reply packets are constructed in each test process to perform automated testing on the device under test, so as to determine the automated test results according to the response results of the device under test to different ICMP request packets and ARP reply packets.

[0023] In one embodiment, the method further comprises:

[0024] The automated test results are written into a record table using the openyxl module of the python library.

[0025] In addition, to achieve the above-mentioned purpose, the present application also proposes an automated testing device for ICMP-Flood, wherein the automated testing device for ICMP-Flood comprises:

[0026] The sending module is used to connect to the device under test through the paramiko module of the python library and send a command to the device under test to enable the security filtering function of the device under test;

[0027] A construction module is used to construct ICMP request packets and ARP reply packets using the scapy module of the python library, so as to determine the automated test results according to the response results of the tested device to the ICMP request packets and the ARP reply packets, wherein the ICMP request packet consists of a new MAC address and a new IP address, and the ARP reply packet consists of an automated computer MAC address, an automated computer IP address and a response content.

[0028] In addition, to achieve the above-mentioned purpose, the present application also proposes an automated testing device for ICMP-Flood, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the automated testing method for ICMP-Flood as described above.

[0029] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the automated testing method for ICMP-Flood as described above are implemented.

[0030] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the automated testing method for ICMP-Flood as described above are implemented.

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

[0032] The present application proposes an automated testing method, device, automated computer and medium for ICMP-Flood, connects the device under test through the paramiko module of the python library, and issues a command to the device under test to enable the security filtering function of the device under test; constructs ICMP request packets and ARP reply packets using the scapy module of the python library, so as to determine the automated testing results according to the response results of the device under test to the ICMP request packets and the ARP reply packets, wherein the ICMP request packet consists of a new MAC address and a new IP address, and the ARP reply packet consists of an automated computer MAC address, an automated computer IP address and a response content, thereby solving the technical problem that the traditional testing method requires complex networking configuration before the test, resulting in a long test time. Compared with the prior art, the present application adopts a simple networking method to connect the devices under test respectively, which greatly simplifies the construction of the ICMP-Flood test environment, and performs testing in an automated manner, thereby improving the test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

[0035] Figure 1 A flowchart of the first embodiment of the automated testing method for ICMP-Flood provided in this application;

[0036] Figure 2 A schematic diagram of an automated computer connected to a device under test provided in Example 1 of the automated test method for ICMP-Flood of the present application;

[0037] Figure 3 A schematic diagram of two packages constructed by an automated computer provided in Embodiment 1 of the automated testing method for ICMP-Flood of this application;

[0038] Figure 4 A schematic diagram of a device under test sending an ARP query packet according to Embodiment 1 of the automated test method for ICMP-Flood provided in the present application;

[0039] Figure 5 A schematic diagram of an automated computer sending an ARP reply packet provided in Embodiment 1 of the automated testing method for ICMP-Flood of the present application;

[0040] Figure 6 A schematic diagram of the response of the device under test provided in Embodiment 1 of the automated testing method for ICMP-Flood of this application;

[0041] Figure 7 A flow chart of the second embodiment of the automated testing method for ICMP-Flood provided in this application;

[0042] Figure 8 This is a schematic diagram of the module structure of an automated test device for ICMP-Flood according to an embodiment of the present application;

[0043] Fig. 9 This is a schematic diagram of the device structure of the hardware operating environment involved in the automated testing method for ICMP-Flood in the embodiment of the present application.

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

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

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

[0047] The main solution of the embodiment of the present application is: connecting the device under test through the paramiko module of the python library, and issuing a command to the device under test to enable the security filtering function of the device under test; using the scapy module of the python library to construct ICMP request packets and ARP reply packets, so as to determine the automated test results according to the response results of the device under test to the ICMP request packets and ARP reply packets, wherein the ICMP request packet consists of a new MAC address and a new IP address, and the ARP reply packet consists of an automated computer MAC address, an automated computer IP address and a response content.

[0048] It can be seen from the above embodiments that the present application connects the device under test through the paramiko module of the python library, and issues a command to the device under test to enable the security filtering function of the device under test; the scapy module of the python library is used to construct ICMP request packets and ARP reply packets, so as to determine the automated test results according to the response results of the device under test to the ICMP request packets and the ARP reply packets, wherein the ICMP request packet consists of a new MAC address and a new IP address, and the ARP reply packet consists of an automated computer MAC address, an automated computer IP address and a response content, which solves the technical problem that the traditional test method requires responsible networking configuration before the test, resulting in a long test time. Compared with the prior art, the present application adopts a simple networking method to connect the devices under test respectively, which greatly simplifies the construction of the ICMP-Flood test environment, and performs testing in an automated manner, thereby improving the test efficiency.

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

[0050] Based on this, the present application embodiment provides an automated testing method for ICMP-Flood, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the automated testing method for ICMP-Flood of the present application.

[0051] In this embodiment, the automated testing method for ICMP-Flood includes steps S10 to S20:

[0052] Step S10, connecting to the device under test through the paramiko module of the python library, and issuing a command to the device under test to enable the security filtering function of the device under test;

[0053] In the specific implementation, only an automated computer with a single network card is needed to connect to the device under test through a network port to perform automated testing; the automated testing is developed in Python, and the main Python modules used are: paramiko, scapy, openyxl, threading, etc.

[0054] It should be noted that if Figure 2As shown, the paramiko module is a Python library for SSH connection. Through the paramiko module, the automation computer can establish an SSH connection to the DUT (device under test, usually a router). Once the connection is established, the automation computer can send commands to the DUT through the command line interface (CLI) to enable the security filtering function of the device under test.

[0055] Step S20, using the scapy module of the python library to construct ICMP request packets and ARP reply packets, so as to determine the automated test results according to the response results of the tested device to the ICMP request packets and ARP reply packets, wherein the ICMP request packet consists of a new MAC address and a new IP address, and the ARP reply packet consists of an automated computer MAC address, an automated computer IP address and a response content.

[0056] It should be noted that if Figure 3 As shown, the automated computer uses scapy to forge two packets:

[0057] A. ICMP request packet, constructing a brand new MAC address and IP address (i.e. new MAC address and new IP address), called A packet;

[0058] B. ARP reply packet, composed of the MAC address and IP address of the automated computer, plus

[0059] The response content of ARP is called B packet.

[0060] It is understandable that a brand new MAC address and IP address are constructed for the A packet, which should be unique in the network, or at least not the addresses of any existing device; the purpose of constructing the B packet is to provide the forged MAC to IP mapping of the A packet during the ARP request.

[0061] In a feasible implementation manner, the step of constructing ICMP request packets and ARP reply packets using the scapy module of the python library to determine the automated test results according to the response results of the device under test to the ICMP request packets and the ARP reply packets includes: constructing an ICMP request packet using the scapy module of the python library, and sending the ICMP request packet to the device under test; after receiving the ARP query packet from the device under test to the ICMP request packet, constructing an ARP reply packet using the scapy module of the python library; sending the ARP reply packet to the device under test, and determining the automated test results according to the response result of the device under test to the ICMP request packet.

[0062] In the specific implementation, the automation computer sends packet A to the DUT; the DUT does not have the MAC address of packet A in its MAC address table, so it cannot directly forward the packet; Figure 4 As shown, the DUT sends an ARP request (i.e., an ARP query packet) to ask who in the network knows the IP address corresponding to the MAC address of the A packet; since the automation computer is directly connected to the DUT, the MAC address and IP address of the automation computer will be recorded in the ARP table of the DUT, and it is regarded as a trusted device; Figure 5 As shown, the automated computer replies to the ARP request of the DUT, claiming to know the IP address corresponding to the MAC address of the A packet (that is, the automated computer sends an ARP reply packet to the DUT); Figure 6 As shown, the DUT updates the ARP table, records the MAC address and forged IP address of packet A, and attempts to respond to the ICMP request of packet A; finally, the automated test result is determined based on the response result of the DUT to the ICMP request packet.

[0063] In a feasible implementation manner, the step of sending the ARP reply packet to the device under test and determining the automated test result based on the response result of the device under test to the ICMP request packet includes: after sending the ARP reply packet to the device under test, capturing the response packet of the device under test at the wired network port through the scapy module of the python library; determining the response result of the device under test to the ICMP request packet based on the captured result, and determining the automated test result based on the response result.

[0064] It should be noted that the purpose of using scapy to capture packets on the wired network port is to capture the DUT's ICMP reply to packet A, so as to determine whether the DUT's security filtering function is effective.

[0065] In a feasible implementation, the step of determining the response result of the device under test to the ICMP request packet based on the capture result, and determining the automated test result based on the response result includes: judging whether a response packet of the device under test to the ICMP request packet is captured based on the capture result; when it is determined that a response packet of the device under test to the ICMP request packet is captured based on the capture result, determining that the automated test result is a test failure.

[0066] It should be noted that if the DUT responds to every ICMP request packet, it means that the security filtering function of the DUT does not work, so the automated test result can be determined to be a failure.

[0067] In a feasible implementation manner, the step of determining the response result of the device under test to the ICMP request packet based on the capture result, and determining the automated test result based on the response result includes: judging whether the response packet of the device under test to the ICMP request packet is captured based on the capture result; when it is determined based on the capture result that the response packet of the device under test to the ICMP request packet is not captured, determining that the automated test result is a test pass.

[0068] It should be noted that if the DUT does not reply to these forged ICMP request packets, it means that the filtering function may be effective, so the automated test result can be determined as a passed test.

[0069] In a feasible implementation manner, the method further includes:

[0070] The automated test results are written into a record table using the openyxl module of the python library.

[0071] It should be noted that the openpyxl module can be used to write test results to Excel files for subsequent analysis and reporting.

[0072] In the specific implementation, the automated test is developed in Python language. The main Python modules used are: paramiko, scapy, openyxl, threading, etc. The specific steps are as follows:

[0073] 1. The automation computer connects to the DUT device through paramiko, and sends commands to the router through the background to enable the secure icmp-flood filtering function.

[0074] 2. The automated computer uses scapy to forge two packets:

[0075] C. ICMP request packet, constructing a new MAC address and IP address, called A packet;

[0076] D. ARP reply packet, composed of the MAC address and IP address of the automated computer, plus the ARP response content, is called B packet.

[0077] 2.1. Use scapy to forge an A packet and send it to DUT (device under test);

[0078] 2.2. The mac address table of DUT (device under test) does not store the mac address of packet A;

[0079] 2.3. The DUT (device under test) will send an ARP query packet to ask if anyone knows the IP address of the MAC address in the A packet.

[0080] 2.4. Because the automated computer is directly connected to the DUT (device under test), the DUT (device under test) will be recorded in the arp table, indicating that the computer is trusted.

[0081] 2.5. At this time, you can use an automated computer to reply to the DUT (device under test) that the mac of the A package you inquired about does exist, and the ip address is xxx:xxx:xxx:xxx (the B package can forge the mac address at will);

[0082] 2.6. DUT (the router under test) records the mac address and ip address of packet A into the arp address, and responds to the request of packet A with an ICMP reply packet.

[0083] 3. Using this method, we can use threading and run multiple threads at the same time. Using the method in sequence number 2, we can forge packets A and B to send icmp packets to the DUT (device under test) to achieve the effect of icmp-flood.

[0084] 4. The automated computer uses the python library scapy module to capture packets at the wired network port and capture the response packet of the DUT (wireless router) device.

[0085] 5. If a large number of ICMP packets are sent to the DUT (router under test), and the DUT (router under test) replies to each one, it means that filtering is not enabled if it does not reply to ICMP requests.

[0086] 6. If the above expectations are met, the test passes, and the results are written to Excel using openyxl. If any of the expected results are not met, the test fails.

[0087] This embodiment connects the device under test through the paramiko module of the python library, and sends a command to the device under test to enable the security filtering function of the device under test; uses the scapy module of the python library to construct ICMP request packets and ARP reply packets, so as to determine the automated test results according to the response results of the device under test to the ICMP request packets and the ARP reply packets, wherein the ICMP request packet consists of a new MAC address and a new IP address, and the ARP reply packet consists of an automated computer MAC address, an automated computer IP address and a response content, which solves the technical problem that the traditional test method requires a complex networking configuration before the test, resulting in a long test time. Compared with the prior art, the present application adopts a simple networking method to connect the devices under test respectively, which greatly simplifies the construction of the ICMP-Flood test environment, and performs the test in an automated manner, thereby improving the test efficiency.

[0088] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 7 , step S20 includes step S201:

[0089] Step S201, use the threading module of the python library to run multiple test processes simultaneously, and construct different ICMP request packets and ARP reply packets in each test process to perform automated testing on the device under test, so as to determine the automated test results according to the response results of the device under test to different ICMP request packets and ARP reply packets.

[0090] It should be noted that threading can be used to run multiple threads at the same time, forging packets A and B to send icmp packets to the DUT (router under test) to achieve the effect of icmp-flood.

[0091] This embodiment uses the threading module of the python library to run multiple test processes simultaneously, and constructs different ICMP request packets and ARP reply packets in each test process to perform automated testing on the device under test, so as to determine the automated test results according to the response results of the device under test to different ICMP request packets and ARP reply packets. Through multi-threading technology, the automated computer can send a large number of A packets and B packets to the device under test at the same time, simulating the scenario of ICMP flood attack to test whether the security filtering function of the DUT is effective.

[0092] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the automated testing method for ICMP-Flood of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.

[0093] This application also provides an automated test device for ICMP-Flood, please refer to Figure 8 , the automated testing device for ICMP-Flood comprises:

[0094] The sending module is used to connect to the device under test through the paramiko module of the python library and send a command to the device under test to enable the security filtering function of the device under test;

[0095] A construction module is used to construct ICMP request packets and ARP reply packets using the scapy module of the python library, so as to determine the automated test results according to the response results of the tested device to the ICMP request packets and the ARP reply packets, wherein the ICMP request packet consists of a new MAC address and a new IP address, and the ARP reply packet consists of an automated computer MAC address, an automated computer IP address and a response content.

[0096] The automated test device for ICMP-Flood provided by the present application adopts the automated test method for ICMP-Flood in the above embodiment, which can solve the technical problem that the traditional test method requires a complex network configuration before the test, resulting in a long test time. Compared with the prior art, the beneficial effects of the automated test device for ICMP-Flood provided by the present application are the same as the beneficial effects of the automated test method for ICMP-Flood provided by the above embodiment, and other technical features in the automated test device for ICMP-Flood are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0097] The present application provides an automated computer, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the automated testing method for ICMP-Flood in the above-mentioned embodiment one.

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

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

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

[0101] The automated computer provided by the present application adopts the automated testing method for ICMP-Flood in the above embodiment, which can solve the technical problem that the traditional testing method requires a complex network configuration before the test, which results in a long test time. Compared with the prior art, the beneficial effects of the automated computer provided by the present application are the same as the beneficial effects of the automated testing method for ICMP-Flood provided in the above embodiment, and other technical features in the automated computer are the same as the features disclosed in the method of the previous embodiment, which will not be described in detail here.

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

[0103] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0104] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the automated testing method for ICMP-Flood in the above-mentioned embodiment.

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

[0106] The computer-readable storage medium may be included in the automated computer; or may exist independently without being incorporated into the automated computer.

[0107] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by an automated computer, the automated computer: connects to the device under test through the paramiko module of the python library, and sends a command to the device under test to enable the security filtering function of the device under test; constructs ICMP request packets and ARP reply packets using the scapy module of the python library, so as to determine the automated test results according to the response results of the device under test to the ICMP request packets and the ARP reply packets, wherein the ICMP request packet consists of a new MAC address and a new IP address, and the ARP reply packet consists of the automated computer MAC address, the automated computer IP address and the response content.

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

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

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

[0111] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned automated testing method for ICMP-Flood, and can solve the technical problem that the traditional testing method requires a complex network configuration before the test, which results in a long test time. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the automated testing method for ICMP-Flood provided by the above-mentioned embodiment, and will not be elaborated here.

[0112] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned automated testing method for ICMP-Flood when executed by a processor.

[0113] The computer program product provided by the present application can solve the technical problem that the traditional testing method requires complex network configuration before testing, which results in a long testing time. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as those of the automated testing method for ICMP-Flood provided in the above embodiment, and will not be elaborated here.

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

Claims

1. An automated testing method for ICMP-Flood, characterized in that: The automated testing method is applied to an automated computer, and the method comprises: Connect the device under test through the paramiko module of the python library, and send a command to the device under test to enable the security filtering function of the device under test; The scapy module of the python library is used to construct ICMP request packets and ARP reply packets to determine the automated test results according to the response results of the tested device to the ICMP request packets and ARP reply packets, wherein the ICMP request packet consists of a new MAC address and a new IP address, and the ARP reply packet consists of an automated computer MAC address, an automated computer IP address, and a response content.

2. The method according to claim 1, characterized in that The step of constructing an ICMP request packet and an ARP reply packet by using the scapy module of the python library to determine the automated test result according to the response result of the device under test to the ICMP request packet and the ARP reply packet comprises: Construct an ICMP request packet using the scapy module of the python library, and send the ICMP request packet to the device under test; After receiving the ARP query packet of the device under test for the ICMP request packet, constructing an ARP reply packet using the scapy module of the python library; The ARP reply packet is sent to the device under test, and an automated test result is determined according to a response result of the device under test to the ICMP request packet.

3. The method according to claim 2, characterized in that The step of sending the ARP reply packet to the device under test and determining the automated test result according to the response result of the device under test to the ICMP request packet comprises: After sending the ARP reply packet to the device under test, the response packet of the device under test is captured at the wired network port through the scapy module of the python library; The response result of the tested device to the ICMP request packet is determined according to the captured result, and the automated test result is determined according to the response result.

4. The method according to claim 3, characterized in that The step of determining the response result of the device under test to the ICMP request packet according to the captured result, and determining the automated test result according to the response result comprises: Determine whether a response packet of the device under test to the ICMP request packet is captured according to the capture result; When it is determined according to the capture result that a response packet of the tested device to the ICMP request packet is captured, the automated test result is determined to be a test failure.

5. The method according to claim 3, characterized in that The step of determining the response result of the device under test to the ICMP request packet according to the captured result, and determining the automated test result according to the response result comprises: Determine whether a response packet of the device under test to the ICMP request packet is captured according to the capture result; When it is determined according to the capture result that the response packet of the tested device to the ICMP request packet is not captured, the automated test result is determined to be a test pass.

6. The method according to claim 1, characterized in that The step of constructing an ICMP request packet and an ARP reply packet by using the scapy module of the python library to determine the automated test result according to the response result of the device under test to the ICMP request packet and the ARP reply packet comprises: The threading module of the Python library is used to run multiple test processes simultaneously, and different ICMP request packets and ARP reply packets are constructed in each test process to perform automated testing on the device under test, so as to determine the automated test results according to the response results of the device under test to different ICMP request packets and ARP reply packets.

7. The method according to claim 1, characterized in that The method further comprises: The automated test results are written into a record table using the openyxl module of the python library.

8. An automated testing device for ICMP-Flood, characterized in that: The device comprises: The sending module is used to connect to the device under test through the paramiko module of the python library and send a command to the device under test to enable the security filtering function of the device under test; A construction module is used to construct ICMP request packets and ARP reply packets using the scapy module of the python library, so as to determine the automated test results according to the response results of the tested device to the ICMP request packets and the ARP reply packets, wherein the ICMP request packet consists of a new MAC address and a new IP address, and the ARP reply packet consists of an automated computer MAC address, an automated computer IP address and a response content.

9. An automated computer, characterized in that The automated computer comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the automated testing method for ICMP-Flood as claimed in any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the automated testing method for ICMP-Flood as described in any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Automatic test method and device for network address translation, equipment and storage medium

    CN120729830A