Protocol fuzz testing method and device based on automatic equipment detection
By using automated equipment detection technology in protocol fuzz testing, the equipment to be tested is automatically identified and configured, which solves the high cost and inefficiency problems caused by manual configuration in traditional methods, and achieves more efficient and accurate test results.
Patent Information
- Application Number
- CN202510224866.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-05-23
AI Technical Summary
The traditional protocol fuzz testing method requires manual configuration of relevant information of the device being tested, resulting in high labor costs and frequent configuration errors, which reduces testing efficiency and accuracy.
The protocol fuzz testing method based on automation equipment detection is adopted, and the equipment to be tested is searched and identified in the target communication network through automation equipment detection technology, equipment attribute information is obtained, and configuration information of the protocol fuzz testing task is generated based on this information.
No manual configuration required by the operator reduces operational complexity and configuration error possibility and improves the efficiency and accuracy of protocol fuzzing.
Smart Images

Figure CN120034471A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of security testing technology, and in particular to a protocol fuzzy testing method and device based on automated device detection. Background Art
[0002] In the field of security testing technology, abnormal information is generated through a protocol fuzzy testing method, and security detection is performed on the device under test based on the abnormal information.
[0003] However, in traditional protocol fuzz testing methods, testers are required to manually configure relevant information of the device under test. On the one hand, this greatly increases labor costs. On the other hand, configuration errors are very likely to occur, resulting in blockage of the test process or deviation in test results, thereby reducing test efficiency and accuracy. Summary of the invention
[0004] Based on this, it is necessary to provide a protocol fuzz testing method, device, computer equipment and computer-readable storage medium based on automated equipment detection to improve the efficiency and accuracy of protocol fuzz testing in response to the above technical problems.
[0005] In a first aspect, the present application provides a protocol fuzz testing method based on automated device detection, comprising: Based on the automated device detection technology, the device to be tested is searched and identified in a preset detection mode in a target communication network, and the device attribute information of the device to be tested is obtained, wherein the target communication network includes one of a Bluetooth communication network and a WiFi communication network; Generate a protocol fuzzy test task corresponding to the device to be tested, parse the device attribute information of the device to be tested based on the test items in the protocol fuzzy test task, and obtain the configuration information of the protocol fuzzy test task; By executing a protocol fuzzy test task including the configuration information, protocol fuzzy test data is generated and sent to the device to be tested via the target communication network, a protocol fuzzy test result returned by the device to be tested based on the protocol fuzzy test data is obtained.
[0006] In a second aspect, the present application also provides a protocol fuzzy testing device based on automated device detection, comprising: An acquisition module is used to search and identify the device to be tested in a target communication network through a preset detection method based on an automated device detection technology, and obtain device attribute information of the device to be tested, wherein the target communication network includes one of a Bluetooth communication network and a WiFi communication network; A task generation module, used to generate a protocol fuzzy test task corresponding to the device to be tested, and to parse the device attribute information of the device to be tested based on the test items in the protocol fuzzy test task to obtain the configuration information of the protocol fuzzy test task; A task execution module is used to generate protocol fuzzy test data by executing a protocol fuzzy test task containing the configuration information, and send the protocol fuzzy test data to the device to be tested through the target communication network, so as to obtain a protocol fuzzy test result returned by the device to be tested based on the protocol fuzzy test data.
[0007] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the above steps when executing the computer program.
[0008] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the above steps when executed by a processor.
[0009] The above-mentioned protocol fuzzy testing method, device, computer equipment and computer-readable storage medium based on automated device detection, through automated device detection technology, automatically and adaptively search and identify the devices to be tested and device attribute information in the target communication network, and efficiently and accurately obtain the configuration information of the protocol fuzzy testing task based on the analysis of the device attribute information. By executing the protocol fuzzy testing task containing the configuration information, the protocol fuzzy testing results corresponding to the devices to be tested can be reliably obtained. Based on this, there is no need for manual configuration by the operator, which reduces the complexity of operation and the possibility of configuration errors, and improves the efficiency and accuracy of the protocol fuzzy testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0011] Figure 1 A schematic diagram of a flow chart of a protocol fuzzy testing method based on automated device detection in one embodiment; Figure 2 It is a structural block diagram of a protocol fuzzy testing device based on automated device detection in one embodiment. DETAILED DESCRIPTION
[0012] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application 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 application and are not used to limit the present application.
[0013] In one embodiment, Figure 1 As shown, a protocol fuzzy testing method based on automated device detection is provided. This embodiment uses the method applied to a server as an example. It can be understood that the method can also be applied to a terminal, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps S101 to S103.
[0014] Step S101, based on the automated device detection technology, searching and identifying the device to be tested in a target communication network through a preset detection method, and obtaining device attribute information of the device to be tested, wherein the target communication network includes one of a Bluetooth communication network and a WiFi communication network.
[0015] Among them, protocol fuzz testing refers to a testing method that tests whether there are loopholes or abnormal behaviors in the implementation of the communication protocol by the target device or system by sending abnormal or illegally constructed protocol data.
[0016] Among them, automated device detection technology refers to a technology that searches and identifies devices in a communication network through automated means, and is used to quickly and efficiently discover devices in the communication network and extract their basic characteristics.
[0017] Among them, the device to be tested refers to the device selected as the test object, which is used to verify its performance and security during the protocol fuzz testing process. The device attribute information refers to the information describing the detailed characteristics and status of the device to be tested, for example: the device attribute information can represent the hardware attribute information corresponding to the device to be tested, such as the device name, device type, MAC address, Bluetooth device address, etc., which are used to describe the physical properties and hardware characteristics of the device; the device attribute information can also represent the network attribute information corresponding to the device to be tested, such as IP address, gateway address, DNS address, etc., which are used to describe the logical location of the device in the network, the connection properties of the related information; the device attribute information can also represent the communication attribute information corresponding to the device to be tested, such as port number, supported protocol type, protocol version, etc., which are used to describe the communication capabilities and communication methods of the device.
[0018] Among them, the Bluetooth communication network refers to a short-range wireless communication network based on the Bluetooth protocol, which is used to achieve direct connection and data transmission between devices; the WiFi communication network refers to a wireless local area network based on the IEEE 802.11 standard, which is used to achieve data transmission between devices and connection with the Internet.
[0019] Exemplarily, based on the automated device detection technology, a detection mechanism suitable for the target communication network is designed and deployed to obtain a standardized detection process set according to the characteristics of the target communication network. For example: in a Bluetooth communication network, the automated device detection technology automatically searches and identifies the device to be tested through detection methods such as active scanning, passive scanning, and device pairing scanning; in a WiFi communication network, the automated device detection technology automatically searches and identifies the device to be tested through detection methods such as ARP requests, Ping scanning, beacon frame capture, and mDNS resolution.
[0020] Exemplarily, the network communication data of the device to be tested detected based on the specified detection method is parsed to obtain the device attribute information of the device to be tested. For example, in a Bluetooth communication network, the device attribute information of the device to be tested is obtained by parsing the broadcast data, scan response data, protocol stack interaction data and other data corresponding to the device to be tested; in a WiFi communication network, the device attribute information of the device to be tested is obtained by parsing the ARP response, DHCP lease information, beacon frame, mDNS response data, SNMP query results and other data.
[0021] Step S102, generating a protocol fuzzy test task corresponding to the device to be tested, parsing the device attribute information of the device to be tested based on the test items in the protocol fuzzy test task, and obtaining the configuration information of the protocol fuzzy test task.
[0022] Among them, the protocol fuzz testing task represents the abnormal input testing process designed and implemented for the protocol fuzz testing of the device under test, which is used to detect whether there are loopholes or abnormal behaviors in the implementation of the communication protocol by the device under test by sending abnormal or illegally constructed protocol data to the device under test.
[0023] Among them, the test items in the protocol fuzz testing task represent the specific components of the protocol fuzz testing task, which are used to perform detailed tests on specific fields, operations or input types in the communication protocol to verify the response capabilities of the device under test to various abnormal inputs.
[0024] Among them, the configuration information of the protocol fuzz test task represents a specific parameter set for executing the protocol fuzz test task, which is used to define data generation rules, abnormal input format, test parameter range and abnormal detection criteria.
[0025] Exemplarily, after generating a protocol fuzz test task corresponding to the device to be tested, test items are extracted from the protocol fuzz test task, and the test items define the specific content that needs to be tested and verified in the protocol fuzz test task; the device attribute information is parsed in combination with the test items to determine the association between the test requirements corresponding to the device attribute information of the device to be tested and the test content corresponding to the test items, thereby generating executable configuration information corresponding to the protocol fuzz test task.
[0026] Step S103, by executing the protocol fuzzy test task containing configuration information, generating protocol fuzzy test data and sending the protocol fuzzy test data to the device to be tested through the target communication network, obtaining the protocol fuzzy test result returned by the device to be tested based on the protocol fuzzy test data.
[0027] Among them, the protocol fuzzy test data represents the test input data generated according to the configuration information of the protocol fuzzy test task, which is expressed in an abnormal or non-standard form, such as randomized data, overlong fields, values that do not comply with protocol specifications, boundary values, etc. It is used to verify the ability of the device to be tested to handle abnormal inputs.
[0028] Among them, the protocol fuzz test results represent the response information returned or the behavior exhibited by the device under test after receiving the protocol fuzz test data, such as normal response, error code, crash log, connection interruption or no response, etc. It is used to evaluate whether the device under test can correctly handle abnormal input and discover potential vulnerabilities or defects.
[0029] Exemplarily, according to a protocol fuzzy test task that includes configuration information, protocol fuzzy test data is generated and sent to the device to be tested through the target communication network, and the device to be tested parses and responds to the protocol fuzzy test data according to the communication protocol processing logic; then, the response information or behavior status of the device to be tested based on the protocol fuzzy test data is monitored and captured in real time to obtain the protocol fuzzy test results.
[0030] Optionally, the obtained configuration information can be displayed through a display interface so that an operator can verify and construct a corresponding protocol fuzzy testing task based on the automatically collected configuration information.
[0031] In the above-mentioned protocol fuzzy testing method based on automated device detection, automated device detection technology is used to automatically and adaptively search and identify the device to be tested and the device attribute information in the target communication network. Based on the analysis of the device attribute information, the configuration information of the protocol fuzzy testing task is efficiently and accurately obtained. By executing the protocol fuzzy testing task containing the configuration information, the protocol fuzzy testing results corresponding to the device to be tested are reliably obtained. Based on this, there is no need for manual configuration by the operator, which reduces the operation complexity and the possibility of configuration errors, and improves the efficiency and accuracy of the protocol fuzzy testing.
[0032] In an exemplary embodiment, based on the automated device detection technology, searching and identifying the device to be tested in the target communication network by a preset detection method includes steps S201 to S202.
[0033] Step S201, in the target communication network, a hierarchical scan is performed on each layer of the target communication network through a combination of multiple detection methods to detect different candidate devices, and the detection methods include active detection methods and passive detection methods.
[0034] Among them, in the active detection mode, by sending specific requests (such as ARP broadcast, Bluetooth scan request, etc.) to trigger the device response, the real-time status and communication information of the device are obtained.
[0035] Among them, in the passive detection mode, the relevant information of the device is passively captured by monitoring the network communication signals (such as Bluetooth broadcast data, WiFi beacon frames, etc.).
[0036] Exemplarily, in the target communication network, different communication protocol layers (such as physical layer, link layer, network layer, etc.) of the target communication network are detected layer by layer through a combination of active detection and passive detection methods, so as to achieve comprehensive coverage detection and search of each candidate device in the target communication network.
[0037] Optionally, according to the hierarchical structure of the communication protocol stack, the characteristics of different communication protocol layers of the target communication network are scanned and analyzed in turn to comprehensively detect each candidate device in the target communication network and the relevant information of the candidate devices, for example: in the physical layer, by detecting the physical characteristics reflected by the network communication data (such as signal strength, frequency, modulation method, etc.), the existence and distance of each candidate device are identified; in the link layer, by detecting the link characteristics reflected by the network communication data (such as MAC address, link quality, frame structure, etc.), the communication characteristics and link associations of each candidate device are identified; in the network layer, by detecting the protocol characteristics reflected by the network communication data (such as IP address, routing information, data packet grouping characteristics, etc.), the correspondence between different protocol layers and candidate devices is analyzed.
[0038] Step S202 , identifying device types corresponding to different candidate devices according to communication behavior characteristics corresponding to different candidate devices, and selecting a device to be tested from different candidate devices based on the device types corresponding to different candidate devices.
[0039] Among them, the communication behavior characteristics represent the data interaction patterns exhibited by the candidate devices in the target communication network to reflect the functional characteristics and operating status of the candidate devices; the data interaction patterns include the sending frequency of data packets, communication direction (one-way or two-way), data packet type (such as broadcast, unicast or multicast) and other characteristics.
[0040] The device type indicates the category or role of the device in the target communication network according to its functional characteristics and operating status, such as devices classified into different device types such as audio devices, input devices, network devices, and monitoring devices.
[0041] For example, a Bluetooth device can be identified as an audio device or a sensor device through the broadcast data frequency and service UUID characteristics, and a WiFi device can be identified as a router or a smart home device through the data packet transmission mode, open ports and service information (such as HTTP, DHCP, etc.); based on the device type and test requirements, devices that meet specific conditions are further screened. For example, in a Bluetooth communication network scenario, Bluetooth devices that support specific service UUIDs are screened as devices to be tested. In a WiFi communication network test scenario, candidate devices that run specific protocols (such as SNMP) are selected as devices to be tested.
[0042] In this embodiment, on the one hand, through a combination of multiple detection methods, each layer of the target communication network is scanned in layers, so that different candidate devices can be detected comprehensively and accurately, which can maximize the device detection coverage and reduce the risk of missed detection; on the other hand, according to the communication behavior characteristics corresponding to different candidate devices, the device types corresponding to different candidate devices are identified, so as to efficiently select the device to be tested that meets the test requirements from different candidate devices, and complete the accurate identification of the device to be tested.
[0043] In an exemplary embodiment, obtaining device attribute information of a device to be tested includes steps S301 and S302.
[0044] Step S301, obtaining network communication data of the device to be tested in the target communication network, performing multi-dimensional analysis on the network communication data based on deep protocol analysis technology, and extracting initial device attribute information corresponding to the device to be tested.
[0045] Among them, deep protocol analysis technology refers to a technology used to deeply analyze and decode network communication data to extract feature information corresponding to the network communication data.
[0046] The initial device attribute information refers to a set of original feature information extracted after deep protocol analysis of the network communication data of the device to be tested.
[0047] Exemplarily, multi-dimensional analysis of network communication data based on deep protocol analysis technology refers to utilizing layered decoding and feature extraction methods to parse network communication data layer by layer from the physical layer to the application layer according to the layered structure of the communication protocol stack, extract static fields (such as device name, MAC address, protocol field value, etc.) and identify dynamic communication behavior characteristics (such as data packet sending frequency, communication direction, etc.), thereby obtaining initial device attribute information.
[0048] Step S302 , preprocessing the initial device attribute information to obtain preprocessed initial device attribute information, classifying and labeling the preprocessed initial device attribute information and storing it in a structured manner to obtain device attribute information corresponding to the device to be tested.
[0049] Exemplarily, the initial device attribute information is preprocessed, and the preprocessing includes cleaning, checking and optimizing the initial device attribute information, such as cleaning redundant fields, removing invalid data packets, correcting abnormal or incomplete protocol field values, etc., to obtain the preprocessed initial device attribute information; according to the protocol characteristics and functional characteristics supported by the device to be tested, the initial device attribute information is classified and marked, for example, according to the protocol type (such as Bluetooth or WiFi), device function (such as audio device, input device), and corresponding labels are added to each type of information; after the classification is completed, the marked initial device attribute information is stored in a database in a structured form to obtain the device attribute information.
[0050] In this embodiment, first, the network communication data is analyzed in multiple dimensions based on the deep protocol analysis technology, so as to completely and deeply extract the initial device attribute information corresponding to the device to be tested; secondly, the initial device attribute information is preprocessed, and then the preprocessed initial device attribute information is classified, labeled and structured for storage, so as to obtain standardized device attribute information, ensuring the clarity, scalability and efficient query performance of the information.
[0051] In an exemplary embodiment, a protocol fuzzy test task corresponding to the device to be tested is generated, including steps S401 to S403.
[0052] Step S401, based on the pre-established mapping relationship between device type, protocol feature, and test task template, a candidate test task template matching the device to be tested is retrieved from a test task template database based on the device type and protocol feature corresponding to the device to be tested.
[0053] Among them, the test task template represents a predefined standardized test task framework, which contains test scenarios, steps, data generation rules and expected outputs of specific protocols or functions; the test task template database represents a database used to store different test task templates.
[0054] Among them, the protocol characteristics represent the communication capabilities and behaviors exhibited by the device in the protocol interaction. For example, the protocol characteristics of a Bluetooth device can represent the supported service UUID, GATT attribute type, connection parameters (such as MTU size), etc. The protocol characteristics of a WiFi device can represent the supported 802.11 protocol version, encryption method, IP configuration mode, and multicast / unicast capabilities, etc.
[0055] Exemplarily, first, by determining the device types and protocol characteristics to which different test task templates are respectively applicable, a mapping relationship between device types, protocol characteristics, and test task templates is established; secondly, the device type and protocol characteristics corresponding to the device to be tested are used as matching conditions, so that test task templates that are not related to the device to be tested are excluded from the template list of the test task template database through the matching conditions, and candidate test task templates that meet both the device type and protocol characteristics are retrieved, and the number of candidate test task templates is at least two.
[0056] Step S402 , comparing the test scenarios and test coverage of each candidate test task template to obtain a comparison result, and determining a target test task template that best matches the device to be tested from among the candidate test task templates according to the comparison result.
[0057] Step S403, generating a protocol fuzzy test task corresponding to the device to be tested based on the target test task template.
[0058] Among them, the test scenario refers to the preset operating environment and specific test conditions in the protocol fuzz test; the operating environment refers to the software environment, hardware environment and network configuration environment required for the protocol fuzz test, and the test conditions refer to the specific restrictions or requirements set on the device and its communication behavior, such as the input data conditions, data transmission conditions, and abnormal trigger conditions during the protocol fuzz test.
[0059] Among them, test coverage refers to the test depth of protocol coverage, input coverage, functional coverage and other levels in protocol fuzz testing; protocol coverage refers to the protocol type of protocol fuzz testing and the field range it supports, input coverage refers to the test coverage of input data types (such as standard input, abnormal input, randomized data, etc.), and functional coverage refers to the test coverage of the functional modules of the device (such as data transmission, data encryption, etc.).
[0060] Exemplarily, the test scenarios and test coverage of each candidate test task template are compared, and the degree of match between each candidate test task template and the communication behavior characteristics of the device to be tested can be calculated through a scoring or weighting mechanism; the candidate test task template with the highest degree of match is used as the target test task template to generate a protocol fuzzy test task corresponding to the target test task template.
[0061] In this embodiment, firstly, based on the pre-established mapping relationship between device type, protocol characteristics, and test task templates, the candidate test task template corresponding to the device to be tested is efficiently and accurately matched; secondly, the test scenarios and test coverage of each candidate test task template are compared to determine the target test task template in the candidate test task template in a multi-dimensional manner; based on this, the generation efficiency and accuracy of the protocol fuzzy test task corresponding to the device to be tested are improved.
[0062] In an exemplary embodiment, the device attribute information of the device to be tested is parsed based on the test items in the protocol fuzzy test task to obtain the configuration information of the protocol fuzzy test task, including steps S501 to S502.
[0063] Step S501, based on the test items in the protocol fuzzy test task, the device attribute information of the device to be tested is parsed at the field level, and a test task configuration file corresponding to the test items is generated. The test task configuration file is used to record the characteristic fields of the device name, MAC address, IP address and port number of the device to be tested.
[0064] Among them, the test task configuration file represents a structured file generated by parsing the device attribute information of the device to be tested in accordance with the test requirements of the test items in the protocol fuzz test task. The file is used to record the characteristic fields related to the device to be tested in the protocol fuzz test.
[0065] Exemplarily, according to the test items defined in the protocol fuzz testing task, the device attribute fields that need to be parsed are determined, such as key characteristic fields such as device name, MAC address, IP address, port number, etc.; through field-level parsing such as field content, field structure, and field context relevance, the device attribute information of the device to be tested is mapped with the test requirements of the test items, and then based on the mapping relationship between each characteristic field corresponding to the device attribute information and the test requirements of each test item, the relevant characteristic fields are extracted and formatted to generate a test task configuration file containing these characteristic fields. Step S502, based on the characteristic fields of the test task configuration file, generate test parameters of the protocol fuzz test task, and use the test parameters as configuration information of the protocol fuzz test task.
[0066] The test parameters represent the parameters used to guide the execution of the protocol fuzz testing task, such as defining the basic information of the device to be tested, input data rules, exception triggering rules, etc.
[0067] Exemplarily, characteristic fields such as device name, MAC address, IP address, port number, etc. in the test task configuration file are read, and the test parameters of the protocol fuzz test task are defined according to the test requirements of the protocol fuzz test task. For example, the target address range to be tested is defined according to the IP address of the device to be tested, and the protocol port to be tested is defined according to the port number, etc.; furthermore, the test parameters are optimized and organized to ensure the integrity and consistency of the test parameters, such as removing duplicate items, completing necessary fields, etc., and the finally generated test parameters are embedded in the protocol fuzz test task as the configuration information of the protocol fuzz test task.
[0068] In this embodiment, the device attribute information of the device to be tested is parsed at the field level to generate a test task configuration file corresponding to the test item, so as to record the basic attributes of the device to be tested in a structured and complete manner through the test file configuration file; then, based on the characteristic fields of the test task configuration file, the executable configuration information in the protocol fuzzy test task is converted, thereby improving the efficiency of the test task configuration.
[0069] In an exemplary embodiment, based on the test items in the protocol fuzzy test task, the device attribute information of the device to be tested is parsed at the field level to generate a test task configuration file of the test items, including steps S601 to S602.
[0070] Step S601, based on the correspondence between the protocol characteristics of the device to be tested and the test items in the protocol fuzzy test task, the device attribute information is decomposed into multiple feature fields according to each level of the target communication network.
[0071] Exemplarily, the protocol characteristics of the device to be tested are parsed to clarify the protocol types supported by the device to be tested and their related field characteristics; secondly, according to the test requirements of the test items in the protocol fuzzy testing task, the corresponding relationship between the protocol characteristics of the device to be tested and the test items is established. For example, a test item may require verification of the boundary value of the Bluetooth service UUID, then the UUID field corresponding to the protocol characteristics is matched with the test item; thirdly, the device attribute information is decomposed layer by layer into multiple feature fields according to the hierarchical structure of the communication protocol stack. For example, according to different levels of dimensions such as the physical characteristics reflected by the network communication data detected from the physical layer (such as signal strength, frequency, modulation mode, etc.), the link characteristics reflected by the network communication data detected from the link layer (such as MAC address, link quality, frame structure, etc.), and the protocol characteristics reflected by the network communication data detected from the network layer (such as IP address, routing information, data packet grouping characteristics, etc.), the device attribute information is parsed and decomposed according to different levels to obtain multiple feature fields.
[0072] Step S602 , based on the feature fields of the same feature, the feature fields corresponding to the device attribute information at each level are converted into feature fields in the test task configuration file to obtain a test task configuration file containing the feature fields.
[0073] Exemplarily, feature fields with the same characteristics appearing at different levels are identified. For example, the IP address field may be extracted at both the network layer and the application layer. In this case, the feature fields with the same characteristics need to be marked and integrated to avoid data redundancy and test target conflicts. The integrated feature fields are organized into structured information and stored in a test task configuration file, and each feature field in the test task configuration file corresponds to the test item requirements of the protocol fuzz testing task.
[0074] In this embodiment, on the one hand, by performing hierarchical analysis on the device attribute information to decompose it into multiple feature fields, the comprehensiveness of feature field extraction is ensured and important features are avoided from being missed; on the other hand, feature fields with the same characteristics are integrated to avoid data redundancy and improve the structuring and standardization of the test task configuration file.
[0075] In an exemplary embodiment, by executing a protocol fuzzy test task containing configuration information, protocol fuzzy test data is generated and sent to the device to be tested through a target communication network, and a protocol fuzzy test result returned by the device to be tested based on the protocol fuzzy test data is obtained, including steps S701 to S702.
[0076] Step S701, based on the configuration information and the test items corresponding to the protocol fuzzy test tasks at each level of the target communication network, generate protocol fuzzy test data corresponding to the protocol fuzzy test tasks at each level.
[0077] Exemplarily, the test items corresponding to each layer of the target communication network are determined, and the test data is designed according to the test requirements of each test item. For example, in the link layer, data frames with forged source MAC addresses can be generated to test the device's ability to handle address conflicts; in the network layer, extra-long IP fragment packets can be generated to test the device's reassembly capability; in the application layer, data packets with abnormal formats (such as invalid HTTP headers) can be designed to test the device's exception handling logic.
[0078] Step S702, based on the test items corresponding to each level and the protocol fuzzy test data corresponding to each test item, execute the protocol fuzzy test task to send the protocol fuzzy test data to the device to be tested through the target communication network, and obtain the protocol fuzzy test result returned by the device to be tested based on the protocol fuzzy test data.
[0079] Exemplarily, the protocol fuzzy test results are associated with each test item to obtain the exception handling performance of the device to be tested at different levels, that is, the protocol fuzzy test results at each level are mapped with their corresponding test items to ensure that each test result can be traced back to the corresponding protocol fuzzy test data and test requirements.
[0080] In this embodiment, on the one hand, by generating protocol fuzz test data in a hierarchical manner, it is ensured that all levels of characteristics of the device to be tested in the target communication network are covered; on the other hand, the protocol fuzz test tasks are executed in a hierarchical manner to achieve a comprehensive verification of the protocol robustness and exception handling capabilities of the device to be tested, thereby improving the test coverage, accuracy and traceability.
[0081] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0082] Based on the same inventive concept, the embodiment of the present application also provides a protocol fuzzy testing device based on automated device detection for implementing the protocol fuzzy testing method based on automated device detection involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more embodiments of the protocol fuzzy testing device based on automated device detection provided below can refer to the limitations of the protocol fuzzy testing method based on automated device detection above, and will not be repeated here.
[0083] In an exemplary embodiment, Figure 2 As shown, a protocol fuzzy testing device based on automated device detection is provided, comprising: an acquisition module 201, a task generation module 202 and a task execution module 203, wherein: The acquisition module 201 is used to search and identify the device to be tested in the target communication network through a preset detection method based on the automated device detection technology, and obtain device attribute information of the device to be tested, wherein the target communication network includes one of a Bluetooth communication network and a WiFi communication network; The task generation module 202 is used to generate a protocol fuzzy test task corresponding to the device to be tested, and parse the device attribute information of the device to be tested based on the test items in the protocol fuzzy test task to obtain the configuration information of the protocol fuzzy test task; The task execution module 203 is used to generate protocol fuzzy test data by executing a protocol fuzzy test task containing configuration information and send the protocol fuzzy test data to the device to be tested through the target communication network, so as to obtain the protocol fuzzy test result returned by the device to be tested based on the protocol fuzzy test data.
[0084] In an exemplary embodiment, the acquisition module 201 is also used to: in the target communication network, perform a hierarchical scan on each layer of the target communication network through a combination of multiple detection methods to detect different candidate devices, and the detection methods include active detection methods and passive detection methods; according to the communication behavior characteristics corresponding to different candidate devices, identify the device types corresponding to different candidate devices, and based on the device types corresponding to different candidate devices, select the device to be tested from different candidate devices.
[0085] In an exemplary embodiment, the acquisition module 201 is also used to: obtain network communication data of the device to be tested in the target communication network, perform multi-dimensional analysis on the network communication data based on deep protocol analysis technology, and extract initial device attribute information corresponding to the device to be tested; preprocess the initial device attribute information to obtain preprocessed initial device attribute information, classify and label the preprocessed initial device attribute information and perform structured storage to obtain device attribute information corresponding to the device to be tested.
[0086] In an exemplary embodiment, the task generation module 202 is also used to: based on the pre-established mapping relationship between device type, protocol characteristics, and test task templates, retrieve candidate test task templates that match the device to be tested based on the device type and protocol characteristics corresponding to the device to be tested in the test task template database; compare the test scenarios and test coverage of each candidate test task template to obtain a comparison result, and determine the target test task template that best matches the device to be tested in each candidate test task template based on the comparison result; and generate a protocol fuzzy test task corresponding to the device to be tested based on the target test task template.
[0087] In an exemplary embodiment, the task generation module 202 is also used to: based on the test items in the protocol fuzz test task, perform field-level parsing on the device attribute information of the device to be tested, and generate a test task configuration file corresponding to the test items, the test task configuration file is used to record the characteristic fields of the device name, MAC address, IP address and port number of the device to be tested; based on the characteristic fields of the test task configuration file, generate test parameters of the protocol fuzz test task, and use the test parameters as configuration information of the protocol fuzz test task.
[0088] In an exemplary embodiment, the task generation module 202 is also used to: based on the correspondence between the protocol characteristics of the device to be tested and the test items in the protocol fuzz testing task, decompose the device attribute information into multiple feature fields according to each level of the target communication network; according to the feature fields with the same characteristics, convert the feature fields corresponding to the device attribute information at each level into feature fields in the test task configuration file, and obtain a test task configuration file containing the feature fields.
[0089] In an exemplary embodiment, the task execution module 203 is also used to generate protocol fuzzy test data corresponding to the protocol fuzzy test task at each level based on the configuration information and the test items corresponding to the protocol fuzzy test task at each level of the target communication network; based on the test items corresponding to each level and the protocol fuzzy test data corresponding to each test item, the protocol fuzzy test task is executed to send the protocol fuzzy test data to the device to be tested through the target communication network, and obtain the protocol fuzzy test result returned by the device to be tested based on the protocol fuzzy test data.
[0090] Each module in the above-mentioned protocol fuzzy testing device based on automated equipment detection can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0091] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in any of the above embodiments when executing the computer program.
[0092] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in any of the above embodiments are implemented.
[0093] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0094] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0095] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A protocol fuzzy testing method based on automated device detection, characterized in that: The method comprises: Based on the automated device detection technology, the device to be tested is searched and identified in a preset detection mode in the target communication network, and the device attribute information of the device to be tested is obtained, wherein the target communication network includes one of a Bluetooth communication network and a WiFi communication network; Generate a protocol fuzzy test task corresponding to the device to be tested, parse the device attribute information of the device to be tested based on the test items in the protocol fuzzy test task, and obtain the configuration information of the protocol fuzzy test task; By executing a protocol fuzzy test task including the configuration information, protocol fuzzy test data is generated and sent to the device to be tested via the target communication network, a protocol fuzzy test result returned by the device to be tested based on the protocol fuzzy test data is obtained.
2. The method according to claim 1, characterized in that The automated device detection technology is used to search and identify the device to be tested in the target communication network by a preset detection method, including: In a target communication network, a hierarchical scan is performed on each layer of the target communication network through a combination of multiple detection methods to detect different candidate devices, wherein the detection methods include active detection methods and passive detection methods; According to the communication behavior characteristics respectively corresponding to different candidate devices, the device types respectively corresponding to the different candidate devices are identified, and based on the device types respectively corresponding to the different candidate devices, a device to be tested is selected from the different candidate devices.
3. The method according to claim 1, characterized in that The obtaining of device attribute information of the device to be tested includes: Acquire network communication data of the device to be tested in the target communication network, perform multi-dimensional analysis on the network communication data based on deep protocol analysis technology, and extract initial device attribute information corresponding to the device to be tested; The initial device attribute information is preprocessed to obtain preprocessed initial device attribute information, and the preprocessed initial device attribute information is classified, labeled and structuredly stored to obtain device attribute information corresponding to the device to be tested.
4. The method according to claim 1, characterized in that: The generating of the protocol fuzzy test task corresponding to the device to be tested includes: Based on the pre-established mapping relationship between device type, protocol feature, and test task template, a candidate test task template matching the device to be tested is retrieved from a test task template database based on the device type and protocol feature corresponding to the device to be tested; Comparing the test scenarios and test coverage of each candidate test task template to obtain a comparison result, and determining the target test task template that best matches the device to be tested from among the candidate test task templates according to the comparison result; Based on the target test task template, a protocol fuzzy test task corresponding to the device to be tested is generated.
5. The method according to claim 1, characterized in that The parsing of the device attribute information of the device to be tested based on the test items in the protocol fuzzy test task to obtain the configuration information of the protocol fuzzy test task includes: Based on the test items in the protocol fuzzy test task, the device attribute information of the device to be tested is parsed at the field level to generate a test task configuration file corresponding to the test items, wherein the test task configuration file is used to record the characteristic fields of the device name, MAC address, IP address and port number of the device to be tested; Based on the characteristic fields of the test task configuration file, the test parameters of the protocol fuzz test task are generated, and the test parameters are used as the configuration information of the protocol fuzz test task.
6. The method according to claim 5, characterized in that The method of performing field-level parsing on the device attribute information of the device to be tested based on the test items in the protocol fuzzy test task to generate a test task configuration file for the test items includes: Based on the correspondence between the protocol features of the device to be tested and the test items in the protocol fuzzy test task, decomposing the device attribute information into a plurality of feature fields according to each layer of the target communication network; According to the feature fields of the same feature, the feature fields corresponding to the device attribute information at each level are converted into feature fields in the test task configuration file to obtain a test task configuration file containing the feature fields.
7. The method according to claim 1, characterized in that The method of generating protocol fuzzy test data by executing the protocol fuzzy test task including the configuration information and sending the protocol fuzzy test data to the device to be tested through the target communication network, and obtaining a protocol fuzzy test result returned by the device to be tested based on the protocol fuzzy test data, comprises: Based on the configuration information and the test items corresponding to the protocol fuzzy test task at each level of the target communication network, generate protocol fuzzy test data corresponding to the protocol fuzzy test task at each level; Based on the test items corresponding to each level and the protocol fuzzy test data corresponding to each test item, the protocol fuzzy test task is executed to send the protocol fuzzy test data to the device to be tested through the target communication network, and obtain the protocol fuzzy test result returned by the device to be tested based on the protocol fuzzy test data.
8. A protocol fuzzy testing device based on automated device detection, characterized in that: The device comprises: An acquisition module is used to search and identify the device to be tested in a target communication network through a preset detection method based on an automated device detection technology, and obtain device attribute information of the device to be tested, wherein the target communication network includes one of a Bluetooth communication network and a WiFi communication network; A task generation module, used to generate a protocol fuzzy test task corresponding to the device to be tested, and to parse the device attribute information of the device to be tested based on the test items in the protocol fuzzy test task to obtain the configuration information of the protocol fuzzy test task; A task execution module is used to generate protocol fuzzy test data by executing a protocol fuzzy test task containing the configuration information, and send the protocol fuzzy test data to the device to be tested through the target communication network, so as to obtain a protocol fuzzy test result returned by the device to be tested based on the protocol fuzzy test data.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.