Fuzzy test debugging method and device based on recording and playback technology

By recording and replaying key strategy information in the fuzz testing process, the commonality and complexity of the fuzz testing method in different target programs are solved, and efficient and low-cost fuzz testing strategy optimization and improvement are achieved.

CN120407429AActive Publication Date: 2025-08-01TSINGHUA UNIVERSITY
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510921347.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-04
Publication Date
2025-08-01
Estimated Expiration
2045-07-04

AI Technical Summary

Technical Problem

Existing fuzz testing methods are inadequate in the universality of cross-objective programs and solving complex program constraints, resulting in inefficient testing and high labor costs, making it difficult to widely use in diversified program environments.

Method used

By recording and replaying key policy information during the fuzz testing process, including interactive information between test strategies and seed-related metadata, a fuzz testing debugging method and device based on recording and playback technology is provided to simplify the analysis and improvement process of the fuzz tester.

Benefits of technology

It improves the efficiency and effectiveness of fuzz testing, reduces the need and time cost of manual intervention, realizes cross-program optimization and universality of fuzz testing strategies, and improves the performance of fuzz testers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120407429A_ABST
    Figure CN120407429A_ABST
Patent Text Reader

Abstract

The invention provides a fuzz test debugging method and device based on a recording and replaying technology, and relates to the technical field of computers.The method comprises the steps that fuzz testing is conducted on a target object, and first information in the testing process is recorded; the first information comprises interaction information between test strategies used in the fuzzy test process and metadata related to seeds in the test process; after the fuzz test is finished, obtaining first information, and replaying the recorded fuzz test behavior based on the first information to obtain second information; the second information comprises an execution path of the seed and information related to the test behavior. According to the fuzz test debugging method and device based on the recording and replaying technology, the execution condition of the key strategy in the fuzz test process is accurately recorded and replayed, so that the analysis and improvement process of the fuzz tester is simplified, and the fuzz test debugging method and device are particularly suitable for optimizing the grey box fuzz test guided by the coverage rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular, to a fuzz testing and debugging method and device based on recording and replay technology. Background Art

[0002] Fuzz testing is a software testing method that automatically or semi-automatically inputs abnormal or unexpected data into a system, aiming to discover security vulnerabilities, operating system crashes, or application errors in the software. It simulates scenarios of programming errors or malicious attacks, such as buffer overflows, SQL injections, etc., and observes the system's handling ability for non-compliant inputs.

[0003] In related technologies, in order to make full use of the domain knowledge of security experts, researchers have designed many methods to integrate artificial expert knowledge into the fuzz testing process. However, the fuzz testing methods in related technologies still have deficiencies in terms of generality across different target programs and solving complex program constraints.

[0004] Based on this, there is an urgent need for a fuzz testing and debugging method that can not only improve the overall efficiency of fuzz testing but also ensure its wide application in diverse program environments. Summary of the Invention

[0005] The purpose of this application is to provide a fuzz testing and debugging method and device based on recording and replay technology. By accurately recording and replaying the execution of key strategies during the fuzz testing process, it simplifies the analysis and improvement process of the fuzz tester, and is particularly suitable for optimizing coverage-guided grey-box fuzz testing.

[0006] This application provides a fuzz testing and debugging method based on recording and replay technology, including: Performing fuzz testing on a target object and recording first information during the fuzz testing process; the first information includes: interaction information between test strategies used during the fuzz testing process, and metadata related to seeds during the fuzz testing process; after the fuzz testing ends, obtaining the first information and replaying the recorded fuzz testing behavior based on the first information to obtain second information; wherein, the metadata includes: information contained in the seed file name, and the creation time of the seed file; the second information includes: the execution path of the seed, and information related to test behavior during the fuzz testing process.

[0007] Optionally, the interaction information between the test strategies includes: seed generation information, seed scheduling information, and test case execution information; performing fuzz testing on the target object and recording the first information during the fuzz testing process includes: during the process of performing fuzz testing on the target object using the first functional code added in the fuzz tester, recording the seed generation information, seed scheduling information, and test case execution information, and storing the metadata related to the seeds in the corpus.

[0008] Optionally, obtaining the first information after the fuzz testing includes: after the fuzz testing ends, obtaining the seed generation information, seed scheduling information, and test case execution information recorded using the first functional code during the test process, and extracting the metadata related to the seeds from the corpus to obtain the first information.

[0009] Optionally, replaying the recorded fuzz testing behavior based on the first information to obtain the second information includes: using the second functional code added in the source code of the program under test corresponding to the target object and the first information to replay the test behavior on the source code of the program under test corresponding to the target object, and obtaining the second information.

[0010] Optionally, after replaying the recorded fuzz testing behavior based on the first information to obtain the second information, the method further includes: displaying the first information and / or the second information to the user through a visualization interface, so that the user can browse the test behavior and the execution paths of each seed generated during the fuzz testing process through an interactive behavior.

[0011] This application also provides a fuzz testing and debugging device based on the recording and replay technology, including: A recording module, configured to perform fuzz testing on a target object and record the first information during the fuzz testing process; the first information includes: the interaction information between the test strategies used during the fuzz testing process, and the metadata related to the seeds during the fuzz testing process; a replay module, configured to obtain the first information after the fuzz testing ends, and replay the recorded fuzz testing behavior based on the first information to obtain the second information; wherein, the metadata includes: the information included in the seed file name, the creation time of the seed file; the second information includes: the execution path of the seed, and the information related to the test behavior during the fuzz testing process.

[0012] Optionally, the interaction information between the test strategies includes: seed generation information, seed scheduling information, and test case execution information; the recording module is specifically configured to use the first functional code added in the fuzzer to record the seed generation information, seed scheduling information, and test case execution information during the fuzz testing of the target object, and store the metadata related to the seeds in the corpus.

[0013] Optionally, the replay module is specifically configured to, after the fuzz testing is completed, obtain the seed generation information, seed scheduling information, and test case execution information recorded by using the first functional code during the test process, and extract the metadata related to the seeds from the corpus to obtain the first information.

[0014] Optionally, the replay module is specifically configured to use the second functional code added in the source code of the program under test corresponding to the target object and the first information to replay the test behavior of the source code of the program under test corresponding to the target object, and obtain the second information.

[0015] Optionally, the device further includes: a display module; the display module is configured to display the first information and / or the second information to the user through a visualization interface, so that the user can browse the test behaviors and the execution paths of each seed generated during the fuzz testing through interactive behaviors.

[0016] The present application also provides a computer program product, including a computer program / instructions, and when the computer program / instructions are executed by a processor, the steps of the fuzz testing and debugging method based on the recording and replay technology as described in any one of the above are implemented.

[0017] The present application also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the program, the steps of the fuzz testing and debugging method based on the recording and replay technology as described in any one of the above are implemented.

[0018] The present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the fuzz testing and debugging method based on the recording and replay technology as described in any one of the above are implemented.

[0019] The fuzz testing and debugging method and device based on the recording and replay technology provided by this application perform fuzz testing on a target object and record first information during the fuzz testing process; the first information includes: interaction information between test strategies used during the fuzz testing process, and metadata related to seeds during the fuzz testing process; after the fuzz testing ends, obtain the first information, and replay the recorded fuzz testing behaviors based on the first information to obtain second information; wherein, the metadata includes: information contained in the seed file name, and the creation time of the seed file; the second information includes: the execution path of the seed, and information related to test behaviors during the fuzz testing process. In this way, by accurately recording and replaying the execution of key strategies during the fuzz testing process, the analysis and improvement process of the fuzzer is simplified, which is especially suitable for optimizing coverage-guided grey-box fuzz testing. Description of the Drawings

[0020] To more clearly illustrate the technical solutions in this application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of this application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0021] Figure 1 is one of the flow diagrams of the fuzz testing and debugging method based on the recording and replay technology provided by this application; Figure 2 is another flow diagram of the fuzz testing and debugging method based on the recording and replay technology provided by this application; Figure 3 is the structural diagram of the fuzz testing and debugging device based on the recording and replay technology provided by this application; Figure 4 is the structural diagram of the electronic device provided by this application. Detailed Embodiments

[0022] To make the objectives, technical solutions, and advantages of this application clearer, the following will clearly and completely describe the technical solutions in this application in conjunction with the drawings in this application. Obviously, the described embodiments are some, but not all, of the embodiments of this application. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of this application.

[0023] The terms "first", "second", etc. in the description and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments of this application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same category and do not limit the number of objects. For example, the first object can be one or multiple. In addition, "and / or" in the description and claims means at least one of the connected objects, and the character " / ", generally represents an "or" relationship between the associated objects before and after.

[0024] Fuzzing is an automated testing technique that discovers vulnerabilities in a program by generating a large number of random or semi-random input data. Instrumentation, on the other hand, is to insert additional instructions or code into the code to collect information during program execution, such as code coverage, execution paths, etc.

[0025] Fuzzing methods have high practical value in improving the efficiency of vulnerability discovery and exploring complex code areas. To fully utilize the domain knowledge of security experts, researchers have designed many methods to integrate human expert knowledge into the fuzzing process. These methods can be divided into three categories: 1) Visualize the fuzzing process to help experts better understand the test dynamics; 2) Conduct bottleneck analysis on the target program to identify and solve the performance bottlenecks caused by the target program during the test process; 3) Manually directly participate in the runtime fuzzing decision-making to provide immediate guidance to optimize the test strategy. However, the fuzzing methods in the related technologies still have deficiencies in terms of generality across different target programs and solving complex program constraints.

[0026] Visualizing the fuzzing process greatly enhances experts' intuitive understanding of the test progress by providing real-time data and dynamic feedback. However, the information presented by these methods is too complex, which is not conducive to quickly identifying key information. Since the tool provides a large amount of real-time data and dynamic feedback, users are easily overwhelmed by too many details and it is difficult to quickly focus on the most important problem areas. This not only increases the cognitive burden but may also lead to the neglect of key issues, affecting the test efficiency and effectiveness.

[0027] Conducting bottleneck analysis on the target program, although it can quickly identify the location of the bottleneck branches that hinder the current fuzzing progress, since these methods mainly focus on the bottleneck code in the target program, users need to have a good understanding of the target program to extract insights for improving fuzzing from it. This means that every time the target program is changed, human experts need to re-understand the code of the new program, resulting in a relatively high labor cost.

[0028] For the method of directly involving humans in runtime fuzz testing decisions, this approach can make full use of experts' knowledge and experience, provide immediate guidance, and optimize test strategies, thereby significantly enhancing the effectiveness and efficiency of fuzz testing. However, these methods also have some drawbacks: they highly rely on human intervention, the optimization results are limited to a single target program, and the portability is poor. This not only reduces the automation level of the testing process but also means that experts need to re-analyze and adjust the strategy every time the target program is changed, increasing the time and resource investment.

[0029] Current methods usually require a large amount of re-analysis and adjustment by experts when applied to new target programs. This dependence leads to poor performance when facing new programs. Especially when dealing with programs of different structures and complexities, existing methods often lack the ability to quickly adapt. The optimization results are limited to a single target program and cannot apply the insights obtained from the analysis to the fuzz testing strategy itself to improve the performance on other programs.

[0030] Therefore, it is necessary to develop new methods that can debug and analyze the fuzz testing strategy itself. Such methods should have the characteristics of low overhead, user-friendliness, and the ability to apply newly discovered insights to cross-program optimization. In this way, it is possible to better capture the strategy bottleneck problems in the fuzz testing process, improve portability while reducing the need for human intervention and time costs. This can not only enhance the overall efficiency of fuzz testing but also ensure its wide application in diverse program environments.

[0031] As Figure 1 shown, it is a schematic flowchart of the fuzz testing debugging method based on the recording and replay technology provided by the embodiment of the present application. This method is implemented through two components, namely the recorder on the left half and the replayer on the right half. The recorder is responsible for recording the information required for subsequent user debugging strategies during and after the fuzz testing runs. The process of recording debugging information during the fuzz testing run is within the dashed box, and outside the dashed box, the recorder replays the collected corpus to obtain the seed execution path. The replayer is responsible for replaying the collected content in a way that is easy for users to understand and use, allowing users to quickly browse the behaviors generated during the fuzz testing process through simple interactions, and then conduct further analysis to identify strategy problems.

[0032] Next, in combination with the accompanying drawings, the fuzz testing debugging method based on the recording and replay technology provided by the embodiment of the present application will be described in detail through specific embodiments and their application scenarios.

[0033] As Figure 2 shown, a fuzz testing debugging method based on the recording and replay technology provided by the embodiment of the present application may include the following steps 201 and 202: Step 201: Perform fuzz testing on the target object and record the first information during the fuzz testing process.

[0034] Among them, the first information includes: the interaction information between the test strategies used during the fuzz testing process, and the metadata related to the seeds during the fuzz testing process.

[0035] Exemplarily, the above step is the recording stage for recording the required data. The required data, that is, the above first information, can be recorded by adding relevant code in the simulation test.

[0036] Specifically, the interaction information between the above test strategies includes: seed generation information, seed scheduling information, and test case execution information. Based on this, the above step 201 may include the following step 201a: Step 201a: During the process of performing fuzz testing on the target object by using the first function code added in the fuzzer, record the seed generation information, seed scheduling information, and test case execution information, and store the metadata related to the seeds in the corpus.

[0037] Exemplarily, during the execution of fuzz testing, the interaction between the internal fuzz testing strategies can be continuously monitored and recorded through the above first function code to capture key runtime behaviors. The interaction behaviors between the internal strategies include: seed generation, seed scheduling, and test case execution. After the fuzz testing process is completed, the data recording can be extended through two additional steps: collecting the seed execution path by re-executing the seed program, and extracting the seed metadata from the corpus. The metadata may include: the information encoded in the seed file name (such as the ID of the current seed, the number of tests, timestamp, etc.), and the creation time of the seed file itself.

[0038] Exemplarily, the above first function code is added in the fuzzer. For example, AFL (a fuzz testing tool) is used to test the libpng library (the target program). The module code for recording is added by modifying the code of AFL rather than modifying libpng.

[0039] Step 202: After the fuzz testing ends, obtain the first information, and replay the recorded fuzz testing behavior based on the first information to obtain the second information.

[0040] Among them, the metadata includes: the information contained in the seed file name, the creation time of the seed file; the second information includes: the execution path of the seed, and the information related to the test behavior during the fuzz testing process.

[0041] It should be noted that in the embodiments of the present application, such as Figure 1As shown, first, run the executable file obtained after being instrumented by the fuzz testing tool, and record the first information required for the replay phase. Then, run the executable file obtained after being instrumented by the present application (including the above-mentioned second functional code), and use the obtained first information to replay the fuzz testing process and obtain the second information.

[0042] In the embodiment of the present application, the first functional code is collected by modifying the source code of the fuzz testing tool without actively modifying the program under test. The second functional code is added to the program under test by recompiling the target program and customizing the code instrumentation (i.e., the instrumentation implemented in the embodiment of the present application) to add the execution path collection function. This step of collection does not involve the fuzz testing tool but involves the program under test that is re-instrumented.

[0043] Specifically, in the above step 202, the step of obtaining the first information may further include the following step 202a: Step 202a: After the fuzz testing is completed, obtain the seed generation information, seed scheduling information, and test case execution information recorded by using the first functional code during the testing process, and extract the metadata related to the seeds from the corpus to obtain the first information.

[0044] Exemplarily, based on the above first information, replaying the fuzz testing process may further obtain the second information for display to the user.

[0045] Specifically, in the above step 202, the step of replaying the recorded fuzz testing behavior based on the first information to obtain the second information may further include the following step 202b: Step 202b: Use the second functional code added to the source code of the program under test corresponding to the target object and the first information to replay the testing behavior of the source code of the program under test corresponding to the target object and obtain the second information.

[0046] In a possible implementation manner, the embodiment of the present application further provides a visualization interface for displaying relevant information to the user.

[0047] Exemplarily, after the above step 202, the fuzz testing debugging method based on the recording and replay technology provided by the embodiment of the present application may further include the following step 203: Step 203: Display the first information and / or the second information to the user through the visualization interface so that the user can browse the testing behaviors and the execution paths of each seed generated during the fuzz testing process through interactive behaviors.

[0048] Exemplarily, in the replay phase, the implemented fuzzing replay tool uses the collected data to replay the recorded fuzzing behaviors and provides a user-friendly web interface that enables users to analyze and interact with all the collected data. Through this interface, users can track the evolution of the fuzzing process, identify potential bottlenecks in the fuzzing strategy, and understand the relationships between different fuzzing behaviors, thus facilitating effective debugging and optimization.

[0049] The fuzzing debugging method based on the recording and replay technology provided by the embodiments of this application has the following prominent advantages: 1. Novel debugging method: By innovatively migrating the recording and replay mechanism to the fuzzing field, the embodiments of this application can provide systematic support for improving the fuzzing strategy and provide a solid infrastructure for efficiently debugging and optimizing the fuzzing process.

[0050] 2. Low cost overhead: By modeling the fuzzing process in the recording phase, optimizing the recording logic, and determining the key information to be recorded, the embodiments of this application introduce only extremely low performance overhead in the fuzzing process. This low overhead ensures that the invention can be applied to other fuzzers without being noticed.

[0051] 3. Wide application potential: Different from other works, the embodiments of this application focus on analyzing and debugging the fuzzing strategy behaviors. This means that the problems identified and solved by the embodiments of this application are not highly coupled with a specific target program, but are optimized and repaired at the fuzzing strategy level. Therefore, once improvements are made to the fuzzing strategy, these optimizations can also work well in other programs under test, with high generality and portability.

[0052] It should be noted that the fuzz testing and debugging method based on the recording and replay technology provided by the embodiments of the present application eliminates the non-determinism in the debugging process and improves the efficiency and effectiveness of fuzz testing by systematically capturing and reproducing key fuzz testing behaviors. The method includes a recording phase and a replay phase, enabling users to analyze and optimize fuzz testing strategies. The core idea of this method is to simplify the analysis and improvement process of the fuzz tester by accurately recording and replaying the execution of key strategies during the fuzz testing process. This method can effectively capture and reproduce the behaviors of the three core fuzz testing strategies of seed scheduling, seed generation, and test case execution, thereby providing detailed debugging information and support for developers. The tool ensures high efficiency and ease of use when performing complex fuzz testing tasks by minimizing the amount of information that needs to be recorded and providing a user-friendly interface. Experimental results show that in the Magma benchmark test, the fuzz tester optimized by this method achieved a 3.3-fold performance improvement, demonstrating its practical application value and potential in optimizing the fuzz testing process. This method not only improves the accuracy and reliability of fuzz testing but also provides new directions and ideas for subsequent fuzz testing technology research.

[0053] The fuzz testing and debugging method based on the recording and replay technology provided by the embodiments of the present application performs fuzz testing on a target object and records first information during the fuzz testing process; the first information includes: interaction information between test strategies used during the fuzz testing process, and metadata related to seeds during the fuzz testing process; after the fuzz testing ends, the first information is obtained, and the recorded fuzz testing behaviors are replayed based on the first information to obtain second information; wherein, the metadata includes: information included in the seed file name, the creation time of the seed file; the second information includes: the execution path of the seed, and information related to test behaviors during the fuzz testing process. In this way, by accurately recording and replaying the execution of key strategies during the fuzz testing process, the analysis and improvement process of the fuzz tester is simplified, especially suitable for optimizing coverage-guided grey-box fuzz testing.

[0054] It should be noted that the execution subject of the fuzz testing and debugging method based on the recording and replay technology provided by the embodiments of the present application can be a fuzz testing and debugging device based on the recording and replay technology, or a control module in the fuzz testing and debugging device based on the recording and replay technology for executing the fuzz testing and debugging method based on the recording and replay technology. In the embodiments of the present application, the fuzz testing and debugging device based on the recording and replay technology is used as an example to execute the fuzz testing and debugging method based on the recording and replay technology to illustrate the fuzz testing and debugging device based on the recording and replay technology provided by the embodiments of the present application.

[0055] It should be noted that in the embodiments of the present application, the fuzz testing and debugging methods shown in the above-mentioned various method drawings are all exemplarily described by taking one drawing in the embodiments of the present application as an example. Specifically, when implemented, the fuzz testing and debugging methods based on the recording and replay technology shown in the above-mentioned various method drawings can also be implemented in combination with any other combinable drawings schemed in the above embodiments, which will not be elaborated here.

[0056] Next, the fuzz testing and debugging device based on the recording and replay technology provided by the present application will be described. The following description can be correspondingly referred to the fuzz testing and debugging method based on the recording and replay technology described above.

[0057] Figure 3 It is a schematic structural diagram of the fuzz testing and debugging device based on the recording and replay technology provided by the embodiments of the present application, as Figure 3 shown, specifically including: A recording module 301, configured to perform fuzz testing on a target object and record first information during the fuzz testing process; the first information includes: interaction information between test strategies used during the fuzz testing process, and metadata related to seeds during the fuzz testing process; a replay module 302, configured to obtain the first information after the fuzz testing ends, and replay the recorded fuzz testing behavior based on the first information to obtain second information; wherein, the metadata includes: information included in the seed file name, the creation time of the seed file; the second information includes: the execution path of the seed, and information related to the test behavior during the fuzz testing process.

[0058] Optionally, the interaction information between the test strategies includes: seed generation information, seed scheduling information, and test case execution information; the recording module 301 is specifically configured to use the first function code added in the fuzzer to record the seed generation information, seed scheduling information, and test case execution information during the process of performing fuzz testing on the target object, and store the metadata related to the seeds in the corpus.

[0059] Optionally, the replay module 302 is specifically configured to obtain the seed generation information, seed scheduling information, and test case execution information recorded by using the first function code during the test process after the fuzz testing ends, and extract the metadata related to the seeds from the corpus to obtain the first information.

[0060] Optionally, the replay module 302 is specifically configured to use the second function code added to the source code of the program under test corresponding to the target object and the first information to replay the test behavior on the source code of the program under test corresponding to the target object, and obtain the second information.

[0061] Optionally, the device further includes: a display module; the display module is configured to display the first information and / or the second information to the user through a visual interface, so that the user can browse the test behaviors generated during the fuzz testing process and the execution paths of each seed through an interactive behavior.

[0062] The fuzz testing and debugging device based on the recording and replay technology provided by this application performs fuzz testing on a target object and records the first information during the fuzz testing process; the first information includes: the interaction information between the test strategies used during the fuzz testing process, and the metadata related to seeds during the fuzz testing process; after the fuzz testing is completed, the first information is obtained, and the recorded fuzz testing behaviors are replayed based on the first information to obtain the second information; wherein, the metadata includes: the information contained in the seed file name, the creation time of the seed file; the second information includes: the execution path of the seed, and the information related to the test behavior during the fuzz testing process. In this way, by accurately recording and replaying the execution of key strategies during the fuzz testing process, the analysis and improvement process of the fuzz tester is simplified, which is especially suitable for optimizing coverage-guided grey-box fuzz testing.

[0063] Figure 4 An example of the physical structure diagram of an electronic device is shown as Figure 4 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430, and a communication bus 440. Among them, the processor 410, the communication interface 420, and the memory 430 communicate with each other through the communication bus 440. The processor 410 can call the logical instructions in the memory 430 to execute the fuzz testing and debugging method based on the recording and replay technology, and the method includes: performing fuzz testing on a target object and recording the first information during the fuzz testing process; the first information includes: the interaction information between the test strategies used during the fuzz testing process, and the metadata related to seeds during the fuzz testing process; after the fuzz testing is completed, the first information is obtained, and the recorded fuzz testing behaviors are replayed based on the first information to obtain the second information; wherein, the metadata includes: the information contained in the seed file name, the creation time of the seed file; the second information includes: the execution path of the seed, and the information related to the test behavior during the fuzz testing process.

[0064] In addition, when the logical instructions in the above-mentioned memory 430 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.

[0065] On the other hand, this application also provides a computer program product. The computer program product includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the fuzz testing and debugging method based on the recording and replay technology provided by the above-mentioned various methods. The method includes: performing fuzz testing on a target object and recording first information during the fuzz testing process; the first information includes: interaction information between test strategies used during the fuzz testing process, and metadata related to seeds during the fuzz testing process; after the fuzz testing ends, obtaining the first information and replaying the recorded fuzz testing behavior based on the first information to obtain second information; wherein, the metadata includes: information contained in the seed file name, the creation time of the seed file; the second information includes: the execution path of the seed, and information related to test behaviors during the fuzz testing process.

[0066] On another aspect, this application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is configured to execute the fuzz testing and debugging method based on the recording and replay technology provided by the above-mentioned various methods. The method includes: performing fuzz testing on a target object and recording first information during the fuzz testing process; the first information includes: interaction information between test strategies used during the fuzz testing process, and metadata related to seeds during the fuzz testing process; after the fuzz testing ends, obtaining the first information and replaying the recorded fuzz testing behavior based on the first information to obtain second information; wherein, the metadata includes: information contained in the seed file name, the creation time of the seed file; the second information includes: the execution path of the seed, and information related to test behaviors during the fuzz testing process.

[0067] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative effort.

[0068] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0069] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit them. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features. And these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A fuzz testing and debugging method based on recording and replay technology, characterized in that, Including: Perform fuzz testing on a target object and record first information during the fuzz testing process; The first information includes: interaction information between test strategies used during the fuzz testing process, and metadata related to seeds during the fuzz testing process; After the fuzz testing ends, obtain the first information, and replay the recorded fuzz testing behavior based on the first information to obtain second information; Wherein, the metadata includes: information contained in the seed file name, the creation time of the seed file; the second information includes: the execution path of the seed, and information related to the test behavior during the fuzz testing process.

2. The method according to claim 1, characterized in that, The interaction information between the test strategies includes: seed generation information, seed scheduling information, and test case execution information; The performing fuzz testing on a target object and recording first information during the fuzz testing process includes: During the process of performing fuzz testing on the target object by using first functional code added in a fuzzer, record seed generation information, seed scheduling information, and test case execution information, and store metadata related to seeds in a corpus.

3. The method according to claim 2, wherein The obtaining the first information after the fuzz testing ends includes: After the fuzz testing ends, obtain the seed generation information, seed scheduling information, and test case execution information recorded by using the first functional code during the testing process, and extract metadata related to seeds from the corpus to obtain the first information.

4. The method according to claim 3, wherein The replaying the recorded fuzz testing behavior based on the first information to obtain second information includes: Use second functional code added in the source code of the program under test corresponding to the target object and the first information to replay the test behavior on the source code of the program under test corresponding to the target object, and obtain the second information.

5. The method according to any one of claims 1 to 4, characterized in that After the replaying the recorded fuzz testing behavior based on the first information to obtain second information, the method further includes: Display the first information and / or the second information to a user through a visualization interface, so that the user can browse the test behavior generated during the fuzz testing process and the execution paths of each seed through an interaction behavior.

6. A fuzz testing and debugging device based on recording and replay technology, characterized in that, The apparatus includes: A recording module, configured to perform fuzz testing on a target object and record first information during the fuzz testing process; the first information includes: interaction information between test strategies used during the fuzz testing process, and metadata related to seeds during the fuzz testing process; A replay module, configured to obtain the first information after the fuzz testing ends, and replay the recorded fuzz testing behavior based on the first information to obtain second information; Wherein, the metadata includes: information contained in the seed file name, the creation time of the seed file; the second information includes: the execution path of the seed, and information related to the test behavior during the fuzz testing process.

7. The fuzz testing and debugging device based on the recording and playback technology according to claim 6, characterized in that The interaction information between the test strategies includes: seed generation information, seed scheduling information, and test case execution information; The recording module is specifically configured to use the first functional code added in the fuzzer to record seed generation information, seed scheduling information, and test case execution information during the fuzz testing of the target object, and store the seed-related metadata in the corpus.

8. The fuzz testing debugging device based on the recording and replay technology according to claim 7, wherein The replay module is specifically configured to, after the fuzz testing is completed, obtain the seed generation information, seed scheduling information, and test case execution information recorded using the first functional code during the testing process, and extract the seed-related metadata from the corpus to obtain the first information.

9. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the steps of the fuzz testing debugging method based on the recording and replay technology according to any one of claims 1 to 5.

10. A computer-readable storage medium, characterized in that, A computer program is stored thereon. When the computer program is executed by the processor, it implements the steps of the fuzz testing debugging method based on the recording and replay technology according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Fuzzy test method and device and electronic equipment

    CN112948276A

  • Vulnerability analysis method and system based on evolutionary strategy fuzzy test mutation optimization

    CN116896453A

  • Network protocol fuzz testing method, device and equipment based on source code and medium

    CN117155831A

  • Fuzzy test method, system and equipment for power internet of things terminal and storage medium

    CN117852042A

  • Fuzzy test method and system based on attacker model and terminal equipment

    CN119676129A