Fuzzy test method and system based on V2X communication protocol
By mutating and monitoring the V2X communication data packets, the problem of V2X communication protocol vulnerabilities in the existing technology is solved, efficient vulnerability mining and positioning is achieved, and testing efficiency and coverage are improved.
Patent Information
- Application Number
- CN202411757776.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-01-03
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing fuzz testing technology is mainly used in Bluetooth, WiFi and network protocols, and has failed to effectively conduct security testing on the V2X communication protocol, resulting in the vulnerabilities of the V2X communication protocol being not fully explored and detected.
By capturing normal V2X communication packets, analyzing their fields, generating mutated packets, and sending these packets through V2X supporting hardware devices for fuzz testing, monitoring the response status of the tested device, and automatically generating vulnerability verification scripts to locate and reproduce vulnerabilities .
In-depth vulnerability mining of the V2X communication protocol is realized, the efficiency of vulnerability mining is improved, abnormal data packets can be quickly located, and vulnerability verification scripts are automatically generated, which is convenient for subsequent vulnerability reproduction and location.
Smart Images

Figure CN119255282A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of communication testing, and in particular to a fuzzy testing method and system based on a V2X communication protocol. Background Art
[0002] V2X communication refers to communication between vehicles (V2V), between vehicles and infrastructure (V2I), between vehicles and pedestrians (V2P), and between vehicles and networks (V2N). This communication can be carried out through wireless networks such as Wi-Fi, cellular networks, or dedicated vehicle communication bands (such as DSRC or 5G) The main purpose of V2X communication is to improve road safety, traffic efficiency and driving comfort. Through V2V communication, vehicles can exchange information such as location, speed, and driving direction with each other to avoid collisions, reduce traffic jams, and provide smarter driving assistance functions. Through V2I communication, vehicles can receive information from traffic lights, roadside facilities or road management centers to optimize driving routes, reduce fuel consumption, etc. V2P communication can provide warnings between pedestrians and vehicles, helping to avoid collisions. V2N communication can connect vehicles to the Internet and provide richer information services and vehicle management functions. Therefore, the security of the V2X communication protocol is not only related to the individual car owner, but also to the safety of the entire road traffic, so the security of the V2X communication protocol must be guaranteed.
[0003] Fuzz testing is a commonly used communication protocol security testing method. The core of this method is to mine unknown vulnerabilities that may exist in the communication protocol by sending a large amount of abnormal data, thereby greatly improving the efficiency of vulnerability mining.
[0004] Existing fuzz testing technologies are mostly used for information security testing in Bluetooth, WiFi, and network protocols, while V2X-related tests are currently mostly functional tests. Therefore, it is necessary to design a method for fuzz testing of V2X communication protocols. Summary of the invention
[0005] In view of the above background, the present invention provides a fuzzy testing method and system based on the V2X communication protocol, which captures normal V2X communication data packets, obtains initial seeds, performs instruction traversal and abnormal data packet mutation according to different fields of the communication data packets, and monitors the response status of the device under test to determine whether an abnormal impact occurs. The present invention can deeply mine unknown vulnerabilities in the V2X communication protocol, improve the efficiency of vulnerability mining, and can quickly locate the data packets that cause abnormalities in the device under test, and automatically generate vulnerability verification scripts, which is convenient for subsequent vulnerability reproduction and vulnerability location.
[0006] In order to achieve the above object, in a first aspect, the present invention proposes a fuzzy testing method based on a V2X communication protocol, the method comprising the following steps: S1: Capture V2X normal communication data packets as initial seeds, parse the communication data to obtain multiple fields, and analyze the meaning of each field; S2: mutate the bytes in the field to generate a mutated data packet; S3: Send mutated data packets to the test equipment system through the V2X supporting hardware device to perform fuzz testing.
[0007] Furthermore, the communication data packet fields include: frame header, MAC address, source address, destination address, timestamp, payload, sequence number, certificate and key information, and tail.
[0008] Furthermore, the mutated data packet includes mutating a specific byte, or mutating a plurality of bytes.
[0009] Further, the data mutation includes: selecting a field, and performing data mutation on a number of bytes in the field, including: S21, replacing the randomly selected bytes with random values; S22, performing a reversal operation on the adjacent bits of the randomly selected byte; S23, adding 2 bytes to the field after the inversion operation; S24, modify any non-boundary 1 byte in the field to which the byte is added to be a boundary value 0xFF; S25. Replace the adjacent positions of several boundary values with ASCII characters.
[0010] In a second aspect, the present invention proposes a fuzzy monitoring method based on a V2X communication protocol, comprising the following steps: S1: The status monitoring tool is connected to the device under test system through the debugging interface, and records the messages of the device under test receiving normal V2X communication signals and abnormal V2X communication signals; S2: After the fuzzy test system sends a mutated data packet, the monitoring system will send a normal communication data packet and detect the message of the device system under test at the same time, and determine whether the message response status is normal through regular expressions; S3: When the device under test receives the mutated data packet generated by the fuzz test and responds to the normal message, it is determined that no vulnerability is found and the next use case is executed; S4: When the device under test does not respond to normal messages after receiving the mutated data packets generated by the fuzz test, it is determined that a vulnerability is found, the sending of data packets is suspended, and a prompt alarm is popped up.
[0011] S5. When the communication protocol status monitoring system finds a vulnerability, the system automatically saves the information of the current mutated data packet and the message information of the device under test, including the test item information, the packet sending time, and the data packet file; The fuzz testing system automatically generates a script for sending the mutated data packet based on the saved triggerable mutated data packet.
[0012] In a third aspect, the present invention proposes a fuzzy testing system based on a V2X communication protocol, the system comprising the following modules: The seed acquisition module captures the V2X normal communication data packet as the initial seed, parses the communication data to obtain multiple fields, and analyzes the meaning of each field; A mutation module is used to perform data mutation on bytes in a field and generate a mutation data packet; A sending module is used to send mutated data packets to the test equipment system through the V2X supporting hardware device to perform fuzzy testing; The status monitoring module is used for the status monitoring tool to access the device under test system through the debugging interface, and record the messages of the device under test receiving normal V2X communication signals and abnormal V2X communication signals; The state detection module is used to detect the message of the device system under test and determine whether the message response state is normal through regular expressions after each variant data packet is sent by the sending module. The status judgment module is used to determine that no vulnerability is found when the device under test receives the variant data packet generated by the fuzz test and responds to the normal message, and continue to execute the next use case; when the device under test receives the variant data packet generated by the fuzz test and does not respond to the normal message, it is determined that a vulnerability is found, the data packet sending is suspended, and a prompt alarm is popped up; The abnormality saving module is used to automatically save the information of the current mutated data packet and the message information of the device under test, including the test item information, packet sending time, and data packet file, when the status judgment module finds a vulnerability; The script generation module is used to automatically generate a script for sending the mutation data packet based on the saved triggerable mutation data packet.
[0013] The beneficial effects of the present invention are as follows: 1) By setting up the mutation generation sending module, status monitoring, and detection module, it is possible to automatically generate test cases and monitor abnormal responses during the test process, thereby improving test efficiency and coverage.
[0014] 2) By setting specific data mutation methods, complex variants with bugs can be generated to simulate errors that may occur in the real world, which helps to identify and fix potential problems in advance.
[0015] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above description and other purposes, features and advantages of the present invention more obvious and easy to understand, the preferred embodiments are specifically cited and described in detail as follows. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings: Figure 1 It is a flow chart of the fuzzy testing method based on the V2X communication protocol; Figure 2 This is a framework diagram of the fuzzy testing system based on the V2X communication protocol. DETAILED DESCRIPTION
[0017] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0018] In the description of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be connected, detachably connected, or integrated; it can be mechanically connected or electrically connected; it can be directly connected or indirectly connected through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0019] Example 1 like Figure 1 As shown, the present invention provides a fuzzy testing method based on the V2X communication protocol, the method comprising the following steps: S1: Capture V2X normal communication data packets as initial seeds, parse the communication data to obtain multiple fields, and analyze the meaning of each field; S2: mutate the bytes in the field to generate a mutated data packet; S3: Send mutated data packets to the test equipment system through the V2X supporting hardware device to perform fuzz testing.
[0020] Furthermore, the communication data packet fields include: frame header, MAC address, source address, destination address, timestamp, payload, sequence number, certificate and key information, and tail.
[0021] Furthermore, the mutated data packet includes mutating a specific byte, or mutating a plurality of bytes.
[0022] Further, the data mutation includes: selecting a field, and performing data mutation on a number of bytes in the field, including: S21, replacing the randomly selected bytes with random values; S22, performing a reversal operation on the adjacent bits of the randomly selected byte; S23, adding 2 bytes to the field after the inversion operation; S24, modify any non-boundary 1 byte in the field to which the byte is added to be a boundary value 0xFF; S25. Replace the adjacent positions of several boundary values with ASCII characters.
[0023] The present invention also provides a fuzzy monitoring method based on the V2X communication protocol, comprising the following steps: S1: The status monitoring tool is connected to the device under test system through the debugging interface, and records the messages of the device under test receiving normal V2X communication signals and abnormal V2X communication signals; S2: After the fuzzy test system sends a mutated data packet, the monitoring system will send a normal communication data packet and detect the message of the device system under test at the same time, and determine whether the message response status is normal through regular expressions; S3: When the device under test receives the mutated data packet generated by the fuzz test and responds to the normal message, it is determined that no vulnerability is found and the next use case is executed; S4: When the device under test does not respond to normal messages after receiving the mutated data packets generated by the fuzz test, it is determined that a vulnerability is found, the sending of data packets is suspended, and a prompt alarm is popped up.
[0024] S5: When the communication protocol status monitoring system finds a vulnerability, the system automatically saves the information of the current mutated data packet and the message information of the device under test, including the test item information, packet sending time, and data packet file; The fuzz testing system automatically generates a script for sending the abnormal data packet based on the saved triggerable mutation data packet.
[0025] Example 2 like Figure 2 As shown, the present invention provides a fuzzy testing system based on the V2X communication protocol, which includes the following modules: The seed acquisition module captures the V2X normal communication data packet as the initial seed, parses the communication data to obtain multiple fields, and analyzes the meaning of each field; A mutation module is used to perform data mutation on bytes in a field and generate a mutation data packet; A sending module is used to send mutated data packets to the test equipment system through the V2X supporting hardware device to perform fuzzy testing; The status monitoring module is used for the status monitoring tool to access the device under test system through the debugging interface, and record the messages of the device under test receiving normal V2X communication signals and abnormal V2X communication signals; The state detection module is used to detect the message of the device system under test and determine whether the message response state is normal through regular expressions after each variant data packet is sent by the sending module. The status judgment module is used to determine that no vulnerability is found when the device under test receives the variant data packet generated by the fuzz test and responds to the normal message, and continue to execute the next use case; when the device under test receives the variant data packet generated by the fuzz test and does not respond to the normal message, it is determined that a vulnerability is found, the data packet sending is suspended, and a prompt alarm is popped up; The abnormality saving module is used to automatically save the information of the current mutated data packet and the message information of the device under test, including the test item information, packet sending time, and data packet file, when the status judgment module finds a vulnerability; The script generation module is used to automatically generate a script for sending the mutation data packet based on the saved triggerable mutation data packet.
[0026] Example 3 In the vehicle control network message, the data frame with the specified ID is received by the status monitoring module, and the 8-byte payload is used to execute specific functional instructions. In the payload, one byte can control the execution of many actions. The change of one byte can cause disturbance to the ECU.
[0027] In ECU function control, each Byte occupies 8 bits, and 1 bit usually controls one function. For example, the monitoring data format is ID (0x051)-Data (C040C00E11001E00), data frame ID-payload. For example, the data frame ID of the headlight function control is 0x051. The second byte in the payload controls the status of the left and right turn lights, that is, 40 means the normal state of off, and the options are 50 for the right turn light, 60 for the left turn light, and 40 for the double flash lights. Select the second byte under the Data field for mutation, and the other 7 bytes remain unchanged. Generate a test case and inject it into the test ECU. After the sending module sends the mutated data packet, the status monitoring module will send another normal communication data packet and detect the ECU's message at the same time. When the ECU receives the mutated data packet generated by the fuzz test and does not respond to the normal message, it is determined that a vulnerability has been found, and the ECU can be found to be executed unexpectedly. When a vulnerability is discovered, the system automatically saves the information of the current variant data packet and the message information of the device under test, including test project information, packet sending time, and data packet file; at the same time, based on the saved triggerable variant data packet, the system automatically generates a script for sending the variant data packet, and allows users to download and execute it separately, making it convenient for users to replay the variant data packet, thereby improving the efficiency of vulnerability location.
[0028] The beneficial effects of the present invention are as follows: 1) By setting up the mutation generation sending module, status monitoring, and detection module, it is possible to automatically generate test cases and monitor abnormal responses during the test process, thereby improving test efficiency and coverage.
[0029] 2) By setting specific data mutation methods, complex variants with bugs can be generated to simulate errors that may occur in the real world, which helps to identify and fix potential problems in advance.
[0030] 3) It can deeply explore unknown vulnerabilities in the V2X communication protocol, improve the efficiency of vulnerability mining, quickly locate the data packets that cause abnormalities in the device under test, and automatically generate vulnerability verification scripts to facilitate subsequent vulnerability reproduction and vulnerability location.
[0031] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A fuzzy testing method based on V2X communication protocol, characterized in that: The method comprises the following steps: S1: Capture V2X normal communication data packets as initial seeds, parse the communication data to obtain multiple fields, and analyze the meaning of each field; S2: mutate the bytes in the field to generate a mutated data packet; S3: Send mutated data packets to the test equipment system through the V2X supporting hardware device to perform fuzz testing.
2. The fuzzy testing method based on the V2X communication protocol according to claim 1 is characterized in that: The communication data packet fields include: frame header, MAC address, source address, destination address, timestamp, payload, sequence number, certificate and key information, and tail.
3. The fuzzy testing method based on the V2X communication protocol according to claim 1 is characterized in that: The mutated data packet includes mutating a specific byte or mutating multiple bytes.
4. The fuzzy testing method based on the V2X communication protocol according to claim 3 is characterized in that: The data mutation includes: selecting a field, and performing data mutation on a number of bytes in the field, including: S21, replacing the randomly selected bytes with random values; S22, performing a reversal operation on the adjacent bits of the randomly selected byte; S23, adding 2 bytes to the field after the inversion operation; S24, modify any non-boundary 1 byte in the field to which the byte is added to be a boundary value 0xFF; S25. Replace the adjacent positions of several boundary values with ASCII characters.
5. A fuzzy monitoring method based on a V2X communication protocol, used to monitor the variant data packets generated in the fuzzy testing method based on a V2X communication protocol as claimed in claim 1, characterized in that: The steps include: S1: The status monitoring tool is connected to the device under test system through the debugging interface, and records the messages of the device under test receiving normal V2X communication signals and abnormal V2X communication signals; S2: After the fuzzy test system sends a mutated data packet, the monitoring system will send a normal communication data packet and detect the message of the device system under test at the same time, and determine whether the message response status is normal through regular expressions; S3: When the device under test receives the mutated data packet generated by the fuzz test and responds to the normal message, it is determined that no vulnerability is found and the next use case is executed; S4: When the device under test does not respond to normal messages after receiving the mutated data packets generated by the fuzz test, it is determined that a vulnerability is found, the data packet sending is suspended, and a prompt alarm is popped up.
6. The fuzzy monitoring method based on the V2X communication protocol according to claim 5, characterized in that: After step S4, the method further includes: When the communication protocol status monitoring system finds a vulnerability, the system automatically saves the information of the current mutated data packet and the message information of the device under test, including the test item information, packet sending time, and data packet file; The fuzz testing system automatically generates a script for sending the mutated data packet based on the saved triggerable mutated data packet.
7. A fuzzy testing system based on V2X communication protocol, characterized in that: The system includes the following modules: The seed acquisition module captures the V2X normal communication data packet as the initial seed, parses the communication data to obtain multiple fields, and analyzes the meaning of each field; A mutation module is used to perform data mutation on bytes in a field and generate a mutation data packet; A sending module is used to send mutated data packets to the test equipment system through the V2X supporting hardware device to perform fuzzy testing; The status monitoring module is used for the status monitoring tool to access the device under test system through the debugging interface, and record the messages of the device under test receiving normal V2X communication signals and abnormal V2X communication signals; The state detection module is used to detect the message of the device system under test and determine whether the message response state is normal through regular expressions after each variant data packet is sent by the sending module. The status judgment module is used to determine that no vulnerability is found when the device under test receives the mutated data packet generated by the fuzz test and responds to the normal message, and then continue to execute the next use case; when the device under test receives the mutated data packet generated by the fuzz test and does not respond to the normal message, it is determined that a vulnerability is found, the data packet sending is suspended, and a prompt alarm is popped up; The abnormality saving module is used to automatically save the information of the current mutated data packet and the message information of the device under test, including the test item information, packet sending time, and data packet file, when the status judgment module finds a vulnerability; The script generation module is used to automatically generate a script for sending the mutation data packet based on the saved triggerable mutation data packet.
Citation Information
Patent Citations
Fuzzy test method and device based on HTTP / 2
CN113986712A
Method and device for generating malformed data
CN114296736A
SDR-based low-cost V2X fuzzy test method
CN114302442A
Charging pile CAN protocol penetration test method and system based on fuzzy test, and storage medium
CN114465938A
Variation test method and device, storage medium and chip
CN115687144A
Cited By
Inspection device and inspection program
WO2026203085A1
