A method, device and terminal device for constructing a shooting range scene
Through detailed code analysis and logical process analysis of the target software, the shooting range scenarios are built and security risks are identified, and the problem of failure to discover unknown vulnerabilities in the existing technology is solved, more accurate vulnerability identification and security assessment are achieved, and security testing is improved comprehensiveness and responsiveness.
Patent Information
- Application Number
- CN202411310345.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2044-09-19
AI Technical Summary
Existing security testing technologies are difficult to find unknown vulnerabilities in complex code environments and dynamic application scenarios, and cannot fully cover potential security risks, resulting in insufficient security protection measures and increasing the risk of information leakage and device breach.
By analyzing the code of the target software, analyzing the code structure and logical flow, drawing code flow charts, marking key variables and branch decision points, building shooting range scenarios, identifying security risks, designing test scenarios for vulnerabilities, and performing attack and defense drills. Evaluate the impact of vulnerabilities, generate dependency charts, configure automated scripts, and automatically identify and evaluate security vulnerabilities.
It improves the accuracy of vulnerability identification and comprehensiveness of security assessment, enhances the response capabilities to security threats and the effectiveness of defense measures, and improves the practicality and accuracy of shooting range scenario design.
Smart Images

Figure CN118820121B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of safety testing technology, and in particular to a method, device and terminal equipment for constructing a shooting range scene. Background Art
[0002] The field of security testing technology involves various methods, tools and processes to evaluate and improve the security of information devices, networks and software applications. It includes penetration testing, vulnerability scanning, risk assessment and compliance auditing. Security testing aims to identify potential security vulnerabilities and configuration errors to prevent unauthorized access and data leakage. Security testing also helps ensure that the technical environment complies with relevant regulations and industry standards to protect the information security of organizations and individuals.
[0003] The method of constructing a range scenario refers to creating a simulated network environment that is used to test and evaluate the effectiveness of security measures. The range scenario allows security researchers and testers to perform attack and defense drills in a controlled and secure environment without affecting the real production environment. It is mainly used for security training, software testing, device vulnerability identification, etc., and is an important practice in the field of security testing. By building a range, a real-life environment can be provided to cultivate the practical capabilities of network security professionals and help organizations better understand and strengthen security protection measures.
[0004] In actual operation, although existing security testing technologies cover a wide range of security testing methods such as penetration testing and vulnerability scanning, they still face the challenge of discovering security vulnerabilities in complex code environments and dynamic application scenarios. On the one hand, existing security testing technologies rely on preset test scenarios and known vulnerability databases, and lack the ability to actively discover unknown vulnerabilities. Traditional methods cannot accurately identify all potential security risk points when dealing with complex and deep code structures, limiting the comprehensiveness of security assessments. Insufficient security protection measures cannot fully cover all potential risks in real environments, increasing the risk of information leakage and device compromise. It is particularly urgent to improve existing technologies, especially in automation and in-depth analysis, to adapt to the rapid development of information technology and evolving network security threats. Summary of the invention
[0005] The purpose of the present invention is to solve the shortcomings of the prior art and to propose a method, device and terminal equipment for constructing a shooting range scene.
[0006] In order to achieve the above object, the present invention adopts the following technical solution: a method for constructing a shooting range scene, comprising the following steps:
[0007] S1: Analyze the target software code, parse the code structure and logic flow, draw a code flow chart, mark key variables and branch decision points, and obtain a code logic mapping table;
[0008] S2: Based on the code logic mapping table, construct a shooting range scenario by traversing the logic path, apply conditional verification to each path, record the path verification result, and obtain a path execution record;
[0009] S3: Analyze the path execution record, identify the safety hazards on the shooting range scene construction path, mark the vulnerability points, evaluate the security level of the vulnerability points, and establish a vulnerability identification record;
[0010] S4: According to the vulnerability identification record, design a target range scenario for the identified vulnerability, perform scenario testing according to the scenario verification logic, and modify the code according to the test results to obtain a test scenario optimization solution;
[0011] S5: Using the test scenario optimization solution, deconstructing the closed source and unknown software by identifying the key functional components in the target software, drawing a structure diagram of the software by using code and structure dependencies, and identifying code dependency nodes to generate a dependency structure diagram;
[0012] S6: By analyzing the dependency structure diagram, the key security vulnerability points of the target scene are automatically identified, the automation script is configured, the attack and defense drills are executed, the impact of the vulnerability is evaluated, and the security vulnerability impact assessment result is obtained.
[0013] As a further solution of the present invention, the code logic mapping table includes the function name, key variables, branch conditions and associated execution branches of the code, the path execution record includes the path number, verification conditions, execution results and exception types, the vulnerability identification record includes the vulnerability number, vulnerability type, security level and vulnerability location, the test scenario optimization plan includes optimization measures, target vulnerabilities, expected effects and modified code fragments, the dependency structure diagram includes component identification, dependency type and connection relationship between components, and the security vulnerability impact assessment result includes vulnerability exploitation success rate, defense success rate and the overall impact of the vulnerability on the safety of the target range scenario.
[0014] As a further solution of the present invention, the code of the target software is analyzed, the code structure and logic flow are parsed, a code flow chart is drawn, and key variables and branch decision points are marked to obtain the code logic mapping table. Specifically, the steps are as follows:
[0015] S101: Based on the code of the target software, perform code structure analysis, analyze the organization and structure of the code files, extract the definition and calling relationship of key functions and classes, draw a dependency diagram, and obtain a code structure diagram;
[0016] S102: According to the code structure diagram, gradually expand the logic flow of the key function, analyze the execution path inside the function, analyze the initialization and change information of the key variables, and identify the conditions and outputs of the differentiated branch decision points to generate a logic flow chart;
[0017] S103: Using the logic flow chart, marking the relationship between the conditions of the differentiated branch decision points and the key variables, identifying and mapping the impact paths between the variables and the branches, and obtaining a code logic mapping table.
[0018] As a further solution of the present invention, based on the code logic mapping table, by traversing the logic path, constructing the shooting range scene, applying conditional verification to each path, recording the path verification result, and obtaining the path execution record, the specific steps are:
[0019] S201: Design a test scenario of differentiated logic paths using the code logic mapping table, set execution conditions for each logic path, check the area coverage branch decision points of the shooting range scenario, and obtain the shooting range scenario configuration;
[0020] S202: through the shooting range scenario configuration, conditional verification is performed on each logic path, multiple logic paths are executed using set inputs, and output results are monitored to verify that each path runs according to preset conditions, and a conditional verification record is generated;
[0021] S203: Based on the condition verification record, collect and organize the execution results and verification data of each path, analyze the success and failure of the path execution, evaluate the effect of the path execution, and obtain the path execution record.
[0022] As a further solution of the present invention, the path execution record is analyzed to identify the potential safety hazards on the shooting range scene construction path, mark the vulnerability points, and perform a security level assessment on the vulnerability points. The steps of establishing the vulnerability identification record are specifically as follows:
[0023] S301: Analyze the data in the path execution record, identify abnormal indicators and output results, capture key vulnerability points that lead to shooting range scene crash and data leakage, and create an initialization vulnerability annotation table;
[0024] S302: Based on the initialized vulnerability annotation table, analyze the degree of harm of each annotated vulnerability, perform risk rating based on the difficulty of exploiting the vulnerability and the potential impact, and generate a vulnerability risk level table;
[0025] S303: Using the vulnerability risk level table, summarize the vulnerability information of the shooting range scenario, including the vulnerability location, type and security level, formulate and implement related repair measures, and obtain a vulnerability identification record.
[0026] As a further solution of the present invention, according to the vulnerability identification record, a shooting range scenario for the identified vulnerability is designed, according to the scenario verification logic, a scenario test is performed, and the code is modified according to the test results. The steps of obtaining the test scenario optimization solution are specifically as follows:
[0027] S401: Based on the vulnerability identification record, a test scenario is designed to simulate the conditions and environment in which the vulnerability is exploited, and by setting inputs and expected outputs, it is checked that the range scenario can test the identified vulnerability, and a range scenario design plan is created;
[0028] S402: Performing scenario testing according to the shooting range scenario design plan, running in the shooting range scenario using preset inputs, monitoring the response and behavior of the shooting range scenario, recording the deviation between the real-time output and the expected value, and generating a scenario test record;
[0029] S403: Analyze the impact of problems and vulnerabilities in the test through the scenario test records, adjust and optimize the code according to the test results, and fix the security issues identified in the test to obtain a test scenario optimization plan.
[0030] As a further solution of the present invention, the test scenario optimization solution is used to deconstruct closed source and unknown software by identifying key functional components in the target software, and the structure diagram of the software is drawn by using code and structure dependencies, and the code dependency nodes are identified. The steps of generating the dependency structure diagram are specifically as follows:
[0031] S501: using the test scenario optimization solution, identifying the core functional components of the target software, identifying the mechanisms and interface calls of the core functional components, and creating functional component identification records;
[0032] S502: Analyze the code and structure of the software based on the functional component identification record, and generate a software structure diagram based on the known interface and function call relationship and the connection and dependency relationship between components;
[0033] S503: Using the software structure diagram, using differential marks to indicate the code dependency relationship between multiple functional components, extracting key nodes and potential impact paths, visualizing the software dependency structure, and obtaining a dependency structure diagram.
[0034] As a further solution of the present invention, by analyzing the dependency structure diagram, automatically identifying key security vulnerability points in the shooting range scenario, configuring automated scripts, executing attack and defense drills, and evaluating the impact of the vulnerability, the steps of obtaining the security vulnerability impact assessment results are specifically as follows:
[0035] S601: Scan the component dependency relationships in the dependency structure diagram according to the dependency structure diagram, identify potential security vulnerability points between key components, classify the risk levels of the security vulnerabilities, and create an automatic vulnerability identification record;
[0036] S602: using the vulnerability point automatic identification record, adopting a decision tree algorithm, automatically identifying and classifying the vulnerability points in the shooting range scenario, verifying the exploitability of the vulnerability points by configuring and executing simulated attack and defense scripts, and recording the deviation between the output of each exercise and the expectation, and generating an exercise execution record;
[0037] The formula of the decision tree algorithm is as follows:
[0038] ;
[0039] in, represents the weighted conditional entropy, represents the total number of vulnerability type i, X is the set of differentiated vulnerability classifications, To select a category under Target Attack Type t The conditional probability of To select a category under Target Defense Strategy The conditional probability of , w is the weight coefficient, Is a positive number.
[0040] S603: Analyze the outputs of multiple drills through the drill execution records, evaluate the impact of each vulnerability on the range drill, and record the response speed and efficiency of the defense strategy to obtain the security vulnerability impact assessment result.
[0041] A shooting range scene construction device, the shooting range scene construction device is used to execute the shooting range scene construction method, comprising:
[0042] The code analysis module analyzes the target software code structure and logic flow, draws a flow chart, marks key variables and branch decision points, and generates a code logic mapping table;
[0043] The scenario construction module constructs the shooting range scenario according to the logic path based on the code logic mapping table, applies conditional verification to each path, and establishes a path execution record;
[0044] The security assessment module analyzes the path execution record, identifies potential security risks on the scenario construction path, analyzes and evaluates the security level assessment of the vulnerability points, and generates a vulnerability identification record;
[0045] The scenario testing module designs a target scenario for the identified vulnerability based on the vulnerability identification record, performs scenario testing, adjusts the code according to the test feedback, and forms a test scenario optimization plan;
[0046] The structural analysis module utilizes the test scenario optimization scheme to deconstruct key functional components in the target software, draw a software structure diagram, identify code dependency nodes, evaluate the impact of vulnerabilities, and generate security vulnerability impact assessment results.
[0047] A terminal device for constructing a shooting range scene comprises a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the method for constructing the shooting range scene when executing the computer program.
[0048] Compared with the prior art, the advantages and positive effects of the present invention are:
[0049] In the present invention, by analyzing the code structure and logic flow, drawing code flow charts, marking key variables and branch decision points, and traversing the logic path based on the code logic mapping table, the understanding of software behavior is deepened, and the efficiency of vulnerability discovery and repair is enhanced. The use of code flow charts and logic mapping tables is refined to improve the accuracy and practicality of the range scene. The analysis of path execution records makes the range scene construction more targeted, can accurately mark vulnerability points and perform security level assessment, and helps to better simulate attacks and defenses in actual environments. In this way, not only the accuracy of vulnerability identification is improved, but also the assessment of the impact of security vulnerabilities is enhanced, making security testing more comprehensive and in-depth, improving the range scene design in traditional range construction, more in line with actual security threat situations, and improving the organization's response capabilities to security threats and the effectiveness of defense measures. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 It is a schematic diagram of the workflow of the present invention;
[0051] Figure 2 A detailed flow chart of step S1 of the present invention;
[0052] Figure 3 A detailed flow chart of step S2 of the present invention;
[0053] Figure 4 A detailed flow chart of step S3 of the present invention;
[0054] Figure 5 A detailed flow chart of step S4 of the present invention;
[0055] Figure 6 A detailed flow chart of step S5 of the present invention;
[0056] Figure 7 A detailed flow chart of step S6 of the present invention;
[0057] Figure 8 It is a flow chart of the device of the present invention. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0059] In the description of the present invention, it should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, in the description of the present invention, "multiple" means two or more, unless otherwise clearly and specifically defined.
[0060] See also Figure 1 The present invention provides a technical solution: a method for constructing a shooting range scene, comprising the following steps:
[0061] S1: Analyze the target software code, parse the code structure and logic flow, draw a code flow chart, mark key variables and branch decision points, and obtain a code logic mapping table;
[0062] S2: Based on the code logic mapping table, the shooting range scenario is constructed by traversing the logic path, and conditional verification is applied to each path, and the path verification results are recorded to obtain the path execution record;
[0063] S3: Analyze the path execution records, identify the safety hazards on the shooting range scene construction path, mark the vulnerability points, conduct security level assessment on the vulnerability points, and establish vulnerability identification records;
[0064] S4: Based on the vulnerability identification records, design a target scenario for the identified vulnerability, perform scenario testing based on the scenario verification logic, and modify the code based on the test results to obtain a test scenario optimization solution;
[0065] S5: Using the test scenario optimization solution, deconstruct the closed source and unknown software by identifying the key functional components in the target software, draw the software structure diagram by using code and structural dependencies, and identify the code dependency nodes to generate a dependency structure diagram;
[0066] S6: Automatically identify key security vulnerabilities in the target scenario by analyzing the dependency structure diagram, configure automation scripts based on the vulnerabilities, perform attack and defense drills, evaluate the impact of the vulnerabilities, and obtain security vulnerability impact assessment results.
[0067] The code logic mapping table includes the function name, key variables, branch conditions and associated execution branches of the code. The path execution record includes the path number, verification conditions, execution results and exception type. The vulnerability identification record includes the vulnerability number, vulnerability type, security level and vulnerability location. The test scenario optimization plan includes optimization measures, target vulnerabilities, expected effects and modified code snippets. The dependency structure diagram includes component identification, dependency type and connection relationship between components. The security vulnerability impact assessment results include vulnerability exploitation success rate, defense success rate and the overall impact of the vulnerability on the safety of the target range scenario.
[0068] See also Figure 2 , analyze the target software code, parse the code structure and logic flow, draw a code flow chart, and mark key variables and branch decision points. The specific steps to obtain the code logic mapping table are:
[0069] S101: Based on the code of the target software, perform code structure analysis, analyze the organization and structure of the code file, extract the definition and calling relationship of key functions and classes, draw a dependency diagram, and obtain the execution process of the code structure diagram as follows;
[0070] Based on the code of the target software, the files of the entire project are traversed, all source code files are collected, and static analysis tools are applied to each source file to extract class definitions, function definitions, and calling relationships between elements. For each class or function, the calling status of dependent external and internal elements, as well as the scope and life cycle of variables, are recorded. A graphical tool is used to draw a structural diagram of the code, including class and function nodes, as well as dependency and call edges. The size of the nodes in the diagram can be adjusted according to the complexity of the class and function (such as the number of lines or the number of dependencies). The thickness or color of the edge can indicate the calling frequency or dependency strength. Special attention is paid to the relationship between inheritance and interfaces in the code, which plays a key role in high-level architecture design. The specific attributes of each node and edge, such as the number of calls and the type of parameters passed, will be recorded in detail and reflected in the diagram to obtain a code structure diagram. The formula used is:
[0071] ;
[0072] in, Represents the total number of nodes, Indicates the number of files. Indicates the number of functions in the ath file, represents the number of variables, Indicates the number of data types, Indicates the dependency depth, and is the adjustment parameter.
[0073] S102: According to the code structure diagram, the logic flow of the key function is gradually expanded, the execution path inside the function is analyzed, the initialization and change information of the key variables is analyzed, and the conditions and outputs of the differentiated branch decision points are identified, and the execution flow of the generated logic flow diagram is as follows;
[0074] According to the code structure diagram, select key functions for step-by-step decomposition, mark the input parameters and output results of each function, and analyze the logical flow inside the function in detail, including the conditional judgment of each branch, the construction of the loop, and the implementation of exception handling. In order to better understand the behavior of the function, each logical branch will be subdivided, and the changes of key variables in each branch will be recorded. For each branch point, the conditional expression and output result are recorded, which not only shows the structure of the function, but also reflects the execution path under different inputs. For complex functions, it is also necessary to analyze the called external functions, evaluate the impact on the current function behavior, and generate a logical flow chart. The formula used is:
[0075] ;
[0076] in, Represents the process complexity of the function, represents the weight coefficient, represents the number of condition variables, represents the number of output variables, and is the adjustment parameter.
[0077] S103: Using a logic flow chart, the conditions of the differentiated branch decision points and the association relationship between key variables are marked, and the influence path between the variables and branches is identified and mapped, and the execution process of the code logic mapping table is obtained as follows;
[0078] Use a logical flow chart to conduct an in-depth analysis of the conditions of each branch decision point, especially how to control the direction of the process through key variables, list the scope, life cycle and how to affect branch selection of each variable in detail, and verify the accuracy and completeness of the logical flow chart by simulating different input conditions, observing and recording changes in branch decisions. Not only should the correspondence between variables and branches be listed, but also the interaction and dependency between variables should be analyzed. For complex dependencies, it is necessary to use algorithms in graph theory to determine the shortest path or the path with the least impact, and obtain a code logic mapping table. The formula used is:
[0079] ;
[0080] in, Represents the complexity of the mapping table, is the weight coefficient, Indicates the influence of the variable. Indicates the number of branches affected by the variable, is the adjustment parameter.
[0081] See also Figure 3 ,Based on the code logic mapping table, by traversing the logic path, building the shooting range scenario, and applying conditional verification to each path, recording the path verification results, the specific steps of obtaining the path execution record are as follows:
[0082] S201: Design a test scenario of differentiated logic paths using the code logic mapping table, set execution conditions for each logic path, check the area coverage branch decision points of the shooting range scenario, and obtain the execution flow of the shooting range scenario configuration as follows;
[0083] Use the code logic mapping table to analyze the logical differences of different functional modules. The logical differences will serve as the basis for designing test scenarios. Set specific execution conditions for each logical path. The conditions include the type and quantity of inputs and the specific configuration status. The condition setting needs to ensure that various decision branches can be triggered to fully cover the key logic points in the code. Each test scenario is equipped with corresponding resources and environment settings, such as database access rights, external interface simulation, and specific time conditions. It is also necessary to set the expected output results so that they can be checked and verified in the subsequent verification process. By carefully dividing the test scenarios and accurately defining the execution conditions, the test coverage and the ability to discover potential problems can be greatly improved, and the target range scenario configuration can be obtained.
[0084] S202: through the shooting range scenario configuration, conditional verification is performed on each logic path, multiple logic paths are executed using the set input, and the output results are monitored to verify that each path runs according to the preset conditions. The execution process of generating the conditional verification record is as follows;
[0085] Through the target range scenario configuration, conditional verification is performed for each logical path. Multiple logical paths are executed using the set inputs, and the output results are monitored to verify that each path runs according to the preset conditions. An automated test execution framework needs to be built. The framework can automatically load test data according to the configuration file, execute the test, and capture the output results. During the test execution, special attention is paid to the diversity and integrity of the input data to ensure that the test covers all designed scenarios. At the same time, the output results are monitored in real time. Any exceptions or errors need to be recorded and analyzed immediately, including program crashes, data anomalies, or performance issues. Conditional verification records are generated using the formula:
[0086] ;
[0087] in, represents the verification efficiency, represents the complexity of the input conditions, Indicates the conformity of the output result. is the total time taken for verification.
[0088] S203: Based on the condition verification record, collect and organize the execution results and verification data of each path, analyze the success and failure of the path execution, evaluate the effect of the path execution, and obtain the execution process of the path execution record as follows;
[0089] Based on the conditional verification records, the execution results and verification data of each path are collected and organized, the success and failure of the path execution are analyzed, and the effect of the path execution is evaluated. The collected data includes the number of successful executions, the number of failures, the cause analysis of failures, and the number of lines of code covered by the path. By conducting a detailed evaluation of the execution effect of each path, the effectiveness of the test scenario design and the stability of the code implementation can be determined. In particular, for paths that fail frequently, further in-depth analysis of the reasons is required, whether it is due to insufficient test data, incorrect environment configuration, or logical errors in the code itself, and the path execution records are obtained.
[0090] See also Figure 4 , analyze the path execution records, identify the safety hazards on the shooting range scene construction path, mark the vulnerability points, and evaluate the security level of the vulnerability points. The specific steps for establishing vulnerability identification records are:
[0091] S301: Analyze the data in the path execution record, identify abnormal indicators and output results, capture the key vulnerability points that lead to the crash of the shooting range scene and data leakage, and create an initialization vulnerability annotation table. The execution process is as follows;
[0092] To analyze the data in the path execution record, it is necessary to screen out abnormal indicators that deviate from normal behavior. The abnormality is caused by data leakage, access violation or device performance degradation. The output results are carefully reviewed, with special attention paid to serious errors that cause the crash of the shooting range scene. Errors include memory overflow, illegal access and resource lock. For the captured key vulnerability points, the location, trigger conditions and preliminary analysis results of each vulnerability are recorded in detail, including the time and severity level of each vulnerability discovery, to provide data support for subsequent in-depth analysis and repair work, and to identify and record key security vulnerabilities exposed during the test process, laying a solid foundation for further security reinforcement and risk management. Create an initial vulnerability annotation table using the formula:
[0093] ;
[0094] in, A measure of the severity of the vulnerability, represents the number of anomalies identified, Indicates the degree of deviation of the abnormal index h, Indicates the frequency of anomalies.
[0095] S302: Based on the initialization vulnerability annotation table, analyze the degree of harm of each annotated vulnerability, and perform risk rating based on the difficulty of exploiting the vulnerability and the potential impact. The execution process of generating a vulnerability risk level table is as follows;
[0096] Based on the initial vulnerability annotation table, the hazard level of each annotated vulnerability is analyzed, considering the difficulty of exploiting the vulnerability and the potential impact, such as the potential value of data leakage, the impact on device stability or the direct threat to users. A comprehensive assessment is conducted based on the factors, and a certain weight and scoring device are used to perform risk rating. Each vulnerability is sorted according to the risk level. Each vulnerability will be assigned a specific risk level, from low to high, such as from information leakage to device crash, etc., which helps the security team prioritize the high-risk vulnerabilities that are exploited. The risk level can also be used as a basis for communication with partners or regulators to ensure that all stakeholders can understand the current security status of the device and generate a vulnerability risk level table. The formula used is:
[0097] ;
[0098] in, represents the total risk score, Indicates the total number of vulnerabilities, represents the basic risk coefficient of the kth vulnerability, Indicates the potential impact score, Indicates the difficulty of utilization.
[0099] S303: Using the vulnerability risk level table, summarize the vulnerability information of the shooting range scenario, including the vulnerability location, type and security level, formulate and implement the associated repair measures, and obtain the execution process of the vulnerability identification record as follows;
[0100] Use a vulnerability risk level table to summarize vulnerability information for range scenarios, including vulnerability location, type, and security level. Based on the data, develop specific remediation measures, including code corrections, configuration changes, or stricter access controls. When implementing associated remediation measures, ensure that all modifications are adequately tested to verify effectiveness, including re-running the test scenario that previously caused the problem and monitoring the performance of the repaired device to ensure that no new problems are introduced and obtain vulnerability identification records.
[0101] See also Figure 5 , according to the vulnerability identification records, design the target range scenario for the identified vulnerability, perform scenario testing according to the scenario verification logic, and modify the code according to the test results. The specific steps to obtain the test scenario optimization solution are as follows:
[0102] S401: Based on the vulnerability identification record, a test scenario is designed to simulate the conditions and environment in which the vulnerability is exploited. By setting inputs and expected outputs, it is checked that the range scenario can test the identified vulnerability. The execution process of creating a range scenario design plan is as follows;
[0103] Based on the vulnerability identification records, determine the specific vulnerability type to be simulated and the related exploitation conditions. The designed test scenario should be able to reproduce the environment and conditions when the vulnerability is exploited. By setting the input data and expected output in detail, ensure that each test scenario can effectively trigger the corresponding vulnerability in order to verify the security protection measures of the device. It is necessary to describe the configuration details of each scenario in detail, including network settings, device configuration and application configuration, as well as necessary simulated attack tools or scripts. The plan contains all necessary resource links and configuration steps to ensure that the test can be repeated in a controlled environment. It can ensure that the test scenario accurately reflects the security threats in the real world and provide an experimental basis for further security reinforcement. Create a target range scenario design plan using the formula:
[0104] ;
[0105] in, Indicates the complexity of the scene design, Represents the complexity index of each input condition, Indicates the number of designed scenarios.
[0106] S402: According to the shooting range scenario design plan, scenario testing is performed, using preset inputs to run in the shooting range scenario, monitoring the response and behavior of the shooting range scenario, recording the deviation between the real-time output and the expected, and generating the scenario test record. The execution process is as follows;
[0107] According to the shooting range scenario design plan, scenario testing is performed, including loading preset inputs, running test scripts, and monitoring the response and behavior of the device. During the test, the real-time output of the device needs to be recorded and compared with the expected output to capture any deviations or abnormal behaviors. The execution of the test is not only to verify the protection effect of the device against known vulnerabilities, but also to evaluate the device's response ability when facing unknown threats. The date, time, input data, output results and specific information of any abnormalities of each test are recorded in detail to generate scenario test records. The formula used is:
[0108] ;
[0109] in, represents the deviation score between expected and actual output, Indicates the actual output, Indicates the expected output, is the total number of tests.
[0110] S403: Analyze the impact of the problems and vulnerabilities in the test through the scenario test records, adjust and optimize the code according to the test results, and fix the security issues identified in the test, and obtain the execution process of the test scenario optimization plan as follows;
[0111] Through scenario test records, we analyze in detail the specific impacts of problems and vulnerabilities encountered in the test. According to the test results, we adjust and optimize the relevant codes and fix the identified security issues. The process involves code review, modification of existing functions and enhancement of device security protection measures. We record the purpose, implementation steps and expected effects of each change in detail to ensure that each iteration has clear goals and evaluation criteria. This not only helps the team understand and implement changes, but also provides documentation support for future security audits and obtains test scenario optimization plans.
[0112] See also Figure 6 ,Using the test scenario optimization solution, by identifying the key functional components in the target software, deconstructing the closed source and unknown software, using the code and structure dependencies, drawing the structure diagram of the software, and identifying the code dependency nodes. The specific steps to generate the dependency structure diagram are:
[0113] S501: Using the test scenario optimization solution, identifying the core functional components of the target software, identifying the mechanism and interface call of the core functional components, and creating the functional component identification record. The execution process is as follows;
[0114] Utilize the test scenario optimization solution to deeply identify the core functional components of the target software, including core processing modules, key data interaction interfaces, and device-level service components. By analyzing the source code and device documentation, the functional scope, processing mechanism, and interface call details of each component are marked in detail. Special attention is paid to recording the input and output characteristics of the components and the calling relationships between them. Analyze how the components support the main business processes of the software, as well as their status and role in the device architecture. This not only provides a basis for subsequent device maintenance, but also provides a basis for device upgrades and functional expansions. It can ensure a comprehensive and accurate understanding of the core functions of the software, provide important reference information for optimizing and enhancing the software, and create functional component identification records.
[0115] S502: Based on the functional component identification record, the software code and structure are analyzed, and the execution process of generating a software structure diagram using known interfaces and function call relationships and according to the connections and dependencies between components is as follows;
[0116] Based on the functional component identification records, the software code and structure are analyzed to identify the interface calls and functional dependencies between the components. Software engineering tools are used to show in detail the connections and dependencies between the components, as well as the location of each component in the entire device. Special attention is paid to the key data flow and control flow paths, and how they affect the overall performance and stability of the software. Access points for third-party data and external devices are key elements for understanding and optimizing software architecture. They are not only used for internal development and testing, but also important materials for technical exchanges with external partners. The software structure diagram is generated using the formula:
[0117] ;
[0118] in, Indicates the stability index of the software structure. represents the number of connected components, represents the stability score of the jth component, Indicates the dependency depth of a component.
[0119] S503: Using a software structure diagram, using differential markings to indicate code dependencies between multiple functional components, extracting key nodes and potential impact paths, visualizing the software dependency structure, and obtaining the execution flow of the dependency structure diagram as follows;
[0120] The software structure diagram is used to indicate the code dependencies between multiple functional components with differential markings, including key service calls, data sharing interfaces, and performance bottlenecks. Through differential markings, the interaction patterns and potential risk areas between different components can be clearly seen, and key nodes and potential impact paths can be extracted, which is crucial for optimizing device performance and enhancing device safety. It enables developers and project managers to intuitively understand the construction and operation mechanisms of complex devices, helping the team identify high-priority improvement areas and potential refactoring opportunities, and obtain a dependency structure diagram. The formula used is:
[0121] ;
[0122] in, represents the complexity index of the dependency structure, represents the number of nodes z analyzed, Indicates the number of dependencies of a node, Indicates the communication frequency of the node.
[0123] See also Figure 7 , by analyzing the dependency structure diagram, automatically identifying the key security vulnerabilities in the target range scenario, configuring automation scripts, executing attack and defense drills, and evaluating the impact of the vulnerabilities. The specific steps for obtaining the security vulnerability impact assessment results are as follows:
[0124] S601: Scan the component dependency relationships in the dependency structure diagram according to the dependency structure diagram, identify potential security vulnerability points between key components, and classify the risk levels of security vulnerabilities. The execution process of creating an automatic vulnerability identification record is as follows;
[0125] According to the dependency structure diagram, the component dependencies in the diagram are scanned in detail. The goal is to identify potential security vulnerabilities between key components, including improper data access permissions, incorrect interface calls, and configuration errors that lead to data leakage or device crashes. For each identified vulnerability point, the risk level is classified, considering the degree of damage caused and the feasibility of the attack, and the specific location, type, impact and preliminary risk rating of each vulnerability are listed in detail. This not only helps to respond and repair quickly, but also provides data support for the formulation of long-term security strategies. Through scanning and recording processes, the efficiency and effectiveness of security management can be greatly improved, ensuring that the security of key components is continuously monitored and evaluated, and creating automatic identification records of vulnerability points.
[0126] S602: Using the vulnerability point automatic identification record, the decision tree algorithm is used to automatically identify and classify the vulnerability points in the shooting range scenario, and the exploitability of the vulnerability points is verified by configuring and executing simulated attack and defense scripts, and the deviation between the output of each exercise and the expected value is recorded. The execution process of generating the exercise execution record is as follows;
[0127] Utilize the automatic identification record of vulnerability points and adopt the decision tree algorithm to automatically identify and classify the vulnerability points in the shooting range scenario. The process includes setting up simulated attack and defense scripts to test the actual exploitability of the vulnerability points. The scripts are designed according to the type of vulnerability and the expected attack vector to ensure that the vulnerability can be accurately triggered. During the drill, the input and output of each test are recorded, and special attention is paid to recording the deviation between the output of each drill and the expected one. The deviation information is the key data for evaluating the actual harmfulness of the vulnerability and the effectiveness of the defense measures. The configuration, execution process and results of each drill are described in detail. By performing simulated attacks, the response capability of the shooting range defense device and the actual impact of the vulnerability can be effectively verified and evaluated, and the drill execution record can be generated.
[0128] The formula for the decision tree algorithm is as follows:
[0129] ;
[0130] in, represents the weighted conditional entropy, represents the total number of vulnerability type i, X is the set of differentiated vulnerability classifications, To select a category under Target Attack Type t The conditional probability of To select a category under Target Defense Strategy The conditional probability of , w is the weight coefficient, Is a positive number.
[0131] The execution flow is as follows:
[0132] Define the importance of different vulnerability types, assign a weight w to each type, and collect data to calculate the conditional probability based on the attack type t and defense strategy s. and , add a small positive number to the adjusted conditional probability To ensure stability, substitute the value into the formula to calculate the total entropy. To ensure the effectiveness of the weight coefficient w, it is necessary to analyze the losses caused by different vulnerability types and determine the w value for each vulnerability type through statistical analysis to ensure that the weight can reflect the true impact of the vulnerability type and more accurately evaluate the information uncertainty of different types of vulnerabilities.
[0133] S603: Through the drill execution record, the output of multiple drills is analyzed to evaluate the impact of each vulnerability on the range drill, and the response speed and efficiency of the defense strategy are recorded. The execution process of obtaining the security vulnerability impact assessment result is as follows;
[0134] Through the drill execution records, the outputs of multiple drills are carefully analyzed to evaluate the impact of each vulnerability on the range drill, and the response speed and efficiency of the defense strategy are recorded. The analysis results are used to determine which vulnerability is most likely to be exploited and how the defense measures perform in actual operations. Data is collected and organized, including the severity of the vulnerability impact, the response time of the defense measures, and the evaluation of the repair effect, to provide a scientific basis for optimizing the safety performance of the range and formulating future security strategies. Through in-depth analysis of the drill execution records, we can better understand the actual impact of the vulnerability and the overall performance of the safety device, and obtain the security vulnerability impact assessment results.
[0135] See also Figure 8 A shooting range scene construction device, the shooting range scene construction device is used to execute the above shooting range scene construction method, including:
[0136] The code analysis module analyzes the target software code structure and logic flow, draws a flow chart, marks key variables and branch decision points, and generates a code logic mapping table;
[0137] The scenario construction module builds the shooting range scenario according to the logic path based on the code logic mapping table, applies conditional verification to each path, and establishes the path execution record;
[0138] The security assessment module analyzes the path execution records, identifies potential security risks on the scenario construction path, analyzes and evaluates the security level assessment of vulnerability points, and generates vulnerability identification records;
[0139] The scenario testing module designs target scenarios for identified vulnerabilities based on vulnerability identification records, performs scenario testing, makes code adjustments based on test feedback, and forms a test scenario optimization plan;
[0140] The structural analysis module uses the test scenario optimization plan to deconstruct the key functional components in the target software, draw the software structure diagram, identify the code dependency nodes, evaluate the impact of the vulnerability, and generate the security vulnerability impact assessment results.
[0141] A terminal device for constructing a shooting range scene comprises a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the steps of the method for constructing the shooting range scene are implemented.
[0142] The above are only preferred embodiments of the present invention and are not intended to limit the present invention in other forms. Any technician familiar with the profession may use the technical contents disclosed above to change or modify them into equivalent embodiments with equivalent changes and apply them to other fields. However, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention without departing from the technical solution of the present invention still falls within the protection scope of the technical solution of the present invention.
Claims
1. A method for constructing a shooting range scene, characterized in that: The following steps are involved: Analyze the target software code, parse the code structure and logic flow, draw a code flow chart, mark key variables and branch decision points, and obtain a code logic mapping table; Based on the code logic mapping table, by traversing the logic path, constructing a shooting range scenario, and verifying the application conditions of each logic path, recording the logic path verification results, and obtaining the path execution record; Analyze the path execution record, identify the safety hazards on the shooting range scene construction path, mark the vulnerability points, evaluate the security level of the vulnerability points, and establish vulnerability identification records; According to the vulnerability identification records, design a range scenario for the identified vulnerability, perform scenario testing according to the scenario verification logic, and modify the code according to the test results to obtain a test scenario optimization plan; By using the test scenario optimization solution, the closed source and unknown software is deconstructed by identifying the key functional components in the target software, and the structure diagram of the software is drawn by using the code and structure dependencies, and the code dependency nodes are identified to generate a dependency structure diagram; By analyzing the dependency structure diagram, key security vulnerability points in the range scenario are automatically identified, automated scripts are configured, attack and defense drills are performed, the impact of the vulnerability is evaluated, and security vulnerability impact assessment results are obtained; Analyze the target software code, parse the code structure and logic flow, draw a code flow chart, and mark key variables and branch decision points. The specific steps to obtain the code logic mapping table are as follows: Based on the target software code, perform code structure analysis, analyze the organization and structure of code files, extract the definition and calling relationship of key functions and classes, draw dependency diagrams, and obtain code flow charts; According to the code flow chart, the logic flow of the key function is gradually expanded, the execution path within the function is analyzed, the initialization and change information of the key variables is analyzed, and the conditions and outputs of the differentiated branch decision points are identified to generate a logic flow chart; The logic flow chart is used to mark the relationship between the conditions of the differentiated branch decision points and the key variables, identify and map the impact paths between the variables and the branches, and obtain a code logic mapping table; Based on the code logic mapping table, by traversing the logic path, constructing the shooting range scene, and verifying the application conditions of each logic path, recording the logic path verification results, and obtaining the path execution record, the specific steps are: Using the code logic mapping table, design a test scenario of differentiated logic paths, set execution conditions for each logic path, check the area coverage branch decision points of the shooting range scenario, and obtain the shooting range scenario configuration; Through the shooting range scenario configuration, each logic path is verified for application conditions, multiple logic paths are executed using set inputs, and output results are monitored to verify that each logic path runs according to preset application conditions and generate condition verification records; Based on the condition verification record, collect and organize the execution results and verification data of each logic path, analyze the success and failure of the logic path execution, evaluate the effect of the logic path execution, and obtain the path execution record; By analyzing the dependency structure diagram, the key security vulnerability points of the range scenario are automatically identified, the automation script is configured, the attack and defense drills are performed, and the impact of the vulnerability is evaluated. The specific steps for obtaining the security vulnerability impact assessment results are as follows: According to the dependency structure diagram, component dependency relationships in the dependency structure diagram are scanned to identify potential security vulnerability points between key functional components, and the risk levels of the security vulnerability points are classified, and an automatic vulnerability point identification record is created; Using the automatic vulnerability identification record, a decision tree algorithm is used to automatically identify and classify security vulnerability points in the shooting range scenario, and the exploitability of the vulnerability points is verified by configuring and executing simulated attack and defense scripts. The deviation between the output of each exercise and the expectation is recorded, and an exercise execution record is generated; The formula of the decision tree algorithm is as follows: ; in, represents the weighted conditional entropy, represents the total number of vulnerability type i, X is the set of differentiated vulnerability classifications, To select a category under Target Attack Type t The conditional probability of To select a category under Target Defense Strategy The conditional probability of , w is the weight coefficient, is a positive number; Through the drill execution record, the outputs of multiple drills are analyzed, the impact of each vulnerability on the range drill is evaluated, and the response speed and efficiency of the defense strategy are recorded to obtain the security vulnerability impact assessment result.
2. The method for constructing a shooting range scene according to claim 1, characterized in that: The code logic mapping table includes the function name, key variables, branch conditions and associated execution branches of the code, the path execution record includes the path number, verification conditions, execution results and exception types, the vulnerability identification record includes the vulnerability number, vulnerability type, security level and vulnerability location, the test scenario optimization plan includes optimization measures, target vulnerabilities, expected effects and modified code snippets, the dependency structure diagram includes component identification, dependency type and connection relationship between components, and the security vulnerability impact assessment result includes vulnerability exploitation success rate, defense success rate and the overall impact of the vulnerability on the safety of the target range scenario.
3. The method for constructing a shooting range scene according to claim 1, characterized in that: The path execution record is analyzed to identify potential safety hazards on the shooting range scene construction path, mark vulnerability points, and conduct a security level assessment on the vulnerability points. The specific steps of establishing vulnerability identification records are as follows: Analyze the data in the path execution record, identify abnormal indicators and output results, capture key vulnerability points that lead to the crash of the shooting range scene and data leakage, and create an initialization vulnerability annotation table; Based on the initial vulnerability annotation table, analyze the degree of harm of each annotated vulnerability point, perform risk rating based on the difficulty of exploiting the vulnerability and the potential impact, and generate a vulnerability risk level table; The vulnerability risk level table is used to summarize the vulnerability information of the shooting range scenario, including the vulnerability location, type and security level, and the associated repair measures are formulated and implemented to obtain the vulnerability identification record.
4. The method for constructing a shooting range scene according to claim 1, characterized in that: According to the vulnerability identification record, a range scenario is designed for the identified vulnerability. According to the scenario verification logic, scenario testing is performed, and code is modified according to the test results. The specific steps to obtain the test scenario optimization solution are as follows: Based on the vulnerability identification records, design test scenarios to simulate the conditions and environment in which the vulnerabilities are exploited, and verify that the range scenarios can test the identified vulnerabilities by setting inputs and expected outputs, and create range scenario design plans; According to the shooting range scenario design plan, scenario testing is performed, using preset inputs to run in the shooting range scenario, monitoring the response and behavior of the shooting range scenario, recording the deviation between the real-time output and the expected, and generating scenario test records; Through the scenario test records, the impact of problems and vulnerabilities in the test is analyzed, the code is adjusted and optimized according to the test results, and the security issues identified in the test are repaired to obtain a test scenario optimization plan.
5. The method for constructing a shooting range scene according to claim 1, characterized in that: By using the test scenario optimization solution, the closed source and unknown software is deconstructed by identifying the key functional components in the target software, and the structure diagram of the software is drawn by using code and structure dependencies, and the code dependency nodes are identified. The specific steps for generating the dependency structure diagram are as follows: Using the test scenario optimization solution, identify key functional components of the target software, identify the mechanisms and interface calls of the key functional components, and create functional component identification records; Based on the functional component identification record, the software code and structure are analyzed, and a software structure diagram is generated based on the known interface and function call relationship and the connection and dependency relationship between components; The software structure diagram is adopted to indicate the code dependency relationship between multiple functional components with differential markings, extract key nodes and potential impact paths, visualize the dependency structure of the software, and obtain a dependency structure diagram.
6. A device for constructing a shooting range scene, characterized in that: The shooting range scene construction device is used to execute the shooting range scene construction method according to any one of claims 1 to 5, and the device comprises: The code analysis module analyzes the target software code structure and logic flow, draws a code flow chart, marks key variables and branch decision points, and generates a code logic mapping table; The scenario construction module constructs the shooting range scenario according to the logic path based on the code logic mapping table, verifies the application conditions of each logic path, and establishes a path execution record; The safety assessment module analyzes the path execution record, identifies the safety hazards on the shooting range scene construction path, conducts safety level assessment on the vulnerability points, and establishes vulnerability identification records; The scenario testing module designs a target scenario for the identified vulnerability based on the vulnerability identification record, performs scenario testing, adjusts the code according to the test feedback, and forms a test scenario optimization plan; The structural analysis module utilizes the test scenario optimization scheme to deconstruct key functional components in the target software, draw a software structure diagram, identify code dependency nodes, evaluate the impact of vulnerabilities, and generate security vulnerability impact assessment results.
7. A terminal device for constructing a shooting range scene, comprising a memory and a processor, characterized in that: The memory stores a computer program, and when the processor executes the computer program, the steps of the method for constructing a shooting range scene according to any one of claims 1 to 5 are implemented.
