Fuzzy testing method and process based on deep reinforcement learning model

By adopting a deep reinforcement learning model in the fuzzy test, optimizing the variation strategy and location selection, the existing fuzzy testing methods have the lack of efficiency and coverage, and the more efficient vulnerability testing and code coverage are achieved.

CN119377120AActive Publication Date: 2025-01-28BEIHANG UNIV
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411567783.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-05
Publication Date
2025-01-28
Estimated Expiration
2044-11-05

AI Technical Summary

Technical Problem

The existing fuzz testing methods have shortcomings in testing efficiency, coverage and complexity, making it difficult to effectively discover vulnerabilities and instability points in the software.

Method used

Using a fuzzy test method based on deep -enhanced learning models, through constructing a fixed mutation strategy and a random mutation model of HAVOC, optimizing the choice of mutant operation operator and mutation position, and improving the automation and efficiency of fuzzy testing.

Benefits of technology

The code coverage and vulnerability mining capabilities of fuzzy testing are improved, the ability to trigger new paths and excavation vulnerabilities is enhanced, and the efficiency of fuzzy testing is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119377120A_ABST
    Figure CN119377120A_ABST
Patent Text Reader

Abstract

The invention discloses a fuzzy testing method and process based on a deep learning model. The method comprises the following steps: firstly, collecting Linux application programs in different formats, and storing the collected application programs and seed files with the same format as the collected application programs; secondly, constructing a variation model under a fixed variation strategy based on a value-oriented DQN algorithm and a strategy-oriented TRPO algorithm, and constructing a Havoc random variation model based on an improved Thompson sampling algorithm to output an effective variation operator and variation strategy chain information of a test sample; thirdly, modifying an AFL source code, embedding the two proposed variation models, and realizing interaction between the models and the AFL by using a shared memory mode; and finally, for the AFL with the embedded model obtained in the previous step, compiling an automatic execution script, setting the execution time of the automatic execution script, executing afl-fuzz, afl-showmap and afl-cov instructions to train the two embedded models, carrying out automatic fuzzy testing, and according to the execution result of the fuzzy testing, visualizing the code coverage rate, the collapse number, the mutation operator use condition and other results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of software security, and more specifically, to the field of binary program fuzz testing, and proposes a fuzz testing method and process based on a deep reinforcement learning model. Background Art

[0002] With the advancement of the information age, software, as the core carrier of information technology, has penetrated into daily life, involving key areas such as finance, personal information, and health. But at the same time, software has also become a target of hackers and malware developers, who are constantly looking for new attack methods and vulnerabilities to destroy and steal data. Once software security is lost, individuals will face multiple risks such as privacy leakage and property loss, affecting social stability and harmony, and even seriously threatening national security and stability. Therefore, ensuring software security is of vital practical value to maintaining network security, national security, and building a cyber power.

[0003] As an effective vulnerability mining technology, fuzz testing solves the shortcomings of traditional security testing methods and improves the effectiveness of vulnerability mining in the information field. Fuzz testing can automatically or semi-automatically input random or semi-random data into the system and monitor the abnormal behavior of the program to discover vulnerabilities and unstable points in the software. However, fuzz testing still has problems such as low testing efficiency, limited coverage, and high complexity. In order to improve the performance of AFL, relevant researchers have adopted algorithms such as genetic algorithms and deep learning to optimize the selection of mutation operators in AFL, but this has led to challenges such as model complexity, insufficient accuracy, and poor generalization and scalability. Summary of the invention

[0004] The present invention proposes a fuzz testing method and process based on a deep reinforcement learning model, taking into account the selection of mutation operators and mutation positions, and realizing the method by optimizing the mutation process in stages, which can efficiently train the model to obtain mutation operators and mutation strategy chains, thereby effectively selecting mutation operators in the fuzz test mutation process. The fuzz testing method based on a deep reinforcement learning model proposed in the present invention can be applied to different types of binary program files.

[0005] To achieve the above object, the present invention is implemented according to the following technical solutions:

[0006] A fuzzy testing method and process based on a deep reinforcement learning model includes the following steps:

[0007] Step S1: Program collection: collect Linux applications of different formats, store the collected applications in the application file directory, and place seed files of the same format in the same source seed file directory;

[0008] Step S2: Construction of mutation model under fixed mutation strategy: Based on the value-oriented DQN algorithm and the strategy-oriented TRPO algorithm, a mutation model under a fixed mutation strategy is constructed to output effective mutation strategies and effective mutation position information of the test samples;

[0009] Step S3: Havoc random mutation model construction: Based on the improved Thompson sampling algorithm, a Havoc random mutation model is constructed to output effective mutation strategy chain information of the test sample;

[0010] Step S4: Mutation model embedding: Modify the source code of AFL, combine the mutation model built in S2 and S3, embed it into AFL, and use shared memory to realize the interaction between the model and AFL;

[0011] Step S5: Automated fuzz testing: For the AFL embedded with the mutation model in S4, write an automated execution script, set the execution time, execute afl-fuzz, afl-showmap and afl-cov instructions to perform automated fuzz testing, and train the two embedded models;

[0012] Step S6: Result visualization: Based on the fuzz test execution results, the code coverage, number of crashes and usage of mutation operators are counted, and the results are visualized;

[0013] In the above technical solution, in step S1, the specific steps of program collection are:

[0014] Step S11: creating a homologous seed file directory for storing seed files based on the same format;

[0015] Step S12: Create an application file directory for storing Linux application files developed based on C language in different formats;

[0016] Step S13: Obtain different C language-based application programs from the Linux official website, and store these application program files in the application program file directory;

[0017] Step S14: using the man command in the Linux system to query execution command parameters of different applications in the application file directory, and obtaining the file formats processed by different applications according to the execution command parameters of different applications and the ReadMe files to which the programs belong, and executing S15;

[0018] Step S15: According to the execution command parameters and corresponding file formats of different applications obtained in S14, a file with the same file format and less than 1 MB is obtained or generated from the source application file or Github as a seed file, and the seed file with the same format is added to the same source seed file directory;

[0019] Step S16: according to the ReadMe file in the application file, use the make command in the Linux system to set the compilation options to implement AFL's instrumentation of the application to be tested, and compile different application files in the application file directory;

[0020] Step S17: Analyze the AFL mutation phase source code, and divide the AFL mutation process into a fixed mutation strategy mutation phase and a Havoc random mutation phase;

[0021] In the above technical solution, in step S2, the specific steps of constructing the mutation model under the fixed mutation strategy are:

[0022] Step S21: Use pytorch to implement a deep reinforcement learning model based on the value-oriented DQN algorithm and the strategy-oriented TRPO algorithm;

[0023] Step S22: locate the position of the mutation stage under the fixed mutation strategy in the AFL source code, and build a data reading component of the model to obtain the test sample information of the current mutation according to the test sample src before the mutation in the mutation stage under the fixed mutation strategy and the mutation operator used by AFL;

[0024] Step S23: for the deep reinforcement learning model based on the DQN algorithm and the TRPO algorithm in S21, according to the mutation requirements of AFL, a strategy valuation component is designed so that the two algorithm models can output multiple possible effective mutation strategies op and effective mutation positions pos;

[0025] Step S24: for the deep reinforcement learning model based on the DQN algorithm and the TRPO algorithm in S21, according to the interaction requirements between AFL and the model, design an interaction component based on shared memory so that the variant model and AFL can interact efficiently and quickly;

[0026] In the above technical solution, in step S3, the specific steps of constructing the Havoc random mutation model are:

[0027] Step S31: Use Pytorch to implement the exploration-exploitation model based on the Thompson sampling algorithm;

[0028] Step S32: Use a multi-agent strategy to improve the exploration-exploitation model constructed in S31 to improve the accuracy of model prediction and learning efficiency;

[0029] Step S33: locate the position of the Havoc random mutation stage in the AFL source code, design the data reading component of the model according to the src before mutation and the length of the mutation chain in the Havoc random mutation stage, so that the model can obtain the mutation information of the current mutation round;

[0030] Step S34: Design a voting strategy and a self-update strategy for the intelligent agent in the exploration and utilization model based on the improved Thompson sampling algorithm built in S32;

[0031] Step S35: for the exploration and utilization model based on the improved Thompson sampling algorithm built in S32, according to the interaction requirements between AFL and the model, design an interactive component based on shared memory, so that the variant model and AFL can interact efficiently and quickly;

[0032] In the above technical solution, in step S4, the specific steps of embedding the variant model are:

[0033] Step S41: In the mutation stage under the fixed mutation strategy in S17, 16 suitable mutation strategies are selected for modification. For each mutation strategy, the source code of the mutation position selection part of the afl-fuzz.c file is adjusted so that the mutation stage under the fixed mutation strategy can obtain effective mutation information for mutation;

[0034] Step S42: In the Havoc random mutation phase in S17, the multi-round mutation process of the Havoc phase is modified, and the selection method of the mutation strategy and part of the source code are adjusted for each round of mutation chain generation, so that the Havoc random mutation phase can obtain effective mutation information for mutation;

[0035] Step S43: Find the current test sample src and the length of the mutation chain length in the source code of afl-fuzz.c, and pass them as model inputs to the two models constructed in S2 and S3 respectively;

[0036] Step S44: using the shared memory mechanism, the model obtains the model input from the shared memory, and adds the valid variation information obtained by the model to the shared memory;

[0037] Step S45: After each mutation, AFL passes the current valid mutation information to the two constructed models respectively, trains the two models and updates the parameters of the models, and clears the shared memory to ensure that the mutation information does not overflow;

[0038] Step S46: Enter the AFL file directory, use make to recompile the modified file, and then use the sudo make install command to install the modified AFL

[0039] In the above technical solution, in step S5, the specific steps of automated fuzz testing are:

[0040] Step S51: Based on the AFL fuzz testing steps, write an automated tool execution script. The script uses the command afl-fuzz to perform fuzz testing on the application, and uses the afl-showmap and afl-cov commands to analyze the application. In addition, it is necessary to ensure that the script can select different applications for fuzz testing;

[0041] Step S52: For different applications, select the trained model and deploy the server in S4 to call the model;

[0042] Step S53: Create a result file, use the automated tool generated in step S51 to execute the script, select the application currently undergoing fuzz testing and set the fuzz testing time, start the automated fuzz testing, and output the fuzz testing results to the result file;

[0043] In the above technical solution, in step S6, the specific steps of visualizing the results are:

[0044] Step S61: Use a command line to display the fuzz test results generated in step S53 in real time, such as code coverage, number of crashes, fuzz test time, etc.

[0045] Step S62: for the fuzzy test results in the result file in S53, after the fuzzy test is completed, the results are sorted for subsequent analysis;

[0046] Step S63: Use the automation tool in S5 to execute the afl-showmap and afl-cov commands in the script, obtain the fuzz test analysis results after the fuzz test is executed, and generate a code coverage report file.

[0047] Compared with the prior art, the present invention has the following beneficial effects:

[0048] The present invention optimizes the open source fuzz testing framework AFL based on binary program files, realizes program collection, mutation model construction under fixed mutation strategy, Havoc random mutation model construction, model embedding AFL tool, automated fuzz testing and result visualization, etc., improves the code coverage rate in the fuzz testing process, can more effectively predict effective mutation strategies and mutation positions, thereby improving AFL's ability to trigger new paths and mine vulnerabilities, and improving fuzz testing efficiency. From the perspective of the entire technical solution, the present invention establishes a fuzz testing method and process based on a deep reinforcement learning model in the field of binary program file fuzz testing for the first time. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 It is a schematic diagram of the process of the present invention;

[0050] Figure 2 It is a schematic diagram of the program collection flow in the present invention;

[0051] Figure 3 A schematic diagram of the process of constructing a mutation model under a fixed mutation strategy in the present invention;

[0052] Figure 4 A schematic diagram of constructing the Havoc random mutation model in the present invention;

[0053] Figure 5 It is a schematic diagram of embedding the variant model in the present invention;

[0054] Figure 6 This is a schematic diagram of the automated fuzzy testing process in the present invention;

[0055] Figure 7 This is a schematic diagram of the visualization process of the fuzzy test results in the present invention. DETAILED DESCRIPTION

[0056] In order to better illustrate the purpose, technical solutions and advantages of the embodiments of the present invention, the technical solutions 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 only part of the embodiments of the present invention, not all of the embodiments.

[0057] The present invention proposes a fuzz testing method and process based on a deep reinforcement model. By collecting programs, building a model and embedding it into an open source fuzz testing framework, the model is trained in real time during fuzz testing, and finally automated fuzz testing and visualization of test results are achieved. The flowchart is shown in the figure. Figure 1 As shown, the following steps are included:

[0058] Step S1: Collect Linux applications of different formats, store the collected applications in the application file directory, and place seed files of the same format in the same source seed file directory. The flowchart is shown in the following figure. Figure 2 As shown, the following steps are included:

[0059] Step S11: creating a homologous seed file directory for storing seed files based on the same format;

[0060] Step S12: Create an application file directory for storing Linux application files developed based on C language in different formats;

[0061] Step S13: Obtain different C language-based application programs from the Linux official website, and store these application program files in the application program file directory;

[0062] Step S14: using the man command in the Linux system to query execution command parameters of different applications in the application file directory, and obtaining the file formats processed by different applications according to the execution command parameters of different applications and the ReadMe files to which the programs belong, and executing S15;

[0063] Step S15: According to the execution command parameters and corresponding file formats of different applications obtained in S14, a file with the same file format and less than 1 MB is obtained or generated from the source application file or Github as a seed file, and the seed file with the same format is added to the same source seed file directory;

[0064] Step S16: according to the ReadMe file in the application file, use the make command in the Linux system to set the compilation options to implement AFL's instrumentation of the application to be tested, and compile different application files in the application file directory;

[0065] Step S17: Analyze the AFL mutation phase source code, and divide the AFL mutation process into a fixed mutation strategy mutation phase and a Havoc random mutation phase;

[0066] Step S2: Based on the value-oriented DQN algorithm and the strategy-oriented TRPO algorithm, a mutation model under a fixed mutation strategy is constructed to output the effective mutation strategy and effective mutation position information of the test sample. The flowchart is shown in the figure below: Figure 3 As shown, the following steps are included:

[0067] Step S21: Use pytorch to implement a deep reinforcement learning model based on the value-oriented DQN algorithm and the strategy-oriented TRPO algorithm;

[0068] Step S22: locate the position of the mutation stage under the fixed mutation strategy in the AFL source code, and build a data reading component of the model to obtain the test sample information of the current mutation according to the test sample src before the mutation in the mutation stage under the fixed mutation strategy and the mutation operator used by AFL;

[0069] Step S23: for the deep reinforcement learning model based on the DQN algorithm and the TRPO algorithm in S21, according to the mutation requirements of AFL, a strategy valuation component is designed so that the two algorithm models can output multiple possible effective mutation strategies op and effective mutation positions pos;

[0070] Step S24: for the deep reinforcement learning model based on the DQN algorithm and the TRPO algorithm in S21, according to the interaction requirements between AFL and the model, design an interaction component based on shared memory so that the variant model and AFL can interact efficiently and quickly;

[0071] Step S3: Construct the Havoc random mutation model based on the improved Thompson sampling algorithm to output the effective mutation strategy chain information of the test sample. The flowchart is as follows: Figure 4 As shown, the following steps are included:

[0072] Step S31: Use Pytorch to implement the exploration-exploitation model based on the Thompson sampling algorithm;

[0073] Step S32: Use a multi-agent strategy to improve the exploration-exploitation model constructed in S31 to improve the accuracy of model prediction and learning efficiency;

[0074] Step S33: locate the position of the Havoc random mutation stage in the AFL source code, design the data reading component of the model according to the src before mutation and the length of the mutation chain in the Havoc random mutation stage, so that the model can obtain the mutation information of the current mutation round;

[0075] Step S34: Design a voting strategy and a self-update strategy for the intelligent agent in the exploration and utilization model based on the improved Thompson sampling algorithm built in S32;

[0076] Step S35: for the exploration and utilization model based on the improved Thompson sampling algorithm built in S32, according to the interaction requirements between AFL and the model, design an interactive component based on shared memory, so that the variant model and AFL can interact efficiently and quickly;

[0077] Step S4: Modify the source code of AFL, combine the variant model built in S2 and S3, embed it into AFL, and use shared memory to realize the interaction between the model and AFL. The flow chart is as follows: Figure 5 As shown, the following steps are included:

[0078] Step S41: In the mutation stage under the fixed mutation strategy in S17, 16 suitable mutation strategies are selected for modification. For each mutation strategy, the source code of the mutation position selection part of the afl-fuzz.c file is adjusted so that the mutation stage under the fixed mutation strategy can obtain effective mutation information for mutation;

[0079] Step S42: In the Havoc random mutation phase in S17, the multi-round mutation process of the Havoc phase is modified, and the selection method of the mutation strategy and part of the source code are adjusted for each round of mutation chain generation, so that the Havoc random mutation phase can obtain effective mutation information for mutation;

[0080] Step S43: Find the current test sample src and the length of the mutation chain length in the source code of afl-fuzz.c, and pass them as model inputs to the two models constructed in S2 and S3 respectively;

[0081] Step S44: using the shared memory mechanism, the model obtains the model input from the shared memory, and adds the valid variation information obtained by the model to the shared memory;

[0082] Step S45: After each mutation, AFL passes the current valid mutation information to the two constructed models respectively, trains the two models and updates the parameters of the models, and clears the shared memory to ensure that the mutation information does not overflow;

[0083] Step S46: Enter the file directory of AFL, use make to recompile the modified file, and then use the sudo make install command to install the modified AFL;

[0084] Step S5: For the AFL embedded with the variant model in S4, write an automated execution script, set the execution time, execute afl-fuzz, afl-showmap and afl-cov instructions to perform automated fuzz testing, and train the two embedded models. The flowchart is shown in the figure below. Figure 6 As shown, the following steps are included:

[0085] Step S51: Based on the AFL fuzz testing steps, write an automated tool execution script. The script uses the command afl-fuzz to perform fuzz testing on the application, and uses the afl-showmap and afl-cov commands to analyze the application. In addition, it is necessary to ensure that the script can select different applications for fuzz testing;

[0086] Step S52: For different applications, select the trained model and deploy the server in S4 to call the model;

[0087] Step S53: Create a result file, use the automated tool generated in step S51 to execute the script, select the application currently undergoing fuzz testing and set the fuzz testing time, start the automated fuzz testing, and output the fuzz testing results to the result file;

[0088] Step S6: Based on the fuzz test execution results, the code coverage, number of crashes and usage of mutation operators are counted, and the results are visualized. The flowchart is as follows: Figure 7 As shown, the following steps are included:

[0089] Step S61: Use a command line to display the fuzz test results generated in step S53 in real time, such as code coverage, number of crashes, fuzz test time, etc.

[0090] Step S62: for the fuzzy test results in the result file in S53, after the fuzzy test is completed, the results are sorted for subsequent analysis;

[0091] Step S63: Use the automation tool in S5 to execute the afl-showmap and afl-cov commands in the script, obtain the fuzz test analysis results after the fuzz test is executed, and generate a code coverage report file.

Claims

1. A fuzzy testing method and process based on a deep reinforcement learning model, characterized in that It includes the following six steps: program collection, mutation model construction under fixed mutation strategy, Havoc random mutation model construction, mutation model embedding, automated fuzz testing, and result visualization: S1, the program collection step: collecting Linux applications in different formats, storing the collected applications in an application file directory, and placing seed files with the same format in a homologous seed file directory; S2, the step of constructing a mutation model under the fixed mutation strategy: constructing a mutation model under the fixed mutation strategy based on the value-oriented DQN algorithm and the strategy-oriented TRPO algorithm to output effective mutation strategies and effective mutation position information of the test samples; S3, the Havoc random mutation model construction step: constructing a Havoc random mutation model based on an improved Thompson sampling algorithm to output effective mutation strategy chain information of the test sample; S4, the variant model embedding step: modify the source code of AFL, combine the variant model constructed in S2 and S3, embed it into AFL, and use shared memory to realize the interaction between the model and AFL; S5, the automated fuzz testing step: for the AFL embedded with the mutation model in S4, write an automated execution script, set the execution time, execute afl-fuzz, afl-showmap and afl-cov instructions to perform automated fuzz testing, and train the two embedded models; S6, the result visualization step: based on the fuzz test execution results, count the code coverage, number of crashes and usage of mutation operators, and visualize the results.

2. According to the fuzzy testing method and process based on the deep reinforcement learning model described in claim 1, it is characterized in that: In step S1, the program collection step includes the following operations: S11, creating a homologous seed file directory for storing seed files based on the same format; S12, creating an application file directory for storing Linux application files developed based on C language in different formats; S13, obtaining different C language-based application programs from the Linux official website, and storing these application program files in the application program file directory; S14, using the man command in the Linux system to query execution command parameters of different applications in the application file directory, and obtaining file formats processed by different applications according to the execution command parameters of different applications and the ReadMe files to which the programs belong, and executing S15; S15. According to the execution command parameters and corresponding file formats of different applications obtained in S14, a file with the same file format and smaller than 1 MB is obtained or generated from the source application file or Github as a seed file, and the seed file with the same format is added to the same source seed file directory; S16. According to the ReadMe file in the application file, use the make command in the Linux system to set the compilation options to implement AFL's instrumentation of the application to be tested, and compile different application files in the application file directory; S17. Analyze the AFL mutation phase source code and divide the AFL mutation process into the fixed mutation strategy mutation phase and the Havoc random mutation phase.

3. According to a fuzzy testing method and process based on a deep reinforcement learning model as described in claim 1, it is characterized in that: In step S2, the step of constructing a mutation model under the fixed mutation strategy includes the following operations: S21. Use pytorch to implement a deep reinforcement learning model based on the value-oriented DQN algorithm and the strategy-oriented TRPO algorithm; S22, locate the position of the mutation stage under the fixed mutation strategy in the AFL source code, and build a data reading component of the model to obtain the test sample information of the current mutation according to the test sample src before the mutation in the mutation stage under the fixed mutation strategy and the mutation operator used by AFL; S23. For the deep reinforcement learning model based on the DQN algorithm and the TRPO algorithm in S21, according to the mutation requirements of AFL, a strategy valuation component is designed so that the two algorithm models can output multiple possible effective mutation strategies op and effective mutation positions pos; S24. For the deep reinforcement learning model based on the DQN algorithm and the TRPO algorithm in S21, according to the interaction requirements of AFL and the model, a shared memory-based interaction component is designed so that the variant model and AFL can interact efficiently and quickly.

4. According to a fuzzy testing method and process based on a deep reinforcement learning model as described in claim 1, it is characterized in that: In step S3, the Havoc random variation model construction step includes the following operations: S31. Use Pytorch to implement the exploration-exploitation model based on Thompson sampling algorithm; S32: Use a multi-agent strategy to improve the exploration-exploitation model constructed in S31 to improve the accuracy of model prediction and learning efficiency; S33, locate the position of the Havoc random mutation stage in the AFL source code, design the data reading component of the model according to the src before mutation and the length of the mutation chain in the Havoc random mutation stage, so that the model can obtain the mutation information of the current mutation round; S34. Design voting strategies and self-update strategies for the intelligent agents in the exploration and utilization model based on the improved Thompson sampling algorithm built in S32; S35. For the exploration and utilization model based on the improved Thompson sampling algorithm built in S32, according to the interaction requirements of AFL and the model, a shared memory-based interaction component is designed to enable the mutation model and AFL to interact efficiently and quickly.

5. A fuzzy testing method and process based on a deep reinforcement learning model according to claims 1 and 2, characterized in that: In step S4, the variant model embedding step includes the following operations: S41. In the mutation stage under the fixed mutation strategy in S17, 16 suitable mutation strategies are selected for modification. For each mutation strategy, the source code of the mutation position selection part of the afl-fuzz.c file is adjusted so that the mutation stage under the fixed mutation strategy can obtain effective mutation information for mutation; S42. In the Havoc random mutation phase in S17, the multi-round mutation process of the Havoc phase is modified, and the selection method of the mutation strategy and part of the source code are adjusted for the generation of each round of mutation chains, so that the Havoc random mutation phase can obtain effective mutation information for mutation; S43, find the current test sample src and the length of the mutant chain length in the source code of afl-fuzz.c, and pass them as the input of the model to the two models built in S2 and S3 respectively; S44, using the shared memory mechanism, the model obtains the input of the model from the shared memory, and adds the valid variation information obtained by the model to the shared memory; S45. After each mutation, AFL passes the current valid mutation information to the two constructed models respectively, trains the two models and updates the parameters of the models, and clears the shared memory to ensure that the mutation information does not overflow. S46. Enter the file directory of AFL, use make to recompile the modified file, and then use the sudo makeinstall command to install the modified AFL.

6. According to a fuzzy testing method and process based on a deep reinforcement learning model as described in claim 1, it is characterized in that: In step S5, the automated fuzz testing step includes the following operations: S51. Based on the AFL fuzz testing steps, write an automated tool execution script. The script uses the command afl-fuzz to perform fuzz testing on the application, and uses the afl-showmap and afl-cov commands to analyze the application. In addition, it is necessary to ensure that the script can select different applications for fuzz testing; S52, for different applications, select the trained model and deploy the server in S4 to call the model; S53, create a result file, use the automated tool generated in step S51 to execute the script, select the application currently undergoing fuzz testing and set the fuzz testing time, start the automated fuzz testing, and output the fuzz testing results to the result file.

7. According to a fuzzy testing method and process based on a deep reinforcement learning model as described in claim 1, it is characterized in that: In step S6, the result visualization step includes the following operations: S61, using a command line to display the fuzz test results generated in step S53 in real time, such as code coverage, number of crashes, fuzz test time, etc.; S62, for the fuzzy test results in the result file in S53, after the fuzzy test is completed, the results are sorted for subsequent analysis; S63. Use the automation tool in S5 to execute the afl-showmap and afl-cov commands in the script, obtain the fuzz test analysis results after the fuzz test is executed, and generate a code coverage report file.

Citation Information

Patent Citations

  • Optimization method for AFL fuzzy tester seed variation strategy

    CN114610601A

  • Fuzzy test variation strategy updating method and device based on deep learning

    CN117272314A

  • Fuzzy test method, electronic equipment and computer readable storage medium

    CN117435506A

  • Fuzzy test method based on sequence-to-sequence model

    CN118838831A

  • Machine learning for constrained mutation-based FUZZ testing

    US20180365139A1