Automated vulnerability mining method and system for security protection
By constructing and indexing the target Merkle tree, combined with a low-code development platform and an automated testing library, the problem of manual operation dependence in program vulnerability mining is solved, the efficiency and comprehensiveness of vulnerability mining are improved, and the automated process is realized.
Patent Information
- Application Number
- CN202410718989.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-06-05
AI Technical Summary
The process of discovering program vulnerabilities in the existing technology requires a large amount of manual operations and intervention, resulting in low efficiency and unstable comprehensiveness.
By obtaining the pre-built components and custom code of the target program developed based on the low-code development platform, build the target Merkle tree and enter it into the index library for indexing, determine the similarity to automate vulnerability testing, and calculate the test ratio to select the appropriate vulnerability testing branch.
It improves the comprehensiveness and efficiency of program vulnerability mining and realizes the automation of vulnerability mining.
Smart Images

Figure CN118312968B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to an automated vulnerability mining method and system for security protection. Background Art
[0002] In the field of program vulnerability mining, although the development of automated tools has made some progress, there is still a lot of manual operation and intervention. For example, for large software projects, security teams may need to manually set test parameters, write specific test cases, and analyze test results to identify potential vulnerabilities. These tasks require a lot of time and effort, limiting the efficiency of vulnerability mining.
[0003] In addition, since different testers may have different experiences and expertise, they may have different biases in the process of vulnerability mining, resulting in unstable comprehensiveness of vulnerability mining. Therefore, at the current level of technology, vulnerability mining often needs to combine automated tools and manual operations to ensure a balance between efficiency and comprehensiveness.
[0004] In summary, the existing technology has the technical problem that the program vulnerability mining process requires a lot of manual operation and intervention, resulting in low program vulnerability mining efficiency and the comprehensiveness of vulnerability mining is unstable due to the different degrees of manual intervention. Summary of the invention
[0005] The present application provides an automated vulnerability mining method and system for security protection, which is used to solve the technical problems in the prior art that the program vulnerability mining process requires a large amount of manual operation and intervention, resulting in low program vulnerability mining efficiency and unstable comprehensiveness of vulnerability mining due to different degrees of manual intervention.
[0006] In view of the above problems, the present application provides an automated vulnerability mining method and system for security protection.
[0007] The first aspect of the present application provides an automated vulnerability mining method for security protection, the method comprising: obtaining multiple pre-built components and multiple custom codes of a target program developed based on a low-code development platform, and building a target Merkel tree of the target program, wherein the multiple pre-built components are preset in the low-code development platform for development calls; inputting the target Merkel tree into a development index library for indexing, and determining whether there is an identical pre-built Merkel tree; when the identical pre-built Merkel tree exists, the index obtains the corresponding identical program, and retrieves the vulnerability of the identical program as a vulnerability mining result; when the identical pre-built Merkel tree does not exist, traversing and analyzing the corresponding target Merkel tree and multiple pre-built Merkel trees in the development index library. Similarity, select the pre-built Merkle tree with the largest similarity as the similar Merkle tree, and take the corresponding program as the similar program; according to the similar Merkle tree, calculate the same family development coefficient of the similar program, and calculate the test scarcity coefficient of the target program, and analyze to obtain the first test ratio; obtain the number of vulnerability types of the similar program, and analyze to obtain the second test ratio based on the similarity between the target Merkle tree and the similar Merkle tree; according to the first test ratio and the second test ratio, calculate the test ratio, select the corresponding number of vulnerability test branches in the automated vulnerability test library according to the test ratio, test the target program, and obtain the vulnerability mining result, wherein the vulnerability test library includes multiple vulnerability test branches.
[0008] The second aspect of the present application provides an automated vulnerability mining system for security protection, the system comprising: a Merkle tree construction unit, for obtaining multiple pre-built components and multiple custom codes of a target program developed based on a low-code development platform, and building a target Merkle tree of the target program, wherein the multiple pre-built components are preset in the low-code development platform for development calls; a vulnerability mining execution unit, for inputting the target Merkle tree into a development index library for indexing, and determining whether there is an identical pre-built Merkle tree. When the identical pre-built Merkle tree exists, the index obtains the corresponding identical program, and retrieves the vulnerability of the identical program as a vulnerability mining result; a similar program identification unit, for traversing and analyzing the target Merkle tree and the corresponding pre-built Merkle trees in the development index library when the identical pre-built Merkle tree does not exist. similarity, selecting the pre-built Merkle tree with the largest similarity as the similar Merkle tree, and taking the corresponding program as the similar program; a test ratio analysis unit, used to calculate the same family development coefficient of the similar program according to the similar Merkle tree, and calculate the test scarcity coefficient of the target program, and analyze to obtain the first test ratio; a test ratio acquisition unit, used to obtain the number of vulnerability types of the similar program, and analyze to obtain the second test ratio in combination with the similarity between the target Merkle tree and the similar Merkle tree; a test ratio calculation unit, used to calculate the test ratio according to the first test ratio and the second test ratio, and select a corresponding number of vulnerability test branches in the automated vulnerability test library according to the test ratio, test the target program, and obtain the vulnerability mining result, wherein the vulnerability test library includes multiple vulnerability test branches.
[0009] One or more technical solutions provided in this application have at least the following technical effects or advantages:
[0010] The method provided in the embodiment of the present application constructs a target Merkle tree of the target program by acquiring multiple pre-built components and multiple custom codes of the target program developed based on the low-code development platform, wherein the multiple pre-built components are preset in the low-code development platform for development calls; the target Merkle tree is input into the development index library for indexing, and it is determined whether there is an identical pre-built Merkle tree. When the identical pre-built Merkle tree exists, the index obtains the corresponding identical program, and the vulnerability of the identical program is retrieved as the vulnerability mining result; when the identical pre-built Merkle tree does not exist, the similarity between the target Merkle tree and multiple pre-built Merkle trees in the development index library is traversed and analyzed, and the pre-built Merkle tree with the greatest similarity is selected. Construct a Merkle tree as a similar Merkle tree, and use the corresponding program as a similar program; according to the similar Merkle tree, calculate the same family development coefficient of the similar program, and calculate the test scarcity coefficient of the target program, and analyze to obtain the first test ratio; obtain the number of vulnerability types of the similar program, and analyze and obtain the second test ratio based on the similarity between the target Merkle tree and the similar Merkle tree; calculate the test ratio according to the first test ratio and the second test ratio, and select the corresponding number of vulnerability test branches in the automated vulnerability test library according to the test ratio, test the target program, and obtain the vulnerability mining results, wherein the vulnerability test library includes multiple vulnerability test branches. The technical effect of realizing the automation of program vulnerability mining while improving the comprehensiveness and efficiency of program vulnerability mining is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 A flow chart of the automated vulnerability mining method for security protection provided in this application;
[0012] Figure 2 A schematic diagram of the process of constructing a target Merkle tree in the automated vulnerability mining method for security protection provided by this application;
[0013] Figure 3 A schematic diagram of the structure of the automated vulnerability mining system for security protection provided in this application.
[0014] Explanation of the accompanying drawings: Merkle tree construction unit 1, vulnerability mining execution unit 2, similar program identification unit 3, test ratio analysis unit 4, test ratio acquisition unit 5, test ratio calculation unit 6. DETAILED DESCRIPTION
[0015] The present application provides an automated vulnerability mining method and system for security protection, which is used to solve the technical problems in the prior art that the program vulnerability mining process requires a lot of manual operations and interventions, resulting in low program vulnerability mining efficiency and unstable comprehensiveness of vulnerability mining due to different degrees of manual intervention. The present application achieves the technical effect of realizing the automation of program vulnerability mining while improving the comprehensiveness and efficiency of program vulnerability mining.
[0016] Below, the technical solutions in the present invention will be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments of the present invention. It should be understood that the present invention is not limited to the example embodiments described herein. 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. It should also be noted that, for the convenience of description, only the parts related to the present invention are shown in the accompanying drawings, rather than all of them. Embodiment 1
[0017] like Figure 1 As shown, the present application provides an automated vulnerability mining method for security protection, including:
[0018] A100: Obtain multiple pre-built components and multiple custom codes of a target program developed based on a low-code development platform, and build a target Merkle tree of the target program, wherein the multiple pre-built components are preset in the low-code development platform for development calls.
[0019] In one embodiment, Figure 2 As shown, to construct a target Merkle tree of the target program, the method step A100 provided in the present application further includes:
[0020] A110: Obtain component tag information of the multiple pre-built components, and build multiple leaf-layer nodes of the target Merkle tree in combination with the multiple custom codes.
[0021] A120: Hash multiple component tag information and multiple custom codes to obtain multiple first-layer hash values, and construct multiple first-layer branch nodes of the target Merkle tree.
[0022] A130: Select multiple adjacent groups of first-layer hash values to construct multiple second-layer branch nodes of the target Merkle tree.
[0023] A140: Continue constructing until the root node of the target Merkle tree is obtained, thereby obtaining the target Merkle tree.
[0024] Specifically, it should be understood that the low-code development platform enables developers to build applications at a faster speed by providing preset program components (pre-built components), templates and visualization tools, without having to write a lot of code. Usually, developers only need to do a small amount of custom coding to develop applications using the components and functions provided by the platform. The target program described in this embodiment is a low-code application developed based on the low-code development platform.
[0025] This embodiment directly obtains multiple pre-built components and multiple custom codes for assembling and generating the target program, and constructs a Merkle tree based on the multiple pre-built components and multiple custom codes. The specific process of constructing the Merkle tree is as follows:
[0026] It should be understood that the Merkle tree is a data structure used to effectively verify the data integrity and consistency in large data sets. The structure of the Merkle tree is similar to a binary tree. Leaf nodes are the bottom-level nodes in the Merkle tree and store the hash values of actual data blocks. Data blocks can be files, data records, or other types of data units.
[0027] At the same time, in the Merkle tree, leaf nodes and leaf-layer nodes are the same concept, both of which are nodes used to store the hash values of actual data blocks.
[0028] This embodiment obtains component marking information of multiple pre-built components, and the component marking information may include the name, version number, and parameter setting of the pre-built components. Combined with the multiple component marking information and multiple custom codes of the multiple pre-built components, multiple leaf-layer nodes of the target Merkle tree are constructed, and each leaf-layer node stores the component marking information of a pre-built component or a custom code.
[0029] At the same time, each leaf-layer node is associated with a leaf node. While building the leaf-layer nodes, the pre-built components or custom codes of each leaf-layer node are mapped to the leaf nodes in preparation for subsequent hashing processing.
[0030] Hash processing is performed on multiple component tag information and multiple custom codes to obtain multiple first-layer hash values of the multiple component tag information and multiple first-layer hash values of the multiple custom codes to construct multiple first-layer branch nodes of the target Merkle tree, wherein the multiple leaf-layer nodes and the multiple first-layer branch nodes are connected based on the mapping of the multiple component tag information and the multiple custom codes.
[0031] The order of the multiple leaf-layer nodes depends on the input order of the multiple component tag information and the multiple custom codes when constructing the multiple leaf-layer nodes. The order of the multiple leaf-layer nodes is obtained as the order of the multiple first-layer branch nodes, and the multiple first-layer hash values are mapped and serialized according to the order of the multiple first-layer branch nodes to obtain a first-layer hash value sequence.
[0032] A grouping threshold is preset, and the first-layer hash value sequence is divided based on the grouping threshold to obtain multiple adjacent groups of first-layer hash values, and multiple second-layer branch nodes of the target Merkle tree are constructed based on the multiple groups of first-layer hash values, wherein the ordering of the multiple second-layer branch nodes depends on the adjacent relationship of the multiple groups of first-layer hash values.
[0033] By analogy, the grouping threshold and the order of multiple second-layer branch nodes are used to generate multiple third-layer branch nodes, and the construction is continued until the only root node of the target Merkle tree is obtained, thereby obtaining the target Merkle tree.
[0034] The target Merkle tree constructed in this embodiment can standardize the program and achieve the technical effect of improving the efficiency of searching and automatically mining programs similar to the target program.
[0035] A200: Input the target Merkle tree into the development index library for indexing, and determine whether there is an identical pre-built Merkle tree. When an identical pre-built Merkle tree exists, the index obtains the corresponding identical program, and retrieves the vulnerability of the identical program as the vulnerability mining result.
[0036] In one embodiment, the target Merkle tree is input into the development index library for indexing, and it is determined whether there is an identical pre-built Merkle tree. Step A200 of the method provided by the present application further includes:
[0037] A210: Obtain all historical programs built within the historical period of the low-code development platform.
[0038] A220: Build multiple pre-built Merkle trees based on the pre-built components and custom code within the entire historical program.
[0039] A230: Obtain the vulnerabilities obtained from all historical program tests, index them with the multiple pre-built Merkle trees, and build the development index library.
[0040] A240: Input the target Merkle tree into the development index library for indexing, and determine whether there is an identical pre-built Merkle tree.
[0041] Specifically, in this embodiment, all historical programs built within the historical time of the low-code development platform are obtained; and the same method as steps A110 to A130 is used to construct multiple pre-built Merkle trees of multiple historical programs contained in all historical programs based on the pre-built components and custom codes in all historical programs.
[0042] The vulnerabilities obtained by testing all the historical programs are obtained, wherein the vulnerabilities specifically include multiple historical vulnerabilities of multiple historical programs, and indexes of the multiple historical vulnerabilities and the multiple pre-built Merkle trees are constructed to generate the development index library.
[0043] The target Merkle tree is input into the development index library for indexing, and it is determined whether there is an identical pre-built Merkle tree.
[0044] The method to determine whether a pre-built Merkle tree and the target Merkle tree are the same Merkle tree is as follows:
[0045] For each Merkle tree, starting from the leaf node, the hash value of the parent node is calculated level by level until the hash value of the root node is calculated, and the root node hash value is used as the root hash value of the entire Merkle tree. Compare the root hash values of a pre-built Merkle tree and the target Merkle tree. If they are consistent, the pre-built Merkle tree and the target Merkle tree are the same Merkle tree, and the corresponding historical program is a similar program to the target program.
[0046] On the contrary, if they are inconsistent, the pre-constructed Merkle tree and the target Merkle tree are not the same Merkle tree, and the corresponding historical program has a low similarity with the target program.
[0047] This embodiment judges the similarity between the historical program and the current target program based on the Merkle tree, thereby achieving the technical effect of improving the efficiency and accuracy of program similarity comparison and quickly obtaining similar programs of the target program.
[0048] A300: When there is no identical pre-built Merkle tree, traverse and analyze the similarity between the target Merkle tree and multiple pre-built Merkle trees in the development index library, select the pre-built Merkle tree with the greatest similarity as the similar Merkle tree, and use the corresponding program as the similar program.
[0049] In one embodiment, the similarity between the target Merkle tree and multiple pre-built Merkle trees in the development index library is traversed and analyzed, and the pre-built Merkle tree with the greatest similarity is selected as the similar Merkle tree. Step A300 of the method provided by the present application also includes:
[0050] A310: Obtain a set of sample Merkle tree groups, and obtain a sample similarity set based on the similarity of the program group corresponding to each sample Merkle tree group.
[0051] A320: Using the sample Merkle tree group set and the sample similarity set, construct a program similarity analyzer.
[0052] A330: Using the program similarity analyzer, traverse and combine the target Merkle tree and multiple pre-built Merkle trees to obtain multiple similarities.
[0053] A340: Output the pre-constructed Merkle tree with the largest similarity as the similar Merkle tree, and take the corresponding program as the similar program.
[0054] Specifically, in this embodiment, if multiple root hash values of multiple pre-constructed Merkle trees are all different from the root hash value of the target Merkle tree, it means that there is no identical pre-constructed Merkle tree.
[0055] When there is no identical pre-built Merkle tree, the target Merkle tree and the similarity of multiple pre-built Merkle trees in the development index library are traversed and analyzed. The specific process of Merkle tree similarity analysis is as follows:
[0056] A sample Merkle tree group set is obtained, and a sample similarity set is obtained according to the similarity of the program group corresponding to each sample Merkle tree group, wherein the sample Merkle tree group set includes multiple groups of sample Merkle trees, and each group of sample Merkle trees includes two sample Merkle trees.
[0057] A mapping between the sample Merkle tree group set and the sample similarity set is constructed to obtain a plurality of sample Merkle tree groups-sample similarities.
[0058] A program similarity analyzer is constructed based on a back-propagation neural network. The input of the similarity analyzer is two Merkel trees, and the output is the similarity parameters of the two Merkel trees. Multiple sample Merkel tree groups-sample similarities are divided into a training set, a test set and a validation set according to a 17:2:1 identification. The program similarity analyzer is trained and tested based on the training set and the test, and the similarity analysis accuracy of the program similarity analyzer is verified based on the validation set until the similarity analysis accuracy of the similarity analyzer is stably higher than 98.6%.
[0059] The program similarity analyzer is used to perform traversal and combination analysis on the target Merkle tree and multiple pre-built Merkle trees to obtain multiple similarities. The pre-built Merkle tree with the greatest similarity is output as a similar Merkle tree, and the corresponding program is used as a similar program.
[0060] This embodiment achieves the technical effect of quickly analyzing and obtaining the most similar non-consistent historical programs when there are no pre-constructed Merkle trees and target Merkle trees with consistent root hash values by constructing a program similarity analyzer.
[0061] A400: Based on the similar Merkle tree, calculate the same family development coefficient of the similar program, calculate the test scarcity coefficient of the target program, and analyze to obtain the first test ratio.
[0062] In one embodiment, according to the similar Merkle tree, the same family development coefficient of the similar program is calculated, and the test scarcity coefficient of the target program is calculated, and the first test ratio is obtained by analysis. The method step A400 provided by the present application also includes:
[0063] A410: Based on the similar Merkle tree, traverse and analyze the similarities with multiple other pre-built Merkle trees to obtain multiple historical similarities.
[0064] A420: Obtain the proportion of historical similarities greater than a similarity threshold among the multiple historical similarities as a same-family development coefficient, and calculate to obtain a test scarcity coefficient of the similar program.
[0065] A430: Obtain a set of sample test scarcity coefficients, and obtain a set of sample first test ratios based on the occurrence ratios of vulnerabilities in programs with different test scarcity coefficients, wherein the size of the sample test scarcity coefficient is positively correlated with the size of the sample first test ratio.
[0066] A440: Using the sample test scarcity coefficient set and the sample first test ratio set, construct a first test ratio classifier, classify the test scarcity coefficients, and obtain the first test ratio.
[0067] Specifically, in this embodiment, the program similarity analyzer obtained in step A300 is used to calculate and obtain K historical similarities between the similar Merkle tree and the remaining K pre-constructed Merkle trees in the plurality of pre-constructed Merkle trees.
[0068] A similarity threshold is preset, and the similarity threshold is set based on actual vulnerability testing requirements, and this embodiment does not make specific numerical limitations. The proportion of historical similarities greater than the similarity threshold among the K historical similarities is obtained as the same family development coefficient.
[0069] Subtract the same family development coefficient from 1 as the test scarcity coefficient of the similar program. It should be understood that the larger the same family development coefficient is, the more similar programs are developed and the less scarce the programs are; the smaller the same family coefficient is, the fewer similar programs of the same type are developed and the more scarce the programs are. Correspondingly, the larger the scarcity coefficient is, the scarcer the program is. The scarcer a program is and the fewer similar ones are, the less popular the vulnerabilities it may have are, and more test cases are needed for testing.
[0070] The specific method for determining test cases based on test coefficients is as follows:
[0071] A set of sample test scarcity coefficients is obtained, and a set of sample first test ratios is obtained according to the occurrence ratios of vulnerabilities in programs with different test scarcity coefficients, wherein the size of the sample test scarcity coefficient is positively correlated with the size of the sample first test ratio.
[0072] The percentage of program vulnerabilities refers to the ratio between the number of vulnerabilities in a program and the total amount of program code. It can be used to measure the severity and impact of vulnerabilities in a program. The higher the percentage of program vulnerabilities, the more vulnerabilities there are in the program, and the lower its security and stability. The test ratio of a program refers to the ratio of the amount of code tested to the total amount of code during software testing.
[0073] The sample test scarcity coefficient set and the sample first test ratio set are split to obtain multiple groups of sample test scarcity coefficients-sample first test ratios, and the multiple groups of sample test scarcity coefficients-sample first test ratios are divided into training sets, test sets and validation sets according to the 15:3:2 marking to train the first test ratio classifier constructed based on the back propagation neural network, so as to summarize and analyze the data rules of the test scarcity coefficient and the first test ratio, until the first test ratio output accuracy of the first test ratio classifier is stably higher than 98.3%. Among them, the input of the first test ratio classifier is the test scarcity coefficient, and the output is the first test ratio.
[0074] The test scarcity coefficient of the similar program is synchronized to the first test ratio classifier to perform test ratio analysis to obtain a first test ratio.
[0075] This embodiment is based on calculating the test scarcity coefficient of similar programs and deriving the first test ratio based on the test scarcity coefficient, thereby achieving the technical effect of improving the numerical accuracy of determining the ratio of the amount of tested code to the total amount of code of the target program.
[0076] A500: Obtain the number of vulnerability types of the similar program, combine the similarity between the target Merkle tree and the similar Merkle tree, and analyze to obtain a second test ratio.
[0077] In one embodiment, the number of vulnerability types of the similar program is obtained, and the similarity between the target Merkle tree and the similar Merkle tree is combined to analyze and obtain the test ratio. Step A500 of the method provided by the present application also includes:
[0078] A510: Obtain the number of vulnerability types of the similar program, and obtain the maximum similarity between the target Merkle tree and the similar Merkle tree.
[0079] A520: Obtain the maximum number of vulnerability types in the program developed by the low-code development platform.
[0080] A530: Calculate and obtain a basic second test ratio based on the number of vulnerability types and the maximum number of vulnerability types.
[0081] A540: According to the maximum similarity, compensation calculation is performed on the basic second test ratio to obtain the second test ratio.
[0082] Specifically, in this embodiment, the number of vulnerability types of a program refers to the specific number of different types of vulnerabilities existing in the same program obtained through software testing. This indicator reflects the diversity and complexity of various security and functional issues that may exist in the program.
[0083] The number of vulnerability types of the similar program is obtained, and the similarity between the target Merkle tree and the similar Merkle tree is directly obtained based on the refined content of step A300, where the similarity is the maximum similarity among multiple similarities.
[0084] The low-code development platform is called for historical data to obtain the maximum number of vulnerability types of the development program obtained through historical program development and testing. The number of vulnerability types is used as the numerator and the maximum number of vulnerability types is used as the denominator to calculate the basic second test ratio.
[0085] The basic second test ratio is divided by the maximum similarity to complete compensation calculation and obtain the second test ratio.
[0086] This embodiment achieves the calculation of the coverage ratio of program testing from the dimension of the number of vulnerability types, provides another dimension of reference data for the subsequent determination of the final test ratio of the target program, improves the effectiveness of testing the target program, and ensures the comprehensive technical effect of program vulnerability mining.
[0087] A600: According to the first test ratio and the second test ratio, a test ratio is calculated, and according to the test ratio, a corresponding number of vulnerability test branches are selected in the automated vulnerability test library, and the target program is tested to obtain vulnerability mining results, wherein the vulnerability test library includes multiple vulnerability test branches.
[0088] In one embodiment, a test ratio is calculated according to the first test ratio and the second test ratio, and a corresponding number of vulnerability test branches are selected in the automated vulnerability test library according to the test ratio to test the target program. Step A600 of the method provided by the present application also includes:
[0089] A610: According to the first test ratio and the second test ratio, a test ratio is obtained by weighted calculation.
[0090] A620: Get a collection of sample vulnerability test cases.
[0091] A630: According to a preset construction ratio, randomly select a part of the sample vulnerability test cases in the sample vulnerability test case set as a first sample vulnerability test case set to construct a first vulnerability test branch.
[0092] A640: Continue to build the second vulnerability test branch according to the preset build ratio until multiple vulnerability test branches are obtained to obtain an automated vulnerability test library.
[0093] A650: According to the test ratio, randomly select a corresponding number of vulnerability test branches in the automated vulnerability test library to test the target program.
[0094] Specifically, in this embodiment, weights are assigned to the first test ratio and the second test ratio respectively to obtain the first weight and the second weight. This embodiment does not limit the specific assignment of the first weight and the second weight, but only limits the sum to 1. According to the first test ratio and the second test ratio, the first weight and the second weight are weighted to obtain the test ratio.
[0095] A set of sample vulnerability test cases is obtained, where the set of sample vulnerability test cases includes multiple sample vulnerability test cases, each of which performs targeted testing and identification of a specific type of vulnerability. A test case is a combination of a set of inputs, execution conditions, expected results, and execution steps, and is used to verify whether a specific function of a software program works as expected, and to determine whether a specific type of vulnerability exists based on whether the specific function works as expected.
[0096] According to the preset construction ratio, a portion of the sample vulnerability test cases are randomly selected from the sample vulnerability test case set as the first sample vulnerability test case set to construct a first vulnerability test branch. The second vulnerability test branch is continuously constructed according to the preset construction ratio until multiple vulnerability test branches are obtained, and the sample vulnerability test cases of the multiple vulnerability test branches are non-repetitive and the multiple vulnerability test branches divide up the multiple sample vulnerability test cases. The multiple vulnerability test branches are arranged in parallel to construct an automated vulnerability test library.
[0097] The test ratio is multiplied by the number of branches of the multiple vulnerability test branches and then added to 1, which is used as the specific number of vulnerability test branches activated from the automated vulnerability testing library. Based on the specific number of activated test branches, a corresponding number of vulnerability test branches are randomly selected from the automated vulnerability testing library to test the target program and obtain a target vulnerability set of the target program.
[0098] This embodiment achieves the technical effect of automating the target program vulnerability mining while improving the comprehensiveness and efficiency of the target program vulnerability mining. Embodiment 2
[0099] Based on the same inventive concept as the automated vulnerability mining method for security protection in the aforementioned embodiment, Figure 3 As shown, the present application provides an automated vulnerability mining system for security protection, wherein the system includes:
[0100] A Merkle tree construction unit 1 is used to obtain multiple pre-built components and multiple custom codes of a target program developed based on a low-code development platform, and to build a target Merkle tree of the target program, wherein the multiple pre-built components are preset in the low-code development platform for development calls; a vulnerability mining execution unit 2 is used to input the target Merkle tree into a development index library for indexing, and to determine whether there is an identical pre-built Merkle tree. When an identical pre-built Merkle tree exists, the index obtains the corresponding identical program, and retrieves the vulnerability of the identical program as a vulnerability mining result; a similar program identification unit 3 is used to traverse and analyze the similarity between the target Merkle tree and multiple pre-built Merkle trees in the development index library when an identical pre-built Merkle tree does not exist, and select the pre-built Merkle tree with the greatest similarity as A similar Merkel tree is used, and the corresponding program is used as a similar program; a test ratio analysis unit 4 is used to calculate the same family development coefficient of the similar program according to the similar Merkel tree, and calculate the test scarcity coefficient of the target program, and analyze to obtain a first test ratio; a test ratio acquisition unit 5 is used to obtain the number of vulnerability types of the similar program, and analyze to obtain a second test ratio in combination with the similarity between the target Merkel tree and the similar Merkel tree; a test ratio calculation unit 6 is used to calculate the test ratio according to the first test ratio and the second test ratio, and select a corresponding number of vulnerability test branches in the automated vulnerability test library according to the test ratio, test the target program, and obtain a vulnerability mining result, wherein the vulnerability test library includes multiple vulnerability test branches.
[0101] In one embodiment, the Merkle tree construction unit 1 further includes:
[0102] Obtain component tag information of the multiple pre-built components, and construct multiple leaf-layer nodes of the target Merkle tree in combination with the multiple custom codes; perform hashing on the multiple component tag information and the multiple custom codes to obtain multiple first-layer hash values, and construct multiple first-layer branch nodes of the target Merkle tree; select multiple adjacent groups of first-layer hash values to construct multiple second-layer branch nodes of the target Merkle tree; continue to construct until the root node of the target Merkle tree is obtained, thereby obtaining the target Merkle tree.
[0103] In one embodiment, the vulnerability mining execution unit 2 further includes:
[0104] Obtain all historical programs built within the historical time of the low-code development platform; construct multiple pre-built Merkle trees based on the pre-built components and custom codes in all the historical programs; obtain the vulnerabilities obtained from the testing of all the historical programs, index them with the multiple pre-built Merkle trees, and construct the development index library; input the target Merkle tree into the development index library for indexing, and determine whether there is an identical pre-built Merkle tree.
[0105] In one embodiment, the similar program identification unit 3 further includes:
[0106] A sample Merkel tree group set is obtained, and a sample similarity set is obtained according to the similarity of the program group corresponding to each sample Merkel tree group; a program similarity analyzer is constructed using the sample Merkel tree group set and the sample similarity set; the program similarity analyzer is used to perform traversal combination analysis on the target Merkel tree and multiple pre-constructed Merkel trees to obtain multiple similarities; the pre-constructed Merkel tree with the greatest similarity is output as a similar Merkel tree, and the corresponding program is used as a similar program.
[0107] In one embodiment, the test ratio analysis unit 4 further includes:
[0108] According to the similar Merkle tree, traverse and analyze the similarities with other multiple pre-constructed Merkle trees to obtain multiple historical similarities; obtain the proportion of historical similarities greater than the similarity threshold within the multiple historical similarities as the same family development coefficient, and calculate and obtain the test scarcity coefficient of the similar program; obtain a set of sample test scarcity coefficients, and obtain a set of sample first test ratios based on the occurrence ratio of vulnerabilities in programs with different test scarcity coefficients, wherein the size of the sample test scarcity coefficient is positively correlated with the size of the sample first test ratio; use the sample test scarcity coefficient set and the sample first test ratio set to construct a first test ratio classifier, classify the test scarcity coefficients, and obtain the first test ratio.
[0109] In one embodiment, the test ratio obtaining unit 5 further includes:
[0110] Obtain the number of vulnerability types of the similar program, and obtain the maximum similarity between the target Merkle tree and the similar Merkle tree; obtain the maximum number of vulnerability types of the program developed by the low-code development platform; calculate and obtain a basic second test ratio based on the number of vulnerability types and the maximum number of vulnerability types; perform compensation calculation on the basic second test ratio based on the maximum similarity to obtain the second test ratio.
[0111] In one embodiment, the test ratio calculation unit 6 further includes:
[0112] According to the first test ratio and the second test ratio, a test ratio is obtained by weighted calculation; a set of sample vulnerability test cases is obtained; according to a preset construction ratio, a part of the sample vulnerability test cases in the sample vulnerability test case set is randomly selected as a first sample vulnerability test case set to construct a first vulnerability test branch; the second vulnerability test branch is continued to be constructed according to the preset construction ratio until multiple vulnerability test branches are obtained to obtain an automated vulnerability test library; according to the test ratio, a corresponding number of vulnerability test branches are randomly selected in the automated vulnerability test library to test the target program.
[0113] Any of the methods or steps described above may be stored as computer instructions or programs in various types of computer memories, and the computer instructions or programs may be recognized by various types of computer processors to implement any of the methods or steps described above.
[0114] Based on the above specific embodiments of the present invention, any improvements and modifications made to the present invention by those skilled in the art without departing from the principles of the present invention shall fall within the patent protection scope of the present invention.
Claims
1. An automated vulnerability mining method for security protection, characterized in that: The method comprises: Acquire multiple pre-built components and multiple custom codes of a target program developed based on a low-code development platform, and build a target Merkle tree of the target program, wherein the multiple pre-built components are preset in the low-code development platform for development calls; Input the target Merkle tree into the development index library for indexing, determine whether there is an identical pre-built Merkle tree, and when there is an identical pre-built Merkle tree, obtain the corresponding identical program through the index, and retrieve the vulnerability of the identical program as the vulnerability mining result; When there is no identical pre-built Merkle tree, traverse and analyze the similarity between the target Merkle tree and multiple pre-built Merkle trees in the development index library, select the pre-built Merkle tree with the greatest similarity as the similar Merkle tree, and use the corresponding program as the similar program; According to the similar Merkle tree, the same family development coefficient of the similar program is calculated, and the test scarcity coefficient of the target program is calculated, and a first test ratio is obtained by analysis; Obtaining the number of vulnerability types of the similar program, combining the similarity between the target Merkle tree and the similar Merkle tree, and analyzing to obtain a second test ratio; Calculate a test ratio according to the first test ratio and the second test ratio, select a corresponding number of vulnerability test branches in an automated vulnerability test library according to the test ratio, test the target program, and obtain a vulnerability mining result, wherein the vulnerability test library includes a plurality of vulnerability test branches; The step of calculating the same family development coefficient of the similar program according to the similar Merkle tree, calculating the test scarcity coefficient of the target program, and analyzing to obtain the first test ratio includes: According to the similar Merkle tree, traverse and analyze the similarity with multiple other pre-built Merkle trees to obtain multiple historical similarities; Obtaining a ratio of historical similarities greater than a similarity threshold among the multiple historical similarities as a same-family development coefficient, and calculating and obtaining a test scarcity coefficient of the similar program; Obtain a set of sample test scarcity coefficients, and obtain a set of sample first test ratios according to the occurrence ratios of vulnerabilities in programs with different test scarcity coefficients, wherein the size of the sample test scarcity coefficient is positively correlated with the size of the sample first test ratio; Using the sample test scarcity coefficient set and the sample first test ratio set, constructing a first test ratio classifier, classifying the test scarcity coefficients, and obtaining the first test ratio; The obtaining of the number of vulnerability types of the similar program, combining the similarity between the target Merkle tree and the similar Merkle tree, and analyzing to obtain a second test ratio includes: Obtaining the number of vulnerability types of the similar program, and obtaining the maximum similarity between the target Merkle tree and the similar Merkle tree; Obtain the maximum number of vulnerability types of programs developed by the low-code development platform; Calculate and obtain a basic second test ratio according to the number of vulnerability types and the maximum number of vulnerability types; According to the maximum similarity, a compensation calculation is performed on the basic second test ratio to obtain the second test ratio; The step of calculating a test ratio according to the first test ratio and the second test ratio, selecting a corresponding number of vulnerability test branches in an automated vulnerability test library according to the test ratio, and testing the target program includes: According to the first test ratio and the second test ratio, a test ratio is obtained by weighted calculation; Get a collection of sample vulnerability test cases; According to a preset construction ratio, a portion of sample vulnerability test cases are randomly selected from the sample vulnerability test case set as a first sample vulnerability test case set to construct a first vulnerability test branch; Continue to build the second vulnerability test branch according to the preset building ratio until multiple vulnerability test branches are obtained to obtain an automated vulnerability test library; According to the test ratio, a corresponding number of vulnerability test branches are randomly selected in the automated vulnerability test library to test the target program.
2. The method according to claim 1, characterized in that Build the target Merkle tree of the target program, including: Obtain component tag information of the plurality of pre-built components, and construct a plurality of leaf-layer nodes of a target Merkle tree in combination with the plurality of custom codes; Hash multiple component tag information and multiple custom codes to obtain multiple first-layer hash values, and construct multiple first-layer branch nodes of the target Merkle tree; Select multiple adjacent groups of first-layer hash values to construct multiple second-layer branch nodes of the target Merkle tree; Continue constructing until the root node of the target Merkle tree is obtained, thereby obtaining the target Merkle tree.
3. The method according to claim 1, characterized in that Input the target Merkle tree into the development index library for indexing, and determine whether there is an identical pre-built Merkle tree, including: Obtain all historical programs built within the historical period of the low-code development platform; Building a plurality of pre-built Merkle trees based on pre-built components and custom code within the entire historical program; Obtaining the vulnerabilities obtained from all historical program tests, indexing them with the multiple pre-built Merkle trees, and building the development index library; The target Merkle tree is input into the development index library for indexing, and it is determined whether there is an identical pre-built Merkle tree.
4. The method according to claim 1, characterized in that: Traversing and analyzing the similarity between the target Merkle tree and multiple pre-built Merkle trees in the development index library, and selecting the pre-built Merkle tree with the greatest similarity as the similar Merkle tree, including: Obtain a sample Merkle tree group set, and obtain a sample similarity set according to the similarity of the program group corresponding to each sample Merkle tree group; Using the sample Merkle tree group set and the sample similarity set, construct a program similarity analyzer; Using the program similarity analyzer, traversing and combining the target Merkle tree and a plurality of pre-built Merkle trees to obtain a plurality of similarities; The pre-constructed Merkle tree with the greatest similarity is output as the similar Merkle tree, and the corresponding program is taken as the similar program.
5. An automated vulnerability mining system for security protection, characterized in that: The steps for implementing the method according to any one of claims 1 to 4 include: A Merkle tree construction unit, used to obtain a plurality of pre-built components and a plurality of custom codes of a target program developed based on a low-code development platform, and to construct a target Merkle tree of the target program, wherein the plurality of pre-built components are preset in the low-code development platform for development calls; A vulnerability mining execution unit is used to input the target Merkle tree into a development index library for indexing, determine whether there is an identical pre-built Merkle tree, and when there is an identical pre-built Merkle tree, obtain the corresponding identical program through indexing, and retrieve the vulnerability of the identical program as a vulnerability mining result; A similar program identification unit is used to traverse and analyze the similarity between the target Merkle tree and multiple pre-built Merkle trees in the development index library when there is no identical pre-built Merkle tree, select the pre-built Merkle tree with the greatest similarity as the similar Merkle tree, and use the corresponding program as the similar program; A test ratio analysis unit, used for calculating the same family development coefficient of the similar program according to the similar Merkle tree, and calculating the test scarcity coefficient of the target program, and analyzing to obtain a first test ratio; A test ratio obtaining unit, used to obtain the number of vulnerability types of the similar program, and analyze and obtain a second test ratio based on the similarity between the target Merkle tree and the similar Merkle tree; A test ratio calculation unit is used to calculate the test ratio according to the first test ratio and the second test ratio, select a corresponding number of vulnerability test branches in the automated vulnerability test library according to the test ratio, test the target program, and obtain vulnerability mining results, wherein the vulnerability test library includes multiple vulnerability test branches.
Citation Information
Patent Citations
Dynamic symbol execution path searching method for finding vulnerabilities
CN104008053A
Vulnerability fingerprint silent analysis monitoring method, system, device and medium
CN113946826A
Block chain intelligent control network data security vulnerability mining method and system
CN114760155A
Real-time operating system driver vulnerability mining system and method based on similarity analysis
CN117909984A
