A fuzzy testing and diagnosis system based on custom protocol configuration
Through a fuzz testing and diagnostic system configured based on custom protocols, the problems of low testing efficiency and cumbersome processes in the existing technology are solved, efficient testing processes and diversified exception handling are achieved, and monitoring and vulnerabilities of the test target equipment are enhanced. Positioning ability.
Patent Information
- Application Number
- CN202210087978.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-25
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2042-01-25
AI Technical Summary
The existing protocol fuzz testing methods lack a unified description model, and the test cases are not targeted, resulting in low testing efficiency and cumbersome processes.
Provide a fuzz testing and diagnostic system based on custom protocol configuration, supporting user-defined protocol templates and exception handling strategies, including target monitoring, custom configuration, fuzz testing engine, exception handling and data transmission and reception devices, to obtain communication status in real time Information, mutation test cases and exception handling to improve testing efficiency.
It realizes a more efficient test process, supports a variety of exception handling strategies, enhances the monitoring capabilities of the test target equipment, and performs error frame diagnosis and on-site reproduction through vulnerability positioning devices, improving testing efficiency and targetedness.
Smart Images

Figure CN114500345B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of fuzzy testing, and in particular to a fuzzy testing and diagnosis system based on custom protocol configuration. Background Art
[0002] Due to the high degree of formatting of traditional protocol messages, protocol fuzz testing usually uses a generation-based approach to generate test cases. Taking the CAN protocol as an example, the user needs to define the first 11 bits as the arbitration ID, followed by 8 bytes of data, and other control bits. In terms of generating compliant CAN frame technology, the simplest algorithm will exhaustively enumerate all 2^11 arbitration IDs and 2^64 possible data, which is unacceptable in terms of time cost.
[0003] In the prior art, the protocol is described as a block sequence model, and data mutation is performed in blocks. The effectiveness of the test case is improved by segmenting the data structure of the message and automatically counting the length of the mutated field. Some new studies have expanded the data model on this basis, adding more descriptions of the dependencies between data blocks. In recent years, some have improved the paradigm grammar, parsed the protocol sample into a mutation tree by introducing a tree structure, and traversed all nodes in the tree for mutation.
[0004] However, the existing protocol fuzz testing methods still have the following problems: 1. There is no unified description model, and even the same type of protocol has messages in different formats; 2. The test cases are not targeted, and the test cases are difficult to verify through the program, resulting in too many invalid test cases, affecting the test efficiency; 3. The test process is relatively cumbersome and inefficient.
[0005] Therefore, in view of the shortcomings of the current protocol fuzz testing methods, it is necessary to develop a software testing system that can solve the above problems. Summary of the invention
[0006] The present invention provides a fuzzy testing and diagnosis system based on custom protocol configuration, which supports user-defined protocol templates and various exception handling strategies and improves testing efficiency.
[0007] The embodiment of the present invention provides a fuzzy testing and diagnosis system based on a custom protocol configuration, comprising:
[0008] A target monitoring device, which is used to interact with the target device, and the target monitoring device obtains the communication status information reported by the target device in real time;
[0009] A custom configuration device, which is used to perform initial use case configuration;
[0010] A fuzzy test engine device, which is used to interact with the custom configuration device, and after the fuzzy test engine device obtains the initial use case from the custom configuration device, mutates the initial use case to generate a mutated test case;
[0011] An exception handling device, which is used to interact with the target monitoring device and the custom configuration device, the exception handling device receives the exception handling strategy reported by the custom configuration device, and when the target monitoring device identifies that the communication status information reported by the target device is abnormal, controls the test to enter the exception handling process according to the exception handling strategy;
[0012] A data transceiver device is used to interact with the fuzzy test engine device and the exception handling device, and the data transceiver device is used to store the variant test cases generated by the fuzzy test engine device and the exception information of the exception handling device.
[0013] Preferably, the fuzzy testing and diagnosis system based on custom protocol configuration also includes:
[0014] A bypass device, which is used to interact with the custom configuration device and the data transceiver device, and the bypass device monitors the sending and receiving of data by the data transceiver device;
[0015] The bypass device includes: a custom configuration device interface unit, which is used to interact with the custom configuration device to establish a monitoring branch; a bypass device interface unit, which is used to interact with the data transceiver device to monitor the sending and receiving of data by the data transceiver device.
[0016] Preferably, the fuzzy testing and diagnosis system based on custom protocol configuration also includes:
[0017] A vulnerability locating device is used to interact with the data transceiver device, the vulnerability locating device receives the data frame reported by the data transceiver device, diagnoses the data frame, and uses the error frame in the data frame as a test case and sends it to the target device for on-site reproduction of the error.
[0018] Preferably, the exception handling strategy includes:
[0019] Timeout retry: If the response message of the target device is not received within the preset time, the request message is resent. When the timeout retransmission reaches the preset number of times, the test of the next test case is continued;
[0020] Abnormal termination: If no response message is received from the target device within the specified time, the current test task is terminated;
[0021] Event reply: If no response message from the target device is received within the specified time, the current test task will be suspended until a response message from the target device is received and the current test task will be continued.
[0022] Preferably, the target monitoring device comprises:
[0023] A target status monitoring interface unit, which is used to interact with the target device, and the target status monitoring interface unit obtains the communication status information reported by the target device in real time;
[0024] A state identification unit, which is used to interact with the monitoring target state interface unit, receive the communication state information reported by the target device in real time by the monitoring target state interface unit, and identify the communication state information;
[0025] A test process control unit is used to interact with the state identification unit and the exception handling device, receive the identification result sent by the state identification unit, and when the communication state information reported by the target device is abnormal, the test process control unit keeps interacting with the exception handling device to control the test to enter the exception handling process.
[0026] Preferably, the custom configuration device comprises:
[0027] Web unit interface: used to receive configuration parameters input by users;
[0028] Target configuration unit: used for interacting with the target device, the target configuration unit is connected to the target device;
[0029] An initial use case configuration unit: used to interact with the fuzzy test engine device, and the initial use case configuration unit sends an initial use case to the fuzzy test engine device for mutation;
[0030] Bypass configuration unit: used to interact with the bypass device, the bypass configuration unit is connected to the bypass device to establish a branch for monitoring data transmission and reception;
[0031] Exception handling strategy unit: It is used to interact with the exception handling device, and the exception handling strategy unit reports the exception handling strategy to the exception handling device.
[0032] Preferably, the fuzzy testing engine device comprises:
[0033] A custom configuration device interface unit: used to interact with the custom configuration device, and the custom configuration device interface unit obtains an initial use case configured by the custom configuration device;
[0034] Mutation strategy unit: used for interacting with the custom configuration device interface unit, and the mutation strategy unit mutates the initial use case sent by the custom configuration device interface unit using a protocol mutation strategy based on a grammar model;
[0035] Generate case unit: It is used to interact with the mutation strategy unit. The generated case unit is used to use the test case generation algorithm to generate a test case set from the mutated initial case, and send the test case set to the target device for testing.
[0036] Preferably, the exception handling device comprises:
[0037] Exception strategy interface unit: used for interacting with the custom configuration device, the exception strategy interface unit receives the exception handling strategy reported by the custom configuration device;
[0038] Exception handling unit: used for interacting with the target device and handling the abnormal situation of the target device according to the exception handling strategy;
[0039] Data transceiver interface unit: It is used to interact with the exception handling unit and the data transceiver device. The data transceiver interface unit receives the exception information generated after the exception handling unit handles the exception situation, and stores the received exception information in the data transceiver device.
[0040] Preferably, the data transceiver device comprises:
[0041] Data transceiver device interface unit: used to interact with the custom configuration device, the exception handling device, the fuzzy test engine device, the vulnerability location device, the bypass device, and the target device, and provide a unified data access interface for each device;
[0042] Storage unit: used to interact with the data transceiver device interface unit, and the storage unit provides data storage for each device;
[0043] Business database: used to interact with the storage unit, the business database stores business static configuration data, abnormal information, received and sent data, and logs of each device;
[0044] Historical information database: It is used to interact with the storage unit, and the historical information database stores historically sent data.
[0045] Preferably, the vulnerability locating device comprises:
[0046] Auxiliary diagnosis web unit: It is used to display the sent and received data to the user, and assist the user in analysis and diagnosis;
[0047] Error frame retry web unit: used to interact with the target device. When the user performs a retry operation, the error frame is sent to the target device to reproduce the error.
[0048] Data transceiver interface unit: It is used to interact with the auxiliary diagnosis web unit and the error frame retry web unit. The data transceiver interface unit receives the data reported by the auxiliary diagnosis web unit and the error frame retry web unit, and stores the reported data to the data transceiver.
[0049] Compared with the prior art, the technical solution of the embodiment of the present invention has the following beneficial effects:
[0050] In the fuzzy testing and diagnosis system based on custom protocol configuration of the embodiment of the present invention, the exception handling device receives the exception handling strategy reported by the custom configuration device. When the target monitoring device identifies that the communication status information reported by the target device is abnormal, the test is controlled to enter the exception handling process according to the exception handling strategy, thereby supporting user-defined protocol templates and various exception handling strategies, and improving the test efficiency;
[0051] Furthermore, it also includes a bypass device, which is used to interact with the custom configuration device and the data transceiver device to establish a monitoring branch, and the bypass device monitors the sending and receiving of data by the data transceiver device, thereby realizing multi-party monitoring and enhancing the monitoring capability of the test target device;
[0052] Furthermore, it also includes a vulnerability locating device, which receives the data frames reported by the data transceiver, diagnoses the data frames, and uses the error frames in the data frames as test cases to send them to the target device for auxiliary diagnosis and on-site reproduction of the errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are some embodiments of the present invention, not all embodiments. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor.
[0054] Figure 1 A schematic diagram of the structure of a fuzzy testing and diagnosis system based on a custom protocol configuration provided by an embodiment of the present invention;
[0055] Figure 2 A schematic diagram of the structure of a fuzzy testing and diagnosis system based on a custom protocol configuration provided by another embodiment of the present invention;
[0056] Figure 3 A schematic diagram of the structure of a bypass device of a fuzzy testing and diagnosis system based on a custom protocol configuration provided by an embodiment of the present invention;
[0057] Figure 4 A schematic diagram of the structure of a fuzzy testing and diagnosis system based on a custom protocol configuration provided by another embodiment of the present invention;
[0058] Figure 5 A schematic diagram of the structure of a target monitoring device of a fuzzy testing and diagnosis system based on a custom protocol configuration provided by an embodiment of the present invention;
[0059] Figure 6 A schematic diagram of the structure of a fuzzy testing and diagnosis system based on a custom protocol configuration provided by an embodiment of the present invention;
[0060] Figure 7 A schematic diagram of the structure of a fuzzy test engine device of a fuzzy test and diagnosis system based on a custom protocol configuration provided by an embodiment of the present invention;
[0061] Figure 8 A schematic diagram of the structure of an exception handling device of a fuzzy testing and diagnosis system based on a custom protocol configuration provided by an embodiment of the present invention;
[0062] Fig. 9 A schematic diagram of the structure of a data transceiver device of a fuzzy testing and diagnosis system based on a custom protocol configuration provided by an embodiment of the present invention;
[0063] Fig.10 A schematic diagram of the structure of a vulnerability location device of a fuzzy testing and diagnosis system based on a custom protocol configuration provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0065] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0066] Based on the problems existing in the prior art, an embodiment of the present invention provides a fuzzy testing and diagnosis system based on custom protocol configuration, which supports user-defined protocol templates and various exception handling strategies, thereby improving testing efficiency.
[0067] Figure 1 FIG. 1 is a schematic diagram of a fuzzy testing and diagnosis system based on a custom protocol configuration provided by an embodiment of the present invention. Figure 1 The embodiment of the present invention provides a fuzzy testing and diagnosis system based on a custom protocol configuration, comprising:
[0068] A target monitoring device 11, which is used to interact with the target device 10, and the target monitoring device 11 obtains the communication status information reported by the target device 10 in real time;
[0069] A custom configuration device 12, which is used to perform initial use case configuration;
[0070] A fuzzy test engine device 13, which is used to interact with the custom configuration device 12. After the fuzzy test engine device 13 obtains the initial test case from the custom configuration device 12, it mutates the initial test case to generate a mutated test case;
[0071] An exception handling device 15, which is used to interact with the target monitoring device 11 and the custom configuration device 12, the exception handling device 11 receives the exception handling strategy reported by the custom configuration device 12, and when the target monitoring device 11 identifies that the communication status information reported by the target device 10 is abnormal, the test is controlled to enter the exception handling process according to the exception handling strategy;
[0072] The data transceiver device 14 is used to interact with the fuzzy test engine device 13 and the exception handling device 15. The data transceiver device 14 is used to store the variant test cases generated by the fuzzy test engine device 13 and the exception information of the exception handling device 15.
[0073] In a specific implementation, the target device 10 is the object to be tested. The target device 10 interacts with the fuzzy test engine device 13, the data transceiver device 14, and the custom configuration device 12. The target device 10 is connected through the custom configuration device 12. The fuzzy test engine device 13 sends the mutated test case to the target device 10 for testing. The target monitoring device 11 monitors the communication status of the target device 10. If the communication is normal, the target device 10 will return data to the data transceiver device 14 normally.
[0074] Figure 2 A schematic diagram of the structure of a fuzzy testing and diagnosis system based on a custom protocol configuration provided by another embodiment of the present invention. Figure 3 A schematic diagram of the structure of a bypass device of a fuzzy testing and diagnosis system based on a custom protocol configuration provided by an embodiment of the present invention. Figure 2 and Figure 3 In a specific implementation, the fuzzy testing and diagnosis system based on custom protocol configuration also includes:
[0075] A bypass device 16, which is used to interact with the custom configuration device 12 and the data transceiver device 14, and the bypass device 16 monitors the sending and receiving of data by the data transceiver device 14;
[0076] The bypass device 16 includes: a custom configuration device interface unit 161, which is used to interact with the custom configuration device 12 to establish a monitoring branch; a bypass device interface unit 162, which is used to interact with the data transceiver device 14 to monitor the sending and receiving of data by the data transceiver device 14.
[0077] Figure 4 A schematic diagram of the structure of a fuzzy testing and diagnosis system based on a custom protocol configuration is provided for another embodiment of the present invention. Figure 4 In a specific implementation, the fuzzy testing and diagnosis system based on custom protocol configuration also includes:
[0078] The vulnerability locating device 17 is used to interact with the data transceiver device 14. The vulnerability locating device 17 receives the data frame reported by the data transceiver device 14, diagnoses the data frame, and sends the error frame in the data frame as a test case to the target device 10 for on-site reproduction of the error.
[0079] In the specific implementation, the user selects different exception handling strategies according to the business logic and configures parameters according to different exception strategies. The exception handling strategies include:
[0080] Timeout retry: If no response message from the target device is received within the preset time, the request message is resent. When the timeout retransmission reaches the preset number of times, the test of the next test case is continued; the preset time and the preset number of times are set by the user in the custom configuration device 12, the preset time is usually set to 2-5 seconds, and the preset number of times is usually set to 3-5 times.
[0081] Abnormal termination: If no response message is received from the target device within the specified time, the current test task will be terminated; the specified time is usually 5 seconds.
[0082] Event reply: If no response message from the target device is received within the specified time, the current test task will be suspended until a response message from the target device is received and the current test task will be continued. The specified time is usually 5 seconds.
[0083] Figure 5 A schematic diagram of the structure of a target monitoring device of a fuzzy testing and diagnosis system based on a custom protocol configuration provided by an embodiment of the present invention. Figure 5 In a specific implementation, the target monitoring device 11 includes:
[0084] A target status monitoring interface unit 111, which is used to interact with the target device 10, and the target status monitoring interface unit 111 obtains the communication status information reported by the target device in real time;
[0085] A state identification unit 112, which is used to interact with the monitoring target state interface unit 111, receive the communication state information reported by the target device 10 acquired by the monitoring target state interface unit 111 in real time, and identify the communication state information;
[0086] The test process control unit 113 is used to interact with the state identification unit 112 and the exception handling device 115, and receive the identification result sent by the state identification unit 112. When the communication state information reported by the target device 10 is abnormal, the test process control unit 113 keeps interacting with the exception handling device 115 to control the test to enter the exception handling process.
[0087] Figure 6 A schematic diagram of the structure of a custom configuration device for a fuzzy testing and diagnosis system based on custom protocol configuration provided by an embodiment of the present invention. Figure 6 In a specific implementation, the custom configuration device 12 interacts with the target device 10, the fuzzy test engine device 13, and the exception handling device 15 to achieve connection with the target device 10, initial use case input, and exception handling strategy configuration. The custom configuration device 12 includes:
[0088] Web unit interface 121: used to receive configuration parameters input by users;
[0089] A target configuration unit 122: used for interacting with the target device 10, the target configuration unit 122 is connected to the target device 10;
[0090] An initial use case configuration unit 123: used to interact with the fuzzy test engine device 13, and the initial use case configuration unit 123 sends an initial use case to the fuzzy test engine device 13 for mutation;
[0091] Bypass configuration unit 125: used to interact with the bypass device 16, the bypass configuration unit 125 is connected to the bypass device 16 to establish a branch for monitoring data transmission and reception;
[0092] Exception handling strategy unit 124 : used for interacting with the exception handling device 15 , and reporting the exception handling strategy to the exception handling device 15 .
[0093] Figure 7 A schematic diagram of the structure of a fuzzy testing and diagnosis system based on a custom protocol configuration provided by an embodiment of the present invention. Figure 7 In a specific implementation, the fuzzy test engine device 13 includes:
[0094] The custom configuration device interface unit 131 is used to interact with the custom configuration device 12. The custom configuration device interface unit 131 obtains the initial use case configured by the custom configuration device 12;
[0095] Mutation strategy unit 132: used for interacting with the custom configuration device interface unit 131, the mutation strategy unit 132 uses a grammar model-based protocol mutation strategy to mutate the initial use case sent by the custom configuration device interface unit 131;
[0096] Generate use case unit 133: It is used to interact with the mutation strategy unit 132. The generate use case unit 133 is used to use a test case generation algorithm to generate a test case set from the mutated initial use case, and send the test case set to the target device 10 for testing.
[0097] In the specific implementation, the protocol mutation strategy based on the grammar model takes each node in the grammar parsing tree as input parameters and the abnormal data set as output. First, it determines whether the current node is a leaf node, and then according to the corresponding protocol field type of the node, if it is an intermediate node, it recursively searches for its child nodes for mutation, mutates and stores according to the corresponding strategy, and returns all abnormal data.
[0098] Figure 8 A schematic diagram of the structure of an exception handling device of a fuzzy testing and diagnosis system based on a custom protocol configuration provided by an embodiment of the present invention. Figure 8 In a specific implementation, the exception handling device 15 includes:
[0099] Exception strategy interface unit 151: used for interacting with the custom configuration device 12, the exception strategy interface unit 151 receives the exception handling strategy reported by the custom configuration device 12;
[0100] Exception handling unit 152: used to interact with the target device 10 and handle the exception of the target device 10 according to the exception handling strategy;
[0101] The data transceiver interface unit 153 is used to interact with the exception handling unit 152 and the data transceiver device 14 . The data transceiver interface unit 153 receives the exception information generated after the exception handling unit 152 handles the exception situation, and stores the received exception information in the data transceiver device 14 .
[0102] Fig. 9 A schematic diagram of the structure of a data transceiver of a fuzzy test and diagnosis system based on a custom protocol configuration according to an embodiment of the present invention. Fig. 9 In a specific implementation, the data transceiver device 14 includes:
[0103] Data transceiver device interface unit 141: used to interact with the custom configuration device 12, the exception handling device 15, the fuzzy test engine device 13, the vulnerability location device 17, the bypass device 16, and the target device 10, and provide a unified data access interface for each device;
[0104] Storage unit 142: used to interact with the data transceiver device interface unit 141, and the storage unit 142 provides data storage for each device;
[0105] Business database 144: used to interact with the storage unit 142, the business database 144 stores business static configuration data, abnormal information, received and sent data, and logs of each device;
[0106] Historical information database 143: used to interact with the storage unit 142, the historical information database 143 stores historically sent data.
[0107] Fig.10 A schematic diagram of a vulnerability location device of a fuzzy testing and diagnosis system based on a custom protocol configuration provided by an embodiment of the present invention. Fig.10 In a specific implementation, the vulnerability locating device 17 includes:
[0108] Auxiliary diagnosis web unit 171: It is used to display the sent and received data to the user, assist the user in analysis and diagnosis; for the data sent and received in the test session, the log is displayed, and the received data is diagnosed according to certain matching rules. The received data is decomposed into different fields according to the frame structure, the data part is parsed according to the function code, and the generated fault data is marked and stored for further analysis.
[0109] In a specific implementation, the matching rules include: defining the expected received value in the custom configuration device 12, parsing the received data frame according to the format defined in the custom configuration device 12, and the system comparing the parsed value with the expected received value. If the two are inconsistent, they are highlighted for further analysis by the user. For example, a certain protocol format is divided into three sections: the head, the middle, and the tail. The received data is parsed according to this format, and then matched with the head, the middle, and the tail of the expected value one by one. If the data in the head is inconsistent, the head value is marked and the generated fault data is stored for further analysis by the user.
[0110] Error frame retry web unit 172: It is used to interact with the target device 10. When the user performs a retry operation, the error frame is sent to the target device for error reproduction. During the execution of the test session, the generated error frame can be retested, the test session is initialized, and the error frame is used as a test case set in the test session. The test session sends the error frame to the target device 10 for on-site error reproduction, thereby confirming the verifiability of the vulnerability.
[0111] Data transceiver interface unit 173: It is used to interact with the auxiliary diagnosis web unit 171 and the error frame retry web unit 172. The data transceiver interface unit 173 receives the data reported by the auxiliary diagnosis web unit 171 and the error frame retry web unit 172, and stores the reported data to the data transceiver 14.
[0112] In the specific implementation, the sent data frames will be displayed in the operation interface, and the data frames include normal frames and error frames. A replay button is set next to the error frame in the operation interface. After the user clicks the replay button, the system will send the error frame as a test case to the target device 10 for retesting, and the target device 10 will reproduce the error scene.
[0113] The embodiment of the present invention also provides a testing method of a fuzzy testing and diagnosis system based on a custom protocol configuration, comprising the following steps:
[0114] 1. User-defined configuration, initial use case configuration, including target parameters, initial use case parameters, exception handling strategy parameters, and bypass parameters;
[0115] 2. Create a test task, select the configured target, initial use case, exception handling strategy, and start testing;
[0116] 3. The fuzz testing engine mutates the configured initial test cases to generate mutated test cases;
[0117] 4. Send the mutated test case to the target device, and the target monitoring device monitors the state of the target device. If the target monitoring device detects that the target device does not respond after the test case is sent, the control test enters the exception handling process;
[0118] 5. If the target device communicates normally, the test is continued until the test results are output and the test ends;
[0119] 6. The bypass device monitors the sending and receiving of data during the test.
[0120] In summary, in the fuzzy testing and diagnosis system based on custom protocol configuration of the embodiment of the present invention, the exception handling device receives the exception handling strategy reported by the custom configuration device, and when the target monitoring device identifies that the communication status information reported by the target device is abnormal, the test is controlled to enter the exception handling process according to the exception handling strategy, thereby supporting user-defined protocol templates and various exception handling strategies, thereby improving the test efficiency; the test target program is compiled by the compilation script to form an instrumented target program, and the test configuration parameters are used according to the test control instruction to perform a vulnerability mining test on the instrumented target program, without any existing vulnerability library, and only the real-time status of the test target program file is detected and read;
[0121] Furthermore, it also includes a bypass device, which is used to interact with the custom configuration device and the data transceiver device to establish a monitoring branch, and the bypass device monitors the sending and receiving of data by the data transceiver device, thereby realizing multi-party monitoring and enhancing the monitoring capability of the test target device;
[0122] Furthermore, it also includes a vulnerability locating device, which receives the data frames reported by the data transceiver, diagnoses the data frames, and uses the error frames in the data frames as test cases to send them to the target device for auxiliary diagnosis and on-site reproduction of the errors.
[0123] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A fuzzy testing and diagnosis system based on custom protocol configuration, characterized in that: include: A target monitoring device, which is used to interact with the target device, and the target monitoring device obtains the communication status information reported by the target device in real time; A custom configuration device, which is used to perform initial use case configuration; A fuzzy test engine device, which is used to interact with the custom configuration device, and after the fuzzy test engine device obtains the initial use case from the custom configuration device, mutates the initial use case to generate a mutated test case; An exception handling device, which is used to interact with the target monitoring device and the custom configuration device, the exception handling device receives the exception handling strategy reported by the custom configuration device, and when the target monitoring device identifies that the communication status information reported by the target device is abnormal, controls the test to enter the exception handling process according to the exception handling strategy; A data transceiver device, which is used to interact with the fuzzy test engine device and the exception handling device, and the data transceiver device is used to store the variant test cases generated by the fuzzy test engine device and the exception information of the exception handling device; A bypass device, which is used to interact with the custom configuration device and the data transceiver device, and the bypass device monitors the sending and receiving of data by the data transceiver device; The bypass device comprises: a custom configuration device interface unit, which is used to interact with the custom configuration device to establish a monitoring branch; a bypass device interface unit, which is used to interact with the data transceiver device to monitor the sending and receiving of data by the data transceiver device; A vulnerability locating device, which is used to interact with the data transceiver device, receive the data frames reported by the data transceiver device, diagnose the data frames, and send the error frames in the data frames as test cases to the target device for on-site error reproduction; The vulnerability locating device comprises: Auxiliary diagnosis web unit: It is used to display the sent and received data to the user, assist the user in analysis and diagnosis, display the log of the data sent and received in the test session, diagnose the received data through matching rules, decompose the received data into different fields according to the frame structure, parse the data part according to the function code, mark and store the generated fault data for further analysis; the matching rules include: defining the expected received value in the custom configuration device, parsing the received data frame according to the format defined in the custom configuration device, and the system comparing the parsed value with the expected received value, and highlighting if the two are inconsistent; Error frame retry web unit: used to interact with the target device. When the user performs a retry operation, the error frame is sent to the target device to reproduce the error. Data transceiver interface unit: used to interact with the auxiliary diagnosis web unit and the error frame retry web unit, the data transceiver interface unit receives the data reported by the auxiliary diagnosis web unit and the error frame retry web unit, and stores the reported data in the data transceiver; The fuzzy test engine device comprises: A custom configuration device interface unit: used to interact with the custom configuration device, and the custom configuration device interface unit obtains an initial use case configured by the custom configuration device; Mutation strategy unit: It is used to interact with the custom configuration device interface unit. The mutation strategy unit uses a protocol mutation strategy based on a grammar model to mutate the initial use case sent by the custom configuration device interface unit. The protocol mutation strategy based on a grammar model takes each node in the grammar parsing tree as an input parameter and an abnormal data set as an output. First, it is determined whether the current node is a leaf node. If it is an intermediate node, its child nodes are mutated by recursively searching, and the mutation is performed and stored according to the corresponding strategy, and all abnormal data are returned; Generate case unit: It is used to interact with the mutation strategy unit. The generated case unit is used to use the test case generation algorithm to generate a test case set from the mutated initial case, and send the test case set to the target device for testing.
2. The fuzzy testing and diagnosis system based on custom protocol configuration according to claim 1 is characterized in that: The exception handling strategy includes: Timeout retry: If the response message of the target device is not received within the preset time, the request message is resent. When the timeout retransmission reaches the preset number of times, the test of the next test case is continued; Abnormal termination: If no response message is received from the target device within the specified time, the current test task is terminated; Event reply: If no response message from the target device is received within the specified time, the current test task will be suspended until a response message from the target device is received and the current test task will be continued.
3. The fuzzy testing and diagnosis system based on custom protocol configuration according to claim 1 is characterized in that: The target monitoring device comprises: A target status monitoring interface unit, which is used to interact with the target device, and the target status monitoring interface unit obtains the communication status information reported by the target device in real time; A state identification unit, which is used to interact with the monitoring target state interface unit, receive the communication state information reported by the target device in real time by the monitoring target state interface unit, and identify the communication state information; A test process control unit is used to interact with the state identification unit and the exception handling device, receive the identification result sent by the state identification unit, and when the communication state information reported by the target device is abnormal, the test process control unit keeps interacting with the exception handling device to control the test to enter the exception handling process.
4. The fuzzy testing and diagnosis system based on custom protocol configuration according to claim 1 is characterized in that: The custom configuration device comprises: Web unit interface: used to receive configuration parameters input by users; Target configuration unit: used for interacting with the target device, the target configuration unit is connected to the target device; An initial use case configuration unit: used to interact with the fuzzy test engine device, and the initial use case configuration unit sends an initial use case to the fuzzy test engine device for mutation; Bypass configuration unit: used to interact with the bypass device, the bypass configuration unit is connected to the bypass device to establish a branch for monitoring data transmission and reception; Exception handling strategy unit: It is used to interact with the exception handling device, and the exception handling strategy unit reports the exception handling strategy to the exception handling device.
5. The fuzzy testing and diagnosis system based on custom protocol configuration according to claim 1 is characterized in that: The exception handling device comprises: Exception strategy interface unit: used for interacting with the custom configuration device, the exception strategy interface unit receives the exception handling strategy reported by the custom configuration device; Exception handling unit: used for interacting with the target device and handling the abnormal situation of the target device according to the exception handling strategy; Data transceiver interface unit: It is used to interact with the exception processing unit and the data transceiver device. The data transceiver interface unit receives the exception information generated after the exception processing unit processes the exception situation, and stores the received exception information in the data transceiver device.
6. The fuzzy testing and diagnosis system based on custom protocol configuration according to claim 1, characterized in that: The data transceiver device comprises: Data transceiver device interface unit: used to interact with the custom configuration device, the exception handling device, the fuzzy test engine device, the vulnerability location device, the bypass device, and the target device, and provide a unified data access interface for each device; Storage unit: used to interact with the data transceiver device interface unit, and the storage unit provides data storage for each device; Business database: used to interact with the storage unit, the business database stores business static configuration data, abnormal information, received and sent data, and logs of each device; Historical information database: It is used to interact with the storage unit, and the historical information database stores historically sent data.
