Vehicle-mounted system vulnerability testing method and device, electronic equipment and storage medium
By using t-way coverage combination testing and depth-first search algorithm, the problem of excessively large sample space in vehicle system vulnerability testing is solved, enabling efficient identification of potential security risks and improving testing efficiency and coverage.
Patent Information
- Application Number
- CN202510441198.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2045-04-09
AI Technical Summary
Existing vehicle system vulnerability testing technologies suffer from excessively large sample spaces and low testing efficiency, resulting in an excessive number of test cases and an inability to efficiently identify potential security risks.
The t-way coverage combination testing method is adopted. By analyzing the vulnerability database of the vehicle system, multiple vulnerability categories and the number of each vulnerability category are determined. Based on the preset coverage strategy, a set of target vulnerability combination test cases is generated, and a set of attack paths is constructed using a depth-first search algorithm to identify potential security risks.
It significantly reduces the number of test cases, improves testing efficiency, ensures the comprehensiveness and effectiveness of test cases, and can efficiently identify security risks in vehicle systems.
Smart Images

Figure CN120354414B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of Internet of Vehicles security, and in particular to a vulnerability testing method and device for a vehicle-mounted system, an electronic device and a storage medium. BACKGROUND
[0002] Research on Internet of Vehicles security is a necessary step to improve road traffic safety and implement an intelligent traffic system. Meanwhile, since the Internet of Vehicles system uses wireless communication technology, various devices and communication protocols in the system have vulnerabilities that can be exploited. Therefore, it is urgent to consider the impact of network attacks in Internet of Vehicles related research.
[0003] In related technologies, mainstream vulnerability combination methods include (1) rule-based combination: using predefined rules to identify and combine vulnerabilities. (2) graph theory-based combination: using a graph theory model to represent the relationship between vulnerabilities and discovering vulnerability combinations through graph algorithms. (3) expert system-based combination: using the knowledge base and reasoning mechanism of an expert system to combine vulnerabilities, simulating the way experts analyze vulnerabilities. (4) association rule-based combination: using association rule mining techniques to discover potential associations between vulnerabilities. (5) machine learning-based combination: applying machine learning algorithms such as classification, clustering or anomaly detection algorithms to identify and combine vulnerabilities.
[0004] However, these combination methods all combine all factors, resulting in an excessively large sample space of test cases and relatively low testing efficiency, which needs to be addressed. SUMMARY
[0005] The present application provides a vulnerability testing method and device for a vehicle-mounted system, an electronic device and a storage medium to solve the problem of excessively large sample space and low testing efficiency in existing vulnerability testing technology for vehicle-mounted systems, significantly reducing the number of test cases and thus improving testing efficiency.
[0006] To achieve the above-mentioned purpose, the first aspect embodiment of the present application provides a vulnerability testing method for a vehicle-mounted system, comprising the following steps:
[0007] analyzing the vulnerability library of a target vehicle-mounted system to determine a plurality of vulnerability categories and the number of vulnerabilities contained in each vulnerability category;
[0008] determining a combination coverage degree based on a preset coverage strategy according to the plurality of vulnerability categories and the number of vulnerabilities contained in each vulnerability category, selecting vulnerability categories that meet a preset number as target parameters from the plurality of vulnerability categories according to the combination coverage degree, and generating a target vulnerability combination test case set based on the target parameters;
[0009] Generate a target attack path set based on the target vulnerability combination test case set, and identify a security risk existing in the target vehicle-mounted system by using the target attack path set.
[0010] According to an embodiment of the present application, the selecting a preset number of vulnerability categories as target parameters from the plurality of vulnerability categories according to the combination coverage includes:
[0011] Initialize a test case set;
[0012] Sort the plurality of vulnerability categories according to a preset arrangement rule based on the number of vulnerabilities contained in each vulnerability category, to obtain a sorted parameter set;
[0013] Select the vulnerability categories satisfying the preset number as the target parameters from the sorted parameter set based on a preset sorting condition, and store all cross-category combinations between the target parameters to the initialized test case set, to obtain an initial vulnerability combination test case set;
[0014] Horizontally and / or vertically expand the initial vulnerability combination test case set until the expanded vulnerability combination test case set satisfies a preset coverage condition, to obtain the target vulnerability combination test case set.
[0015] According to an embodiment of the present application, the horizontally and / or vertically expanding the initial vulnerability combination test case set until the expanded vulnerability combination test case set satisfies a preset coverage condition, to obtain the target vulnerability combination test case set, includes:
[0016] Determine a new vulnerability category, and select an optimal vulnerability satisfying a preset condition for each combination in the initial vulnerability combination test case set based on the new vulnerability category, to obtain a horizontally expanded vulnerability combination test case set;
[0017] Determine at least one uncovered combination in a preset t-way combination set based on the horizontally expanded vulnerability combination test case set, and modify at least one combination in the horizontally expanded vulnerability combination test case set or add a new combination to supplement the uncovered combination according to each uncovered combination, until a vertically expanded vulnerability combination test case set satisfies the preset coverage condition;
[0018] Obtain the target vulnerability combination test case set based on the vertically expanded vulnerability combination test case set.
[0019] According to an embodiment of the present application, the generating a target attack path set based on the target vulnerability combination test case set includes:
[0020] determine the association between vulnerabilities based on the vulnerability library of the target vehicle-mounted system;
[0021] According to the association between vulnerabilities, each combination in the target vulnerability combination test case set is traversed to construct an attack chain graph, wherein the nodes of the attack chain graph are vulnerabilities, and the edges of the attack chain graph are the association between vulnerabilities.
[0022] Starting from a preset starting vulnerability, the attack chain graph is traversed using a depth-first search algorithm, each attack path is recorded, and the target attack path set is generated based on each attack path.
[0023] According to an embodiment of the present application, the target attack path set is generated based on each attack path, which includes:
[0024] Based on the each attack path, a de-duplication process is performed to obtain an initial attack path set.
[0025] Attack paths with logical connection relationships in the initial attack path set are merged to obtain an optimized attack path, and the target attack path set is generated based on the optimized attack path.
[0026] According to the vulnerability testing method for vehicle-mounted systems proposed in the embodiments of the present application, by analyzing the vulnerability library of the target vehicle-mounted system, the number of vulnerability categories and the number of vulnerabilities contained in each vulnerability category can be determined. Then, based on the preset coverage strategy, the combination coverage degree can be determined according to the number of vulnerability categories and the number of vulnerabilities contained in each vulnerability category, and the target parameters can be selected from the multiple vulnerability categories that meet the preset number based on the combination coverage degree, and the target vulnerability combination test case set is generated based on the target parameters. Finally, the target attack path set generated based on the target vulnerability combination test case set is used to identify the security risks existing in the target vehicle-mounted system. Therefore, by using the combination test idea to combine and construct the attack chain based on the vehicle-mounted vulnerability library, the problem of large sample space and low test efficiency in the existing vehicle-mounted system vulnerability testing technology is solved, the number of test cases is significantly reduced, and the test efficiency is improved.
[0027] To achieve the above purpose, the second aspect of the present application proposes a vulnerability testing device for a vehicle-mounted system, which comprises:
[0028] The determining module is configured to analyze the vulnerability library of the target vehicle-mounted system, determine the number of vulnerability categories and the number of vulnerabilities contained in each vulnerability category.
[0029] The first generation module is configured to determine a combined coverage degree based on a preset coverage strategy according to the plurality of vulnerability categories and the number of vulnerabilities contained in each vulnerability category, select a preset number of vulnerability categories as target parameters from the plurality of vulnerability categories according to the combined coverage degree, and generate a target vulnerability combination test case set based on the target parameters.
[0030] The second generation module is configured to generate a target attack path set based on the target vulnerability combination test case set, and identify a security risk existing in the target vehicle-mounted system by using the target attack path set.
[0031] According to an embodiment of the present application, the first generation module comprises:
[0032] The initialization unit is configured to initialize a test case set.
[0033] The sorting unit is configured to sort the plurality of vulnerability categories according to a preset arrangement rule based on the number of vulnerabilities contained in each vulnerability category, and obtain a sorting parameter set.
[0034] The first obtaining unit is configured to select the preset number of vulnerability categories as the target parameters from the sorting parameter set based on a preset sorting condition, and store all cross-category combinations between the target parameters to the initialized test case set, and obtain an initial vulnerability combination test case set.
[0035] The second obtaining unit is configured to perform horizontal expansion and / or vertical expansion on the initial vulnerability combination test case set until the expanded vulnerability combination test case set satisfies a preset coverage condition, and obtain the target vulnerability combination test case set.
[0036] According to an embodiment of the present application, the second obtaining unit is specifically configured to:
[0037] Determine a new vulnerability category, and select an optimal vulnerability satisfying a preset condition for each combination in the initial vulnerability combination test case set based on the new vulnerability category, and obtain a horizontally expanded vulnerability combination test case set.
[0038] Determine at least one uncovered combination in a preset t-way combination set based on the horizontally expanded vulnerability combination test case set, modify at least one combination in the horizontally expanded vulnerability combination test case set according to each uncovered combination, or add a new combination to supplement the uncovered combination, until a vertically expanded vulnerability combination test case set satisfies the preset coverage condition.
[0039] Obtain the target vulnerability combination test case set based on the vertically expanded vulnerability combination test case set.
[0040] According to one embodiment of the present application, the second generation module comprises:
[0041] A determination unit is configured to determine the association relationship between the vulnerabilities based on the vulnerability library of the target vehicle-mounted system.
[0042] A construction unit is configured to traverse each combination in the target vulnerability combination test case set according to the association relationship between the vulnerabilities, and construct an attack chain graph, wherein the nodes of the attack chain graph are the vulnerabilities, and the edges of the attack chain graph are the association relationship between the vulnerabilities.
[0043] A generation unit is configured to take a preset starting vulnerability as a starting point, traverse the attack chain graph by using a depth-first search algorithm, record each attack path, and generate the target attack path set based on the each attack path.
[0044] According to one embodiment of the present application, the generation unit is specifically configured to:
[0045] perform a deduplication process based on the each attack path to obtain an initial attack path set;
[0046] merge the attack paths that have a logical connection relationship in the initial attack path set to obtain an optimized attack path, and generate the target attack path set based on the optimized attack path.
[0047] The vulnerability testing device for a vehicle-mounted system provided by the embodiment of the present application can determine a plurality of vulnerability categories and the number of vulnerabilities contained in each vulnerability category by analyzing the vulnerability library of the target vehicle-mounted system. Then, based on a preset coverage strategy, the combination coverage degree can be determined according to the plurality of vulnerability categories and the number of vulnerabilities contained in each vulnerability category, and the vulnerability categories that meet the preset number can be selected as target parameters from the plurality of vulnerability categories according to the combination coverage degree, and the target vulnerability combination test case set is generated based on the target parameters. Finally, the target attack path set generated based on the target vulnerability combination test case set is used to identify the security risks existing in the target vehicle-mounted system. Thus, by using the combination test idea to combine and construct the attack chain based on the vehicle-mounted vulnerability library, the problem of large sample space and low test efficiency in the existing vehicle-mounted system vulnerability testing technology is solved, the number of test cases is significantly reduced, and the test efficiency is improved.
[0048] To achieve the above object, the third aspect of the embodiment of the present application provides an electronic device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the program to implement the vulnerability testing method for a vehicle-mounted system as described in the above embodiments.
[0049] To achieve the above object, a computer readable storage medium is provided in the fourth aspect of the present application, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the vulnerability testing method of the vehicle-mounted system as described in the above embodiments.
[0050] Additional aspects and advantages of the present application will be made apparent by the following description and the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS
[0051] The above and / or additional aspects and advantages of the present application will become apparent and be readily appreciated from the following description, including the accompanying drawings.
[0052] Figure 1 A flowchart of a vulnerability testing method of a vehicle-mounted system according to an embodiment of the present application is provided.
[0053] Figure 2 A schematic diagram of a method for generating a target attack path set according to an embodiment of the present application is provided.
[0054] Figure 3 A schematic diagram of a general architecture for combining and constructing an attack chain of a vehicle-mounted vulnerability according to an embodiment of the present application is provided.
[0055] Figure 4 A flowchart of a vulnerability combination and attack chain screening and merging method according to an embodiment of the present application is provided.
[0056] Figure 5 A block schematic diagram of a vulnerability testing device of a vehicle-mounted system according to an embodiment of the present application is provided.
[0057] Figure 6 A schematic diagram of the structure of an electronic device according to an embodiment of the present application is provided. DETAILED DESCRIPTION
[0058] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, in which the same or similar notations represent the same or similar elements or elements having the same or similar functions. The embodiments described below by referring to the accompanying drawings are exemplary and are intended to explain the present application, and cannot be understood as limiting the present application.
[0059] The vulnerability testing method, device, electronic device and storage medium of a vehicle-mounted system according to an embodiment of the present application are described below with reference to the accompanying drawings. First, the vulnerability testing of a vehicle-mounted system according to an embodiment of the present application will be described with reference to the accompanying drawings.
[0060] Figure 1 A flowchart of a vulnerability testing method of a vehicle-mounted system according to an embodiment of the present application is provided.
[0061] As shown in the example, Figure 1 The vulnerability testing method of the vehicle-mounted system includes the following steps:
[0062] In step S101, the vulnerability library of the target vehicle-mounted system is analyzed to determine a plurality of vulnerability categories and the number of vulnerabilities contained in each vulnerability category.
[0063] It can be understood that the vulnerability library refers to a database that stores information about known vulnerabilities of software or systems. It usually contains detailed descriptions of vulnerabilities, impact scope, repair suggestions, etc. It is an important tool in the field of network security. Vulnerability categories refer to the classification of different vulnerabilities according to their nature, impact or cause. For example, it can be classified according to the system components affected by the vulnerability (such as operating system vulnerabilities, network protocol vulnerabilities, etc.) or according to the cause of the vulnerability (such as input validation errors, improper permission management, etc.).
[0064] Specifically, the embodiments of the present application can select an existing vulnerability library of the target vehicle-mounted system as the research object. By analyzing the vulnerability library, it can be found that the vulnerabilities can be divided into n categories, and the number of vulnerabilities in each vulnerability category is v i , and the vulnerabilities in different categories are significantly different.
[0065] In step S102, based on a preset coverage strategy, the combined coverage is determined according to the plurality of vulnerability categories and the number of vulnerabilities contained in each vulnerability category, and the vulnerability categories that meet the preset number are selected as target parameters from the plurality of vulnerability categories according to the combined coverage. The target vulnerability combination test case set is generated based on the target parameters.
[0066] Among them, the preset coverage strategy refers to the t-way coverage strategy, which aims to ensure that the test case can cover all possible parameter combinations by selecting parameter value combinations, so as to find potential defects and errors. In combinatorial testing, the t-way coverage strategy focuses on all possible combinations of t parameters in the parameter combination, that is, in the presence of N combinable parameters, only the full combination of any t parameters is considered, rather than the full combination of N parameters, thereby significantly reducing the number of test cases. Here, "t" is a user-defined parameter representing the size of the parameter combination in the test case. For example, if a system has four parameters, each with three possible values, the t-way coverage strategy can be used to ensure that all possible two-way combinations (t=2), three-way combinations (t=3), or four-way combinations (t=4) are tested. The advantage of the t-way coverage strategy is that it can effectively find defects caused by multi-parameter interaction with a limited number of test cases, thereby improving the coverage of the test.
[0067] It can be understood that, since there are multiple categories of vulnerabilities in the vehicle-mounted system, and there are various vulnerabilities in different categories, if all factors are combined, the test case sample space will be too large, and the test efficiency will be low. Therefore, the embodiment of the present application proposes a t-way coverage combination test method. At the same time, relevant research shows that the t-way coverage combination test method is a high-efficiency test strategy. After in-depth research and analysis of the defects of various software systems and their influencing factors, the results show that: the defects found in the software system, which are caused by a single factor, account for about 30% to 70%; the defects caused by the interaction of two factors account for more than 70%, and even close to 100%; when the number of factors causing defects increases to three or more, the proportion reaches more than 95%. Based on these data, it can be concluded that using a 6-way coverage combination test method is sufficient to achieve comprehensive coverage of all potential defects in the software system. Therefore, instead of performing full combination testing, using the t-way coverage combination test method is more efficient and economical.
[0068] Specifically, based on the concept of combination testing, the embodiment of the present application uses a preset coverage strategy (i.e., a t-way coverage strategy), and then determines a combination coverage degree according to different vulnerability types and the number of vulnerabilities in each type. The coverage degree can be used to help select a certain number of categories from the many vulnerability categories, and use these categories as target parameters for generating a test case set. Finally, based on these target parameters, a target vulnerability combination test case set is generated, which will be used to guide subsequent vulnerability combination testing work to ensure the comprehensiveness and effectiveness of the testing.
[0069] Next, how to generate the target vulnerability combination test case set will be described in detail.
[0070] As a possible implementation manner, in some embodiments, a preset number of vulnerability categories are selected as target parameters from multiple vulnerability categories according to a combination coverage degree, and a target vulnerability combination test case set is generated based on the target parameters, including: initializing a test case set; sorting multiple vulnerability categories according to a preset arrangement rule based on the number of vulnerabilities contained in each vulnerability category, to obtain a sorted parameter set; selecting a vulnerability category that satisfies a preset number from the sorted parameter set as a target parameter based on a preset sorting condition, and storing all cross-category combinations between the target parameters to the initialized test case set, to obtain an initial vulnerability combination test case set; performing horizontal expansion and / or vertical expansion on the initial vulnerability combination test case set, until the expanded vulnerability combination test case set satisfies a preset coverage condition, to obtain the target vulnerability combination test case set.
[0071] Specifically, first, an empty set can be initialized as a test case set, then, according to the number of vulnerabilities contained in each vulnerability category, multiple vulnerability categories are sorted in a non-decreasing order of the number of vulnerabilities (i.e., a preset arrangement rule), and the first t vulnerability categories are selected from the obtained sorted parameter set as target parameters, and all possible combinations between these target parameters (categories) are saved to the initialized test case set (i.e., the empty set), thereby obtaining an initial vulnerability combination test case set, and each cross-category combination is regarded as a test case.
[0072] For example, assuming that the first two categories, i.e., category 1 (containing vulnerability A and vulnerability B) and category 2 (containing vulnerability C and vulnerability D), are selected from the sorted parameter set as target parameters, the initial vulnerability combination test case set includes: vulnerability A-vulnerability C, vulnerability A-vulnerability D, vulnerability B-vulnerability C, vulnerability B-vulnerability D.
[0073] To ensure that the combinations in the vulnerability combination test case set are more comprehensive, after obtaining the initial vulnerability combination test case set, a combination set that needs to be covered but is not covered can be determined based on the initial vulnerability combination test case set and a preset coverage condition. According to the combination set that is not covered, the initial vulnerability combination test case set can be expanded in a horizontal expansion manner to expand the coverage of the initial vulnerability combination test case set. When the vulnerability combination test case set after horizontal expansion still has combinations that are not covered, the vulnerability combination test case set after horizontal expansion can be further expanded in a vertical expansion manner to expand the coverage of the vulnerability combination test case set after horizontal expansion, until the vulnerability combination test case set after expansion meets the preset coverage condition. At this time, the vulnerability combination test case set that meets the preset coverage condition can be taken as a target vulnerability combination test case set.
[0074] Next, the horizontal expansion process and the vertical expansion process will be described in detail.
[0075] Optionally, in some embodiments, the initial vulnerability combination test case set is horizontally expanded and / or vertically expanded until the vulnerability combination test case set after expansion meets the preset coverage condition, to obtain a target vulnerability combination test case set, including: determining a new vulnerability category, and based on the new vulnerability category, selecting an optimal vulnerability that meets the preset condition for each combination in the initial vulnerability combination test case set, to obtain a vulnerability combination test case set after horizontal expansion; based on the vulnerability combination test case set after horizontal expansion, determining at least one combination in a preset t-way combination set that is not covered, and according to each combination that is not covered, modifying at least one combination in the vulnerability combination test case set after horizontal expansion, or adding a new combination to supplement the combination that is not covered, until the vulnerability combination test case set after vertical expansion meets the preset coverage condition; based on the vulnerability combination test case set after vertical expansion, obtaining the target vulnerability combination test case set.
[0076] It should be noted that the embodiments of the present application can generate vulnerability combinations using ACTS (Advanced Combinatorial Testing System) tool. ACTS is a tool for constructing t-way coverage combinatorial test cases, and is widely used in system combinatorial testing. ACTS supports two test case generation modes: staging and extension. The staging mode allows users to build a test set from scratch, that is, it can not depend on any existing test cases, and start from scratch. The extension mode is to add and modify the existing test set to expand the scope and content of the test set. Although the extension mode is based on the existing test set, it does not mean that it is always more efficient than the staging mode from scratch. In fact, since the extension mode involves adding new parameters, values, and possibly user-imported test cases, these operations may increase additional processing time, resulting in its running efficiency not necessarily higher than the staging mode. Therefore, when selecting which mode to use, users can decide according to the actual testing requirements and conditions. In addition, ACTS can also support the function of variable strength combinatorial testing (Variable Strength Combinatorial Testing Approach, referred to as VSCA). This function allows users to create different strength parameter combinations to cover more or less test scenarios when testing software. In actual testing, some parameter combinations may not be logically reasonable, so users can define constraints to exclude these logically invalid combinations to ensure that the generated test cases only contain those logically reasonable combinations. During the generation of the test case set, ACTS will consider these user-defined constraints, so as to output only the test cases that meet the specific constraint conditions.
[0077] Further, ACTS supports multiple combination coverage from 1-way to 6-way, and provides multiple algorithms such as IPOG (In-Parameter-Order Greedy Algorithm), IPOG-D (In-Parameter-Order Greedy Algorithm with Dynamic Parameter Ordering), IPOG-F (In-Parameter-Order Greedy Algorithm with Fixed Parameter Ordering) and IPOG-F2 (In-Parameter-Order Greedy Algorithm with Fixed Parameter Ordering (version 2)) for user selection. Considering actual needs, embodiments of the present application adopt the 2-way combination coverage function of ACTS, and use the IPOG algorithm to construct a t-way combination test strategy. IPOG is an extended mode-based strategy, which performs horizontal and vertical extensions in each iteration until the generated test case set can cover all combinations.
[0078] Specifically, first, the initial vulnerability combination test case set can be horizontally extended, that is, for the current target parameter, when performing horizontal extension, a new parameter value (i.e., a new vulnerability category) can be added to the initial vulnerability combination test case set to extend the initial vulnerability combination test case set to t+1 target parameters. Based on the new vulnerability category and all vulnerabilities contained in the new vulnerability category, by traversing each combination in the initial vulnerability combination test case set, an optimal vulnerability that satisfies a preset condition (i.e., an optimal value that makes the new test case set cover as many uncovered combinations as possible) can be selected from all vulnerabilities contained in the new vulnerability category for each combination and added to the current combination to generate new combinations, and then the new combinations are added to the initial vulnerability combination test case set, and the combinations that have been covered by the new combinations are removed from the set of combinations that have not been covered (i.e., the preset t-way combination set), and this process can be repeated until the coverage of the horizontally extended vulnerability combination test case set is maximized, ensuring the comprehensiveness of software testing.
[0079] For example, when the initial vulnerability combination test case set is: vulnerability A-vulnerability C, vulnerability A-vulnerability D, vulnerability B-vulnerability C, vulnerability B-vulnerability D, a new vulnerability category is added, which is category 3 (including vulnerability E and vulnerability F), and an optimal vulnerability (vulnerability E or vulnerability F) is selected for each combination in the initial vulnerability combination test case set. Assume that the combinations with the optimal vulnerability of vulnerability E include: vulnerability A-vulnerability C, vulnerability B-vulnerability D, and the combinations with the optimal vulnerability of vulnerability F include: vulnerability A-vulnerability D, vulnerability B-vulnerability C, then the vulnerability combination test case set after horizontal expansion (consisting of new combinations generated) is: vulnerability A-vulnerability C-vulnerability E, vulnerability A-vulnerability D-vulnerability F, vulnerability B-vulnerability C-vulnerability F, and vulnerability B-vulnerability D-vulnerability E. At this time, if the vulnerability combination test case set after horizontal expansion has met the preset coverage condition, the vulnerability combination test case set after horizontal expansion can be used as the target vulnerability combination test case set.
[0080] If the vulnerability combination test case set after horizontal expansion still does not meet the preset coverage condition, at this time, based on the 2-way coverage combination selected by the embodiment of the present application, the covered combinations are: category 1-category 2: vulnerability A-vulnerability C, vulnerability A-vulnerability D, vulnerability B-vulnerability C, vulnerability B-vulnerability D; category 1-category 3: vulnerability A-vulnerability E, vulnerability A-vulnerability F; category 2-category 3: vulnerability C-vulnerability E, vulnerability D-vulnerability F. The combinations that are not covered are: category 1-category 3: vulnerability B-vulnerability E, vulnerability B-vulnerability F; category 2-category 3: vulnerability C-vulnerability F, vulnerability D-vulnerability E.
[0081] It can be understood that the above combinations are not covered because the core of horizontal expansion is to add a new parameter value to the existing combination and select the optimal value to cover as many uncovered combinations as possible. However, in the horizontal expansion stage, these combinations (category 1-category 3: vulnerability B-vulnerability E, vulnerability B-vulnerability F; category 2-category 3: vulnerability C-vulnerability F, vulnerability D-vulnerability E) may not be selected because the selected values (vulnerability E or vulnerability F) have already covered other combinations in priority.
[0082] After horizontal expansion, for the remaining uncovered combinations, coverage can be achieved through vertical expansion mode. Specifically, according to each uncovered combination, it can be detected whether the existing test case can be modified to cover the uncovered combination. If yes, the existing test case can be directly modified; if not, a new test case can be added to cover the uncovered combination. Through vertical expansion, it is ensured that all possible t-way combinations can be covered in the target vulnerability combination test case set.
[0083] In step S103, a target attack path set is generated based on the target vulnerability combination test case set, and the target attack path set is used to identify the security risks existing in the target vehicle-mounted system.
[0084] Specifically, after obtaining the target vulnerability combination test case set, all possible attack paths can be generated by analyzing the relationships between different vulnerabilities, and a target attack path set is obtained, which can help users identify and analyze potential security risks in the target vehicle-mounted system, thereby providing strong support for subsequent security reinforcement and protection measures.
[0085] As a possible implementation, in some embodiments, generating the target attack path set based on the target vulnerability combination test case set includes: determining the association relationship between vulnerabilities based on the vulnerability library of the target vehicle-mounted system; traversing each combination in the target vulnerability combination test case set according to the association relationship between vulnerabilities, and constructing an attack chain graph, wherein the nodes of the attack chain graph are vulnerabilities, and the edges of the attack chain graph are the association relationship between vulnerabilities; taking a preset starting vulnerability as a starting point, traversing the attack chain graph using a depth-first search algorithm, recording each attack path, and generating the target attack path set based on each attack path.
[0086] Specifically, since an attack chain refers to a series of ordered vulnerabilities that can be exploited by attackers to invade computer systems or networks. There is an association between these vulnerabilities, that is, after one vulnerability is exploited, it can create conditions for the exploitation of the next vulnerability, which is called the constraint relationship between vulnerabilities. Therefore, when determining the attack path, first analyze and determine whether there is such an association relationship between two vulnerabilities. If the impact (result set) of a vulnerability contains the conditions (premise set) required for another vulnerability, it indicates that there is a causal relationship between the two vulnerabilities. Based on this association relationship, these vulnerabilities are sequentially connected to form a complete attack path. By traversing each test case in the target vulnerability combination test case set, an attack chain graph can be generated, wherein the nodes of the attack chain graph are vulnerabilities, and the edges of the attack chain graph are the association relationship between vulnerabilities.
[0087] It can be understood that not all combinations have the above-mentioned correlation when considering multiple vulnerability combinations together, and there can be multiple different attack paths in the same vulnerability combination. In order to effectively identify and prevent these potential attacks, a depth-first search algorithm (DFS) can be used to take the preset starting vulnerability as a starting point to filter out all possible attack paths, thereby obtaining a target attack path set. The depth-first search algorithm is an algorithm for traversing or searching a tree or graph, which can search the branches of the tree as deeply as possible. In vulnerability management, this algorithm can help determine which vulnerability combinations and attack paths are truly worth paying attention to, thereby generating an effective attack path list.
[0088] Optionally, in some embodiments, based on each attack path, the target attack path set is generated, including: based on each attack path, performing deduplication processing to obtain an initial attack path set; merging attack paths having a logical connection relationship in the initial attack path set to obtain an optimized attack path, and generating the target attack path set based on the optimized attack path.
[0089] Specifically, when generating the target attack path set, by applying the depth-first search algorithm, the network mapping structure (i.e., the attack chain graph) can be searched in detail to generate all possible attack paths. In order to avoid redundancy in the analysis process, measures can be taken to remove duplicate attack chains, and in addition, attack chains that are logically connected can be merged to simplify the representation of the attack path. Finally, a simplified and non-redundant attack chain set is output as the target attack path set, providing a clear basis for subsequent analysis and defense measures.
[0090] In some embodiments, in order to systematically analyze the relationship between different vulnerabilities and generate possible attack paths, an attack chain generation algorithm based on an XML (Extensible Markup Language) input file is proposed. The algorithm can read data from an atomic attack file describing vulnerabilities, generate possible attack paths according to a defined combination file, and finally output all possible attack chains, as shown in Figure 2 .
[0091] First, the program reads attack description information from a specified XML file. The XML file contains detailed information for each attack step, including preconditions and postconditions. By parsing this information, an initial attack chain list can be generated, representing attack steps and their conditions.
[0092] Secondly, after parsing the XML file and generating the initial attack chain list, the program can read the combination file (i.e., combines file) which describes possible vulnerability combinations. For each combination, the program constructs edges in the attack chain based on the preconditions and postconditions of attack steps. Specifically, the program determines whether the postcondition of one vulnerability satisfies the precondition of another vulnerability, and if so, creates an edge from the former to the latter in the attack chain.
[0093] Finally, to generate complete attack chains, the program can traverse each attack chain using a depth-first search algorithm. After generating the preliminary attack chains, the program can also de-duplicate and merge these attack chains to optimize the structure of the attack chains.
[0094] To further assist those skilled in the art in further understanding the vulnerability testing method of the vehicle-mounted system of the embodiments of the present application, the following further elaboration is made in combination with Figure 3 and Figure 4 .
[0095] The overall architecture diagram of the vehicle-mounted vulnerability combination and attack chain construction proposed by the embodiments of the present application is shown in Figure 3 . This architecture diagram describes the entire process from the vulnerability clustering result to the generation of the final attack chain, mainly including vulnerability clustering result 1, vulnerability combination 2, vulnerability combination result 3, vulnerability list 4, attack chain screening and merging 5, and attack chain 6.
[0096] Vulnerability combination 2 takes vulnerability clustering result 1 as input and outputs vulnerability combination result 3; attack chain screening and merging 5 takes two inputs as the basis: one is all known vulnerability information extracted from vulnerability list 4, and the other is vulnerability combination result 3 derived from vulnerability combination. Through comprehensive analysis of these two inputs, attack chain screening and merging 5 can combine multiple vulnerabilities to construct one or more possible attack chains. These attack chains are based on possible attack paths in actual attack scenarios and aim to simulate how attackers use multiple vulnerabilities to perform coherent attack operations. Attack chain 6 as output is a summary and implementation of the entire process. In the network security of Internet of Vehicles, these attack chains will provide key basis for the formulation of security protection measures. By identifying potential attack paths, complex network attacks can be more effectively prevented and responded to, thereby improving the overall security of Internet of Vehicles systems.
[0097] Figure 4 The flowchart of vulnerability combination and attack chain screening and merging of the embodiments of the present application can include the following steps:
[0098] In step S401, the clustering result generated by vulnerability clustering is taken as input.
[0099] In step S402, the test set is initialized, and the parameters are sorted in a non-decreasing order according to the size of the domain, to obtain a sorted parameter set.
[0100] In step S403, according to the first t parameters after sorting, all possible combinations of the parameters are generated, and the combinations are added to the initialized test set.
[0101] In step S404, new test cases are further generated by horizontal expansion.
[0102] In step S405, if there are still uncovered combinations after horizontal expansion, the system will be corrected by vertical expansion. It is judged whether the existing test cases can cover the uncovered combinations by modification. If yes, step S406 is executed, otherwise step S407 is executed.
[0103] In step S406, the existing test cases are modified.
[0104] In step S407, new test cases are added.
[0105] In step S408, the combination output result is obtained by the vulnerability combination.
[0106] In step S409, the vulnerability list obtained by constructing the vulnerability library and the combination output result are used to traverse the combination result, construct possible attack chain edges, and store the result in a mapping structure.
[0107] In step S410, the mapping structure is searched by using a depth-first search algorithm to generate all possible attack paths.
[0108] In step S411, repeated attack chains are removed, and connected attack chains are merged.
[0109] In step S412, the final attack chain result is obtained by screening and merging the attack chains.
[0110] According to the vulnerability testing method of the vehicle-mounted system provided in the embodiments of the present application, by analyzing the vulnerability library of the target vehicle-mounted system, a plurality of vulnerability categories and the number of vulnerabilities contained in each vulnerability category can be determined; then, based on a preset coverage strategy, the combination coverage can be determined according to the plurality of vulnerability categories and the number of vulnerabilities contained in each vulnerability category, and a vulnerability category meeting a preset number can be selected as a target parameter from the plurality of vulnerability categories according to the combination coverage, and a target vulnerability combination test case set is generated based on the target parameter; finally, a target attack path set generated based on the target vulnerability combination test case set is used to identify the security risks existing in the target vehicle-mounted system. Thus, by using the vehicle-mounted vulnerability library and the combination testing idea to combine and construct an attack chain for the vulnerabilities, the problem of large sample space and low testing efficiency in the existing vehicle-mounted system vulnerability testing technology is solved, the number of test cases is significantly reduced, and the testing efficiency is improved.
[0111] Next, a vulnerability testing device of a vehicle-mounted system according to an embodiment of the present application is described with reference to the accompanying drawings.
[0112] Figure 5 is a block schematic diagram of a vulnerability testing device of a vehicle-mounted system according to an embodiment of the present application.
[0113] As shown in Figure 5 , the vulnerability testing device 10 of the vehicle-mounted system includes a determination module 100, a first generation module 200 and a second generation module 300.
[0114] The determination module 100 is configured to analyze the vulnerability library of the target vehicle-mounted system, determine a plurality of vulnerability categories and the number of vulnerabilities contained in each vulnerability category.
[0115] The first generation module 200 is configured to determine the combination coverage based on a preset coverage strategy according to the plurality of vulnerability categories and the number of vulnerabilities contained in each vulnerability category, select a vulnerability category meeting a preset number as a target parameter from the plurality of vulnerability categories according to the combination coverage, and generate a target vulnerability combination test case set based on the target parameter.
[0116] The second generation module 300 is configured to generate a target attack path set based on the target vulnerability combination test case set, and use the target attack path set to identify the security risks existing in the target vehicle-mounted system.
[0117] Optionally, in some embodiments, the first generation module 200 includes:
[0118] An initialization unit is configured to initialize the test case set.
[0119] A sorting unit is configured to sort the plurality of vulnerability categories according to a preset arrangement rule based on the number of vulnerabilities contained in each vulnerability category, and obtain a sorting parameter set.
[0120] The first obtaining unit is configured to select, from the set of sorting parameters, target parameters that satisfy a preset number of vulnerability categories as target parameters based on a preset sorting condition, and store all cross-category combinations between the target parameters to the initialized test case set to obtain an initial vulnerability combination test case set.
[0121] The second obtaining unit is configured to perform horizontal expansion and / or vertical expansion on the initial vulnerability combination test case set until the expanded vulnerability combination test case set satisfies a preset coverage condition to obtain a target vulnerability combination test case set.
[0122] Optionally, in some embodiments, the second obtaining unit is specifically configured to:
[0123] determine a new vulnerability category, and select, based on the new vulnerability category, an optimal vulnerability that satisfies a preset condition for each combination in the initial vulnerability combination test case set to obtain a horizontally expanded vulnerability combination test case set;
[0124] determine at least one uncovered combination in a preset t-way combination set based on the horizontally expanded vulnerability combination test case set, and modify at least one combination in the horizontally expanded vulnerability combination test case set or add a new combination to supplement the uncovered combination according to each uncovered combination until the vertically expanded vulnerability combination test case set satisfies the preset coverage condition;
[0125] obtain the target vulnerability combination test case set based on the vertically expanded vulnerability combination test case set.
[0126] Optionally, in some embodiments, the second generation module 300 includes:
[0127] The determining unit is configured to determine an association relationship between vulnerabilities based on a vulnerability library of the target vehicle-mounted system.
[0128] The constructing unit is configured to traverse each combination in the target vulnerability combination test case set according to the association relationship between the vulnerabilities to construct an attack chain graph, where a node of the attack chain graph is a vulnerability, and an edge of the attack chain graph is the association relationship between the vulnerabilities.
[0129] The generating unit is configured to take a preset starting vulnerability as a starting point, traverse the attack chain graph by using a depth-first search algorithm, record each attack path, and generate a target attack path set based on each attack path.
[0130] Optionally, in some embodiments, the generating unit is specifically configured to:
[0131] perform deduplication processing based on each attack path to obtain an initial attack path set;
[0132] The attack paths with logical connection relationship in the initial attack path set are merged to obtain an optimized attack path, and a target attack path set is generated based on the optimized attack path.
[0133] It should be noted that the above description of the vulnerability testing method for the vehicle-mounted system also applies to the vulnerability testing device for the vehicle-mounted system of this embodiment, which will not be repeated here.
[0134] The vulnerability testing device for the vehicle-mounted system provided in the embodiments of the present application can determine a plurality of vulnerability categories and the number of vulnerabilities contained in each vulnerability category by analyzing the vulnerability library of the target vehicle-mounted system; then, based on the preset coverage strategy, the combination coverage degree can be determined according to the plurality of vulnerability categories and the number of vulnerabilities contained in each vulnerability category, and the vulnerability categories meeting the preset number are selected as target parameters from the plurality of vulnerability categories according to the combination coverage degree, and the target vulnerability combination test case set is generated based on the target parameters; finally, the target attack path set generated based on the target vulnerability combination test case set is used to identify the security risks existing in the target vehicle-mounted system. Therefore, by using the combination test idea to combine and construct the attack chain based on the vehicle vulnerability library, the problems of large sample space and low test efficiency in the existing vehicle-mounted system vulnerability testing technology are solved, the number of test cases is significantly reduced, and the test efficiency is improved.
[0135] Figure 6 The electronic device provided in the embodiments of the present application is shown in the structural schematic diagram. The electronic device can include:
[0136] The memory 601, the processor 602 and the computer program stored in the memory 601 and executable on the processor 602.
[0137] The processor 602 executes the program to implement the vulnerability testing method for the vehicle-mounted system provided in the above embodiments.
[0138] Further, the electronic device further includes:
[0139] The communication interface 603 is used for communication between the memory 601 and the processor 602.
[0140] The memory 601 is used to store the computer program executable on the processor 602.
[0141] The memory 601 can include a high-speed RAM (Random Access Memory, Random Access Memory) memory, and can also include a non-volatile memory, such as at least one disk memory.
[0142] If the memory 601, the processor 602 and the communication interface 603 are implemented independently, the communication interface 603, the memory 601 and the processor 602 can be connected with each other through a bus and complete communication between each other. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, Figure 6 Only one thick line is used in the figure to represent the bus, but it does not mean that there is only one bus or only one type of bus.
[0143] Optionally, in a specific implementation, if the memory 601, the processor 602 and the communication interface 603 are integrated on a chip, the memory 601, the processor 602 and the communication interface 603 can complete communication between each other through an internal interface.
[0144] The processor 602 can be a CPU (Central Processing Unit), or an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement one or more embodiments of the present application.
[0145] The embodiments of the present application also provide a computer readable storage medium, which stores a computer program, and the program is executed by a processor to implement the vulnerability testing method of the vehicle-mounted system.
[0146] In addition, the terms "first", "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include at least one of the features. In the description of the present application, the meaning of "multiple" is at least two, for example, two, three, etc., unless otherwise explicitly and specifically limited.
[0147] In the description of the specification, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are contained in at least one embodiment or example of the present application. In the specification, the illustrative description of the above terms is not necessarily directed to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any appropriate manner in any one or more embodiments or examples. In addition, the person skilled in the art can combine and combine the different embodiments or examples described in the specification and the features of the different embodiments or examples without contradiction.
[0148] Although the embodiments of the present application have been shown and described above, it is understood that the above-described embodiments are exemplary and are not to be construed as limiting the present application, and the person skilled in the art can make changes, modifications, replacements and variations to the above-described embodiments within the scope of the present application.
Claims
1. A vulnerability test method for an in-vehicle system, characterized by, The method comprises the following steps: analyzing a vulnerability library of a target vehicle-mounted system to determine a plurality of vulnerability categories and a number of vulnerabilities contained in each vulnerability category; based on a preset coverage strategy, determining a combined coverage degree according to the plurality of vulnerability categories and the number of vulnerabilities contained in each vulnerability category, selecting a preset number of vulnerability categories that meet a preset condition as target parameters from the plurality of vulnerability categories according to the combined coverage degree, and generating a target vulnerability combination test case set based on the target parameters; generating a target attack path set based on the target vulnerability combination test case set, and identifying a security risk existing in the target vehicle-mounted system by using the target attack path set; wherein, the step of selecting a preset number of vulnerability categories that meet a preset condition as target parameters from the plurality of vulnerability categories according to the combined coverage degree, and generating a target vulnerability combination test case set based on the target parameters comprises: initializing a test case set, sorting the plurality of vulnerability categories according to a preset arrangement rule based on the number of vulnerabilities contained in each vulnerability category to obtain a sorted parameter set, selecting the preset number of vulnerability categories that meet the preset condition as the target parameters from the sorted parameter set according to a preset sorting condition, and storing all cross-category combinations between the target parameters to the initialized test case set to obtain an initial vulnerability combination test case set, and performing horizontal expansion and / or vertical expansion on the initial vulnerability combination test case set until the expanded vulnerability combination test case set meets a preset coverage condition to obtain the target vulnerability combination test case set.
2. The method of claim 1, wherein, The step of performing horizontal expansion and / or vertical expansion on the initial vulnerability combination test case set until the expanded vulnerability combination test case set meets a preset coverage condition to obtain the target vulnerability combination test case set comprises: determining a new vulnerability category, and selecting an optimal vulnerability that meets a preset condition for each combination in the initial vulnerability combination test case set based on the new vulnerability category to obtain a horizontally expanded vulnerability combination test case set; based on the horizontally expanded vulnerability combination test case set, determining at least one uncovered combination in a preset t-way combination set, and modifying at least one combination in the horizontally expanded vulnerability combination test case set or adding a new combination to supplement the uncovered combination according to each uncovered combination until a vertically expanded vulnerability combination test case set meets the preset coverage condition; based on the vertically expanded vulnerability combination test case set, obtaining the target vulnerability combination test case set.
3. The method of claim 1, wherein, The step of generating a target attack path set based on the target vulnerability combination test case set comprises: determining an association relationship between vulnerabilities based on the vulnerability library of the target vehicle-mounted system; traversing each combination in the target vulnerability combination test case set according to the association relationship between the vulnerabilities to construct an attack chain graph, wherein a node of the attack chain graph is a vulnerability, and an edge of the attack chain graph is the association relationship between the vulnerabilities; Taking a preset starting vulnerability as a starting point, a depth-first search algorithm is used to traverse the attack chain graph, record each attack path, and generate the target attack path set based on each attack path.
4. The method of claim 3, wherein, The generating the target attack path set based on each attack path comprises: Based on each attack path, a de-duplication process is performed to obtain an initial attack path set; Attack paths with logical connection relationships in the initial attack path set are merged to obtain optimized attack paths, and the target attack path set is generated based on the optimized attack paths.
5. A vulnerability testing apparatus for an in-vehicle system, characterized by comprising: Comprising the following steps: The determining module is configured to analyze a vulnerability library of a target vehicle-mounted system, determine a plurality of vulnerability categories and a number of vulnerabilities contained in each vulnerability category; The first generating module is configured to determine a combination coverage degree based on a preset coverage strategy and the plurality of vulnerability categories and the number of vulnerabilities contained in each vulnerability category, select a preset number of vulnerability categories as target parameters from the plurality of vulnerability categories according to the combination coverage degree, and generate a target vulnerability combination test case set based on the target parameters; The second generating module is configured to generate a target attack path set based on the target vulnerability combination test case set, and identify security risks existing in the target vehicle-mounted system by using the target attack path set; The first generating module comprises an initialization unit configured to initialize a test case set, a sorting unit configured to sort the plurality of vulnerability categories according to a preset arrangement rule based on the number of vulnerabilities contained in each vulnerability category to obtain a sorting parameter set, a first obtaining unit configured to select the preset number of vulnerability categories as the target parameters from the sorting parameter set based on a preset sorting condition, and store all cross-category combinations between the target parameters to the initialized test case set to obtain an initial vulnerability combination test case set, and a second obtaining unit configured to perform horizontal expansion and / or vertical expansion on the initial vulnerability combination test case set until the expanded vulnerability combination test case set satisfies a preset coverage condition to obtain the target vulnerability combination test case set.
6. The apparatus of claim 5, wherein, The second obtaining unit is specifically configured to: Determine a new vulnerability category, and select an optimal vulnerability that satisfies a preset condition for each combination in the initial vulnerability combination test case set based on the new vulnerability category to obtain a horizontally expanded vulnerability combination test case set; Based on the horizontally expanded vulnerability combination test case set, determine at least one uncovered combination in a preset t-way combination set, and modify at least one combination in the horizontally expanded vulnerability combination test case set or add a new combination to supplement the uncovered combination according to each uncovered combination until a vertically expanded vulnerability combination test case set satisfies the preset coverage condition; Based on the vertically expanded vulnerability combination test case set, obtain the target vulnerability combination test case set.
7. An electronic device, comprising: Comprising: A memory, a processor, and a computer program stored on the memory and executable on the processor, the processor executing the program to implement the vulnerability testing method of the in-vehicle system according to any one of claims 1-4.
8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor for implementing the vulnerability testing method of the in-vehicle system according to any one of claims 1-4.
Citation Information
Patent Citations
Method and device for testing failure processing of vehicle control unit
CN106155042A
Vehicle information safety automated testing system and method
CN108415398A