Low-power Bluetooth test method, device, system, test equipment and storage medium

By establishing a connection between the Bluetooth low-power test device and the target device, and obtaining and using the information of the target service characteristics for Bluetooth communication task detection, the problem of ignoring BLE security in the prior art is solved, and the security detection of the Bluetooth low-power test device is realized, and the security of the device is improved.

CN115002736BActive Publication Date: 2025-04-22GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210529857.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-16
Publication Date
2025-04-22
Estimated Expiration
2042-05-16

AI Technical Summary

Technical Problem

Existing Bluetooth Low Energy testing methods usually ignore the security of BLE function and fail to effectively detect security vulnerabilities in electronic devices.

Method used

By establishing a low-power Bluetooth connection between the test device and the target Bluetooth device, the characteristic information of the target service characteristics is obtained, and the Bluetooth communication task corresponding to the target service characteristics is performed based on this information, and the connection status is detected to determine whether there is a security vulnerability.

Benefits of technology

The security detection of GATT services provided by low-power Bluetooth devices is realized, and the target service characteristics that may have security vulnerabilities can be located, thereby improving the security of the target Bluetooth devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115002736B_ABST
    Figure CN115002736B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a low-power Bluetooth test method, device, system and storage medium, the method is applied to a test device, there is a low-power Bluetooth connection between the test device and the target Bluetooth device to be tested; the method comprises: obtaining characteristic information of a target service feature based on the low-power Bluetooth connection; the target service feature is a service feature included in the GATT service provided by the target Bluetooth device; executing a Bluetooth communication task corresponding to the target service feature according to the characteristic information of the target service feature and the first test data corresponding to the target service feature; detecting the connection state of the low-power Bluetooth connection during the execution of the Bluetooth communication task; if the connection state is an abnormal state, determining that the target service feature has a security vulnerability. The implementation of the embodiment of the present application can detect the low-power Bluetooth security vulnerability of the electronic device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a low-power Bluetooth testing method, device, system, testing equipment and storage medium. Background Art

[0002] At present, with the development of Bluetooth technology, Bluetooth Low Energy (BLE) connection has come into being. The biggest feature of BLE connection compared to traditional Bluetooth is low power consumption. It is mostly used in scenarios with high real-time requirements but relatively low data transmission rate requirements, such as blood pressure monitors, keyboards and mice, etc. Since BLE connection only transmits a small amount of data when needed, it will remain closed except for data transmission, which greatly reduces its power consumption and makes it an ideal choice for long-term connection at low data rates. Nowadays, BLE Bluetooth function modules are generally built into various commonly used electrical appliances or IoT smart devices, such as various mobile phones (Android, iPhone), smart home devices, medical equipment, wearable devices, smart buildings and automobiles.

[0003] However, in practice, it is found that the relevant testing methods for the BLE function of electronic devices often test the performance or energy consumption of BLE, ignoring the security of BLE function. Summary of the invention

[0004] The embodiments of the present application disclose a low-power Bluetooth testing method, apparatus, system, testing equipment and storage medium, which can detect low-power Bluetooth security vulnerabilities of electronic devices.

[0005] An embodiment of the present application discloses a low-power Bluetooth testing method, which is applied to a testing device, wherein a low-power Bluetooth connection exists between the testing device and a target Bluetooth device to be tested; the method comprises: obtaining characteristic information of a target service characteristic based on the low-power Bluetooth connection; the target service characteristic is a service characteristic included in a GATT service provided by the target Bluetooth device; executing a Bluetooth communication task corresponding to the target service characteristic according to the characteristic information of the target service characteristic and first test data corresponding to the target service characteristic; detecting the connection status of the low-power Bluetooth connection during the execution of the Bluetooth communication task; and determining that a security vulnerability exists in the target service characteristic if the connection status is an abnormal state.

[0006] The embodiment of the present application discloses a low-power Bluetooth testing device applied to a testing device, wherein a low-power Bluetooth connection exists between the testing device and a target Bluetooth device to be tested; the device comprises: an acquisition module, for acquiring characteristic information of a target service characteristic based on the low-power Bluetooth connection; the target service characteristic is a service characteristic included in a GATT service provided by the target Bluetooth device; a communication module, for executing a Bluetooth communication task corresponding to the target service characteristic according to the characteristic information of the target service characteristic and first test data corresponding to the target service characteristic; a detection module, for detecting the connection status of the low-power Bluetooth connection during the execution of the Bluetooth communication task; and a determination module, for determining that a security vulnerability exists in the target service characteristic if the connection status is an abnormal state.

[0007] An embodiment of the present application discloses a testing device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor implements any one of the low-power Bluetooth testing methods disclosed in the embodiments of the present application.

[0008] An embodiment of the present application discloses a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, any one of the low-power Bluetooth test methods disclosed in the embodiment of the present application is implemented.

[0009] An embodiment of the present application discloses a low-power Bluetooth test system, characterized in that the system includes: a test device and a target Bluetooth device to be tested; a low-power Bluetooth connection exists between the test device and the target Bluetooth device; the target Bluetooth device is used to provide GATT services; the test device is used to obtain characteristic information of a target service characteristic based on the low-power Bluetooth connection; the target service characteristic is a service characteristic included in the GATT service; the test device is further used to execute a Bluetooth communication task corresponding to the target service characteristic according to the characteristic information of the target service characteristic and first test data corresponding to the target service characteristic; and, during the execution of the Bluetooth communication task, detecting the connection status of the low-power Bluetooth connection; and, if the connection status is an abnormal state, determining that the target service characteristic has a security vulnerability.

[0010] Compared with the related art, the embodiments of the present application have the following beneficial effects:

[0011] After the test device establishes a BLE connection with the target Bluetooth device, it can obtain the characteristic information of the target service characteristic in the GATT service provided by the target Bluetooth device, and execute the Bluetooth communication task corresponding to the target service characteristic based on the characteristic information of the target service characteristic and the first test data. The test device can detect the connection status of the low-power Bluetooth connection during the execution of the Bluetooth communication task. If the connection status is abnormal, it is determined that there is a security vulnerability in the target service characteristic. Based on this, the test device can locate the target service characteristic that may have a security vulnerability in the GATT service provided by the target Bluetooth device, filling the gap in security detection of the GATT service provided by the low-power Bluetooth device, which is conducive to improving the security of the target Bluetooth device. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be 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.

[0013] Figure 1 is a schematic diagram of an application scenario of a Bluetooth testing method disclosed in an embodiment;

[0014] Figure 2 is an example diagram of a multi-layer data structure defined by GATT disclosed in an embodiment;

[0015] Figure 3 is a method flow chart of a low-power Bluetooth testing method disclosed in an embodiment;

[0016] Figure 4 is a method flow diagram of another low-power Bluetooth testing method disclosed in an embodiment;

[0017] Figure 5 is a schematic structural diagram of a low-power Bluetooth test device disclosed in an embodiment;

[0018] Figure 6 is a schematic diagram of the structure of a testing device disclosed in an embodiment;

[0019] Figure 7 The present invention is a schematic diagram of the structure of a low-power Bluetooth test system disclosed in an embodiment. DETAILED DESCRIPTION

[0020] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0021] It should be noted that the terms "including" and "having" and any variations thereof in the embodiments of the present application and the accompanying drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.

[0022] The embodiments of the present application disclose a low-power Bluetooth test method, apparatus, system, test equipment and storage medium, which can detect security vulnerabilities of low-power Bluetooth connections. Detailed descriptions are given below.

[0023] See also Figure 1 , Figure 1 FIG. 1 is a schematic diagram of an application scenario of a Bluetooth test method disclosed in an embodiment. Figure 1 As shown, it may include a test device 110 and a target Bluetooth device 120. The test device 110 may be any electronic device with a BLE function, and the target Bluetooth device 120 may be a Bluetooth device to be tested, and may be any electronic device with a BLE function such as a smart phone, a smart tablet, a smart watch, etc., without specific limitation. The test device 110 may initiate a BLE connection request to the Bluetooth device 120 according to the Media Access Control Address (MAC) address of the target Bluetooth device 120. The target Bluetooth device 120 may respond to the connection request and establish a BLE connection with the test device 110.

[0024] Exemplarily, the test device 110 may include a test host and a Bluetooth adapter, and the target Bluetooth device 120 may include a smart watch. The executable program code corresponding to the Bluetooth test method disclosed in the embodiment of the present application may be stored in the test host, and the test host may drive the Bluetooth adapter to establish a BLE connection with the smart watch. After the BLE connection is established, a processor such as a central controller of the test host may call the stored executable program code to detect security vulnerabilities of the BLE connection.

[0025] The BLE connection between the test device 110 and the target Bluetooth device 120 can be used for data transmission based on the Generic Attributes (GATT) communication protocol. The security vulnerability of the BLE connection may be caused by errors in the local deployment of the GATT communication protocol by the target Bluetooth device 120. Therefore, the security vulnerability of the BLE connection can be detected by verifying the GATT service provided by the target Bluetooth device 120 in the BLE connection.

[0026] GATT defines a multi-layer data structure, based on which the test device 110 and the target Bluetooth device 120 can communicate. Figure 2 , Figure 2 is an example diagram of a multi-layer data structure defined by GATT disclosed in an embodiment. Figure 2 As shown, the database (Profile) 20 defined by GATT may include multiple GATT services (Service) 21, each service 21 may include multiple service characteristics (Characteristic) 210, each service characteristic 210 may include properties (Properties) 210a and values ​​(Value) 210b. Optionally, each service characteristic 210 may also include one or more descriptors (Descriptor) 210c.

[0027] The GATT service 21 may be equivalent to a table in the database 20, and the service characteristic 210 may be equivalent to a specific table item in the data table. By reading and writing data to the service characteristic 210, bidirectional communication in the BLE connection may be achieved. Different service characteristics may be used to initiate different Bluetooth communication sessions, which may correspond to different Bluetooth communication tasks.

[0028] See also Figure 3 , Figure 3 The following is a flow chart of a method for testing a low-power Bluetooth system disclosed in an embodiment, which can be applied to the aforementioned testing device. Figure 3 As shown, the following steps may be included:

[0029] 310. Obtain characteristic information of target service characteristics based on the low-power Bluetooth connection.

[0030] After the test device establishes a BLE connection with the target Bluetooth device, the test device can traverse the GATT services provided by the target Bluetooth device. For any GATT service, the measurement device can parse the GATT service to obtain the various service features included in the GATT service, and parse the feature information of each service feature.

[0031] The characteristic information of each service characteristic may include at least one or more of the following information: characteristic identifier (UUID), characteristic handle, and read / write status bit of the service characteristic. The UUID can distinguish different service characteristics; the characteristic handle can be used as the interface of the service characteristic for data transmission and reception; the read / write status bit can be used to indicate the read / write status of the service characteristic, including writable status and read-only status.

[0032] The target service feature may be a service feature included in the GATT service provided by the target Bluetooth device. The target service feature may be any service feature included in the GATT service; or, it may be any service feature to be tested that is retained after screening, without specific limitation. After parsing the feature information of each service feature included in the GATT service, the test device may also screen each service feature included in the GATT service and select one or more service features to be tested.

[0033] 320. Execute a Bluetooth communication task corresponding to the target service characteristic according to the characteristic information of the target service characteristic and the first test data corresponding to the target service characteristic.

[0034] The embodiments of the present application can perform security testing on target service features in a fuzzy testing manner. Fuzz testing is a method of discovering faults in software by providing unexpected inputs to a program and monitoring anomalies in the output.

[0035] The first test data may be unexpected malformed data, which may be automatically generated by the test equipment or pre-entered into the test equipment by the tester. The first test data corresponding to different service features may be different, and the first test data corresponding to the target service feature may be designed according to the Bluetooth communication task corresponding to the target service feature.

[0036] In step 320, the test device may send the first test data to the target Bluetooth device according to the characteristic information of the target service characteristic. When the target Bluetooth device receives the first test data, it may use the first test data to initiate a Bluetooth communication session with the test device, and the test device and the target Bluetooth device jointly perform the Bluetooth communication task corresponding to the target service characteristic.

[0037] Therefore, if there is no security vulnerability in the target service feature, the BLE connection can still maintain a normal and stable connection state during the process of the test device and the target Bluetooth jointly executing the Bluetooth communication task corresponding to the target service feature, and the test device and the target Bluetooth device can perform normal data transmission. Otherwise, if there is a security vulnerability in the target service feature, the BLE connection may be in an abnormal state during the process of the test device and the target Bluetooth jointly executing the Bluetooth communication task corresponding to the target service feature. Among them, the above-mentioned abnormal state may include: the BLE connection is disconnected; or the target Bluetooth device times out and fails to receive data transmitted based on the BLE connection.

[0038] Optionally, the characteristic information of the target service characteristic may include a characteristic handle. The test device may call the first test data corresponding to the target service characteristic through the characteristic handle of the target service characteristic to execute the Bluetooth communication task corresponding to the target service characteristic and test the target service characteristic. That is, the test device may initiate a write request to the characteristic handle of the target service characteristic, and based on the write request, send the first test data to the target Bluetooth device based on the BLE connection.

[0039] Optionally, if the characteristic information of the target service characteristic includes a characteristic handle and a read-write status bit, the test device may determine whether the read-write status bit of the service characteristic to be tested is in a writable state before calling the first test data through the characteristic handle of the target service characteristic. If the read-write state of the target service characteristic is in a writable state, the test device may call the first test data through the characteristic handle of the target service characteristic to execute the Bluetooth communication task corresponding to the target service characteristic and test the target service characteristic.

[0040] 330. Detect the connection status of the low-power Bluetooth connection during the execution of the Bluetooth communication task.

[0041] During the execution of the Bluetooth communication task, the test device and the target Bluetooth device can perform two-way data transmission based on the BLE connection. At this time, the test device can monitor the data transmission of the BLE connection to detect whether the BLE connection is disconnected; if the BLE connection is disconnected, it can be determined that the connection state of the BLE connection is abnormal.

[0042] And / or, after the test device sends data to the target Bluetooth device based on the BLE connection, it can monitor whether the target Bluetooth device sends feedback data within a preset time period; if not, the test device can determine that the connection status of the BLE connection is abnormal.

[0043] In addition, if during the execution of the Bluetooth communication task, the BLE connection never experiences any of the aforementioned abnormal states, the test device may determine that the BLE connection is in a normal state during the execution of the Bluetooth communication task.

[0044] 340. If the connection status is abnormal, it is determined that the target service feature has a security vulnerability.

[0045] In some embodiments, if the test device detects that the BLE connection is in an abnormal state, the test device may further record the characteristic information of the service feature to be tested and the first test data corresponding to the service feature to be tested, so that in the subsequent debugging stage, the vulnerability can be reproduced by replaying the corresponding first test data to the service feature with the security vulnerability, and the code module that causes the security vulnerability can be dynamically debugged and located.

[0046] In some embodiments, if the BLE connection remains in a normal state during the execution of the Bluetooth communication task corresponding to the target service feature, the test device may determine that the test result of the service feature to be tested does not contain a security vulnerability.

[0047] In other embodiments, if the BLE connection remains in a normal state during the execution of the Bluetooth communication task corresponding to the target service characteristic, the testing device may obtain second test data different from the first test data, and retest the target service characteristic based on the characteristic information of the target service characteristic and the second test data until the connection state of the BLE connection is an abnormal state.

[0048] The second test data may be generated based on the first test data or may be unrelated to the first test data, and is not specifically limited thereto. The step of the test device retesting the target service feature based on the feature information of the target service feature and the second test data can refer to the step of testing the target service feature using the first test data in the aforementioned embodiment, and the following content will not be repeated.

[0049] That is, if the connection state of the BLE connection remains normal when the target service feature is tested using the first test data, the test device may retest the target service feature using other test data different from the first test data.

[0050] It should be noted that if the second test data retests the target service characteristics, the test device can also obtain other test data different from the second test data, continue to test the target service characteristics, and repeat the cycle until the connection status of the BLE connection is abnormal.

[0051] It can be seen that in the aforementioned embodiment, after the test device establishes a BLE connection with the target Bluetooth device, the characteristic information of the target service characteristic in the GATT service provided by the target Bluetooth device can be obtained, and the Bluetooth communication task corresponding to the target service characteristic can be performed based on the characteristic information of the target service characteristic and the first test data. The test device can detect the connection status of the low-power Bluetooth connection during the execution of the Bluetooth communication task. If the connection status is an abnormal state, it is determined that there is a security vulnerability in the target service characteristic. Based on this, the test device can locate the target service characteristic that may have a security vulnerability in the GATT service provided by the target Bluetooth device, filling the gap in security detection of the GATT service provided by the low-power Bluetooth device, which is conducive to improving the security of the target Bluetooth device.

[0052] In one embodiment, the GATT service provided by the target Bluetooth device may include two or more service characteristics. When the GATT service includes a large number of service characteristics, in order to perform a comprehensive security test on the GATT service provided by the target Bluetooth device, the test device may generate a test characteristic list, which may include one or more service characteristics to be tested selected by the test device from multiple service characteristics. Figure 4 , Figure 4 The following is a flow chart of another method for testing low-power Bluetooth according to an embodiment, which method can be applied to the aforementioned testing device. Figure 4 As shown, the following steps may be included:

[0053] 410. Acquire the GATT service provided by the target Bluetooth device based on the BLE connection, and parse the feature identifier, feature handle, and read / write status bit of each service feature of at least two service features included in the GATT service.

[0054] 420. Select a service feature whose read / write state is writable from at least two service features as the service feature to be tested, and write a feature identifier and a feature handle of the service feature to be tested into a test feature list.

[0055] The test feature list may include one or more service features to be tested, without specific limitation.

[0056] 430. According to the feature identifiers included in the test feature list, select the untested service feature to be tested from the test feature list as the target service feature, and obtain the feature handle of the target service feature.

[0057] The feature identifier UUID of the service feature to be tested can be used as the index of the service feature to be tested in the test feature list. The test device can determine whether each service feature to be tested included in the test feature list has been tested according to the UUID, so as to select any service feature to be tested that has not been tested as the target service feature.

[0058] 440. Call first test data corresponding to the target service characteristic through the characteristic handle of the target service characteristic to execute the Bluetooth communication task corresponding to the target service characteristic.

[0059] 450. During the execution of the Bluetooth communication task, determine whether the connection state of the low-power Bluetooth connection is an abnormal state; if so, execute step 460; if not, execute step 470.

[0060] In step 450 , the abnormal state may include: the BLE connection is disconnected; or the target Bluetooth device times out and fails to receive data transmitted based on the BLE connection.

[0061] 460. Record characteristic information of the target service characteristic and first test data corresponding to the target service characteristic, and end this process.

[0062] In step 460, the characteristic information of the target service characteristic recorded by the test device may include the UUID and characteristic handle of the target service characteristic. The tester may replay the recorded first test data to the UUID and characteristic handle recorded by the test device to reproduce the vulnerability.

[0063] 470 . According to the feature identifier in the to-be-tested feature list, mark the target service feature as tested in the test feature list, and execute step 480 .

[0064] 480. Determine whether all the service features to be tested included in the feature test list have been tested; if so, execute step 490; if not, continue to execute step 430.

[0065] In step 480, the test device can detect whether all the service features to be tested included in the feature test list are marked as tested; if so, it means that the test device has traversed the feature test list and all the service features to be tested included in the feature test list have been tested. If there is at least one service feature to be tested that is not marked as tested, the test device can continue to execute step 430, select the service feature to be tested that is not marked as tested from the test feature list as a new target service feature, and continue to execute steps 440-470 to test the new target service feature.

[0066] Furthermore, if step 480 determines that all the service features to be tested included in the feature list have been tested, it can be explained that in the process of executing the Bluetooth communication tasks corresponding to the service features to be tested, the connection status of the BLE connection remains normal. Therefore, step 490 is executed to retest each service feature to be tested.

[0067] In addition, before executing step 490 , the testing device may clear the tested mark of each service feature to be tested included in the feature test list, so as to execute step 490 to retest each service feature to be tested.

[0068] 490. Obtain third test data corresponding to each service feature to be tested, and retest each service feature to be tested according to feature information of each service feature to be tested and the third test data corresponding to each service feature to be tested.

[0069] The steps of the test device retesting each service feature to be tested using each third test data can refer to the steps of testing each service feature to be tested using each first test data, and will not be repeated in the following content.

[0070] It should be noted that if the BLE connection always remains in a normal state after testing each service feature to be tested using the third test data corresponding to each service feature to be tested, the test equipment may continue to obtain other test data different from the third test data, and continue to use other test data to test each service feature to be tested, and continue the cycle until the connection status of the BLE connection is abnormal.

[0071] In some other possible embodiments, if the test device executes step 480 and determines that all the service features to be tested included in the feature test list have been tested, the test device may also end this process and no longer test each service feature to be tested.

[0072] It can be seen that in the aforementioned embodiment, if the GATT service provided by the target Bluetooth device includes multiple service characteristics, the test device can first screen the multiple service characteristics to generate a feature test list. The one or more service characteristics to be tested included in the feature test list are test targets that require security testing. After generating the feature test list, the test device can directly obtain the feature information from the feature test list. If the test device needs to perform multiple rounds of tests on the service characteristics to be tested, the test device does not need to obtain the feature information based on the BLE connection before each round of testing begins, but can directly obtain it from the feature test list, which is conducive to speeding up the test. In addition, in the aforementioned embodiment, the test device can traverse the service characteristics to be tested included in the feature test list, and comprehensively perform security testing on the GATT service provided by the target Bluetooth device until possible security vulnerabilities are detected.

[0073] In some embodiments, one or more of the aforementioned first test data, second test data, and third test data may be automatically generated by a test device.

[0074] Optionally, the test device may perform a random mutation operation on the sample test data corresponding to the target service characteristic to obtain first test data corresponding to the target service characteristic. The test device may perform multiple tests on the target service characteristic included in the GATT service provided by the target Bluetooth device. The sample test data may be test data that has been used to test the target service characteristic before this test. The random mutation operation may refer to any data processing operation that transforms the data so that the data before and after the transformation changes, and is not specifically limited.

[0075] Optionally, the target service feature may correspond to two or more sample test data. For example, if the test device has tested the target service feature multiple times before this test, since the corresponding test data is different in each test, the target service feature may correspond to at least two sample test data in this test. At this time, the test device can obtain the code coverage of each sample test data. The code coverage of the sample test data may refer to the number of codes that can be triggered by the sample test data, and the proportion of the total number of codes corresponding to the GATT service provided by the target Bluetooth device. The code coverage of the sample test data can be recorded in the round of testing in which the sample test data is used. Exemplarily, the GATT service provided by the target Bluetooth device can be implemented by 100 lines of code. If the test device can trigger 40 lines of code out of the 100 lines of code included in the call of the GATT service when performing a Bluetooth communication task using a certain sample test data, then the code coverage of the sample test data may be 40%.

[0076] After obtaining the code coverage of each sample test data, the test device can select the target test data according to the code coverage of each sample test data, and perform a random mutation operation on the target test data to obtain the first test data. For example, the test device can select the sample test data with the highest code coverage as the target test data; or, it can select the sample test data with a code coverage higher than a probability threshold as the target test data, without specific limitation.

[0077] It should be noted that the above content takes the first test data as an example to describe the specific implementation method of the test device automatically generating test data. The second test data and the third test data can also be generated through the above implementation method, and the following content will not be repeated.

[0078] It can be seen that in the aforementioned embodiment, in addition to automatically detecting the security of one or more service characteristics included in the GATT service provided by the target Bluetooth device, the test device can also automatically generate test data for security detection. The test device can automatically complete low-power Bluetooth testing, which is conducive to improving test efficiency.

[0079] See also Figure 5 , Figure 5 The structure diagram of a low-power Bluetooth test device disclosed in an embodiment is a schematic diagram of a low-power Bluetooth test device, which can be applied to test equipment. Figure 5 As shown, the low-power Bluetooth testing device 500 may include: an acquisition module 510 , a communication module 520 , a detection module 530 , and a determination module 540 .

[0080] An acquisition module 510 is used to acquire characteristic information of a target service characteristic based on a low-power Bluetooth connection; the target service characteristic is a service characteristic included in a GATT service provided by a target Bluetooth device;

[0081] The communication module 520 is used to perform a Bluetooth communication task corresponding to the target service characteristic according to the characteristic information of the target service characteristic and the first test data corresponding to the target service characteristic;

[0082] A detection module 530, used to detect the connection status of the low-power Bluetooth connection during the execution of the Bluetooth communication task;

[0083] The determination module 540 is used to determine whether a security vulnerability exists in the target service feature when the connection state is an abnormal state.

[0084] In one embodiment, the low power Bluetooth testing device 500 may further include: a recording module.

[0085] The recording module is used to record the characteristic information of the target service characteristic and the first test data corresponding to the target service characteristic when the connection state is an abnormal state.

[0086] In one embodiment, the acquisition module 510 may also be used to acquire second test data corresponding to the target service feature when the connection state is a normal state; the second test data is different from the first test data.

[0087] In one embodiment, the communication module 520 is used to perform a Bluetooth communication task corresponding to the target service characteristic based on the characteristic information of the target service characteristic and the second test data corresponding to the target service characteristic, so as to retest the target service characteristic until the connection state of the low-power Bluetooth connection is abnormal.

[0088] Among them, the above-mentioned re-testing of the target service characteristics may include that after the communication module 520 executes the Bluetooth communication task corresponding to the target service characteristics according to the second test data, the detection module 530 and the determination module 540 execute the operations corresponding to the two modules respectively to determine whether there are security vulnerabilities in the target service characteristics.

[0089] In one embodiment, the feature information includes: a feature handle.

[0090] The communication module 520 can also be used to call the first test data corresponding to the target service characteristic through the characteristic handle of the target service characteristic to execute the Bluetooth communication task corresponding to the target service characteristic; the first test data corresponds to the target service characteristic.

[0091] In one embodiment, the characteristic information further includes: a read / write status bit.

[0092] The communication module 520 may also be used to call the first test data through the feature handle of the target service feature when the read / write status bit of the service device to be tested is in a writable state, so as to execute the Bluetooth communication task corresponding to the target service feature.

[0093] In one embodiment, the GATT service provided by the target Bluetooth device includes at least two service characteristics.

[0094] The acquisition module 510 can also be used to acquire the GATT service provided by the target Bluetooth device based on the low-power Bluetooth connection; and, parse the feature identifier, feature handle and read-write status bit of each service feature of at least two service features included in the GATT service; and, select a service feature whose read-write state is writable from the at least two service features as the service feature to be tested, and write the feature identifier and feature handle of the service feature to be tested into a test feature list; and, based on the feature identifier included in the test feature list, select a service feature to be tested that has not been tested from the test feature list as the target service feature, and obtain the feature handle of the target service feature.

[0095] In one embodiment, the test feature list includes at least two service features to be tested. The low power Bluetooth test device 500 may further include: a recording module.

[0096] The recording module can be used to mark the target service feature as tested in the test feature list according to the feature identifier of the target service feature when the connection state is normal.

[0097] The acquisition module 510 can also be used to select an untested service feature to be tested from the test feature list as a new target service feature after the recording module marks the target service feature as tested, and execute an operation of acquiring a feature handle of the target service feature.

[0098] In one embodiment, the acquisition module 510 may also be used to acquire third test data corresponding to each service feature to be tested, if the connection status of the low-power Bluetooth connection remains normal during the execution of the Bluetooth communication task corresponding to each service feature to be tested included in the test feature list; the third test data corresponding to each service feature to be tested is different from the first test data corresponding to the service feature to be tested;

[0099] The communication module 520 is used to retest each service feature to be tested according to the feature information of each service feature to be tested and the third test data corresponding to each service feature to be tested, so as to retest each service feature to be tested until the connection state of the low-power Bluetooth connection is abnormal.

[0100] In one embodiment, the low power Bluetooth test device 500 may further include: a generating module.

[0101] The generation module may also be used to perform a random mutation operation on the sample test data corresponding to the target service feature to obtain the first test data corresponding to the target service feature before the communication module 520 performs the Bluetooth communication task corresponding to the target service feature according to the feature information of the target service feature and the first test data corresponding to the target service feature; or

[0102] Target test data is selected from at least two sample test data according to the code coverage of at least two sample test data, and a random mutation operation is performed on the target test data to obtain first test data corresponding to a target service feature; the target service feature corresponds to at least two sample test data.

[0103] Implementing the low-power Bluetooth test device disclosed in the embodiment of the present application, after the low-power Bluetooth test device establishes a BLE connection with the target Bluetooth device, it can obtain the characteristic information of the target service characteristic in the GATT service provided by the target Bluetooth device, and perform the Bluetooth communication task corresponding to the target service characteristic based on the characteristic information of the target service characteristic and the first test data. The low-power Bluetooth test device can detect the connection status of the low-power Bluetooth connection during the execution of the Bluetooth communication task. If the connection status is abnormal, it is determined that the target service characteristic has a security vulnerability. Based on this, the low-power Bluetooth test device can locate the target service characteristic that may have a security vulnerability in the GATT service provided by the target Bluetooth device, filling the gap in security detection of the GATT service provided by the low-power Bluetooth device, which is conducive to improving the security of the target Bluetooth device.

[0104] See also Figure 6 , Figure 6 FIG. 1 is a schematic diagram of a structure of a test device disclosed in an embodiment. Figure 6 The test device 600 may include:

[0105] A memory 610 storing executable program codes;

[0106] a processor 620 coupled to the memory 610;

[0107] The processor 620 calls the executable program code stored in the memory 610 to execute any one of the low-power Bluetooth test methods disclosed in the embodiments of the present application.

[0108] It should be noted that Figure 6 The test device shown may also include components not shown, such as a power supply, input buttons, a camera, a speaker, a screen, an RF circuit, a Wi-Fi module, a Bluetooth module, and sensors, which are not described in detail in this embodiment.

[0109] See also Figure 7 , Figure 7 FIG. 1 is a schematic diagram of a low-power Bluetooth test system disclosed in an embodiment. Figure 7 As shown, the low-power Bluetooth test system 700 may include: a test device 710 and a target Bluetooth device 720. There is a BLE connection between the test device 710 and the target Bluetooth device 720.

[0110] The target Bluetooth device 720 can be used to provide GATT services;

[0111] The test device 710 can be used to obtain characteristic information of a target service characteristic based on a low-power Bluetooth connection; the target service characteristic is a service characteristic included in a GATT service;

[0112] The test device 710 is also used to execute a Bluetooth communication task corresponding to the target service characteristic based on the characteristic information of the target service characteristic and the first test data corresponding to the target service characteristic; and to detect the connection status of the low-power Bluetooth connection during the execution of the Bluetooth communication task; and, if the connection status is an abnormal state, determine that there is a security vulnerability in the target service characteristic.

[0113] In some other possible embodiments, the test device 710 and the target Bluetooth device 720 may execute the operations respectively performed by the test device and the target Bluetooth device in any one of the low-power Bluetooth test methods disclosed in the aforementioned embodiments, which will not be described in detail below.

[0114] An embodiment of the present application discloses a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute any one of the low-power Bluetooth test methods disclosed in the embodiments of the present application.

[0115] An embodiment of the present application discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute any one of the low-power Bluetooth test methods disclosed in the embodiments of the present application.

[0116] It should be understood that the "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. Those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required for the present application.

[0117] In the various embodiments of the present application, it should be understood that the size of the serial numbers of the above-mentioned processes does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0118] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0119] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0120] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-accessible memory. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a memory and includes several requests for a computer device (which can be a personal computer, a server or a network device, etc., specifically a processor in a computer device) to perform some or all of the steps of the above-mentioned methods of various embodiments of the present application.

[0121] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0122] The above is a detailed introduction to a low-power Bluetooth test method, device, system, test equipment and storage medium disclosed in the embodiments of the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core ideas of the present application. At the same time, for those of ordinary skill in the art, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A low-power Bluetooth testing method, characterized in that: Applied to a test device, there is a low-power Bluetooth connection between the test device and a target Bluetooth device to be tested; the method comprises: Acquire characteristic information of a target service characteristic based on the low-power Bluetooth connection; the target service characteristic is a service characteristic included in a GATT service provided by the target Bluetooth device; Execute a Bluetooth communication task corresponding to the target service characteristic according to the characteristic information of the target service characteristic and the first test data corresponding to the target service characteristic; Detecting the connection status of the low-power Bluetooth connection during the execution of the Bluetooth communication task; If the connection state is an abnormal state, determining that the target service feature has a security vulnerability; The characteristic information includes: a characteristic handle and a read / write status bit; and the performing of a Bluetooth communication task corresponding to the target service characteristic according to the characteristic information of the target service characteristic and the first test data corresponding to the target service characteristic includes: If the read / write status bit of the service device to be tested is in a writable state, the first test data is called through the feature handle of the target service feature to execute the Bluetooth communication task corresponding to the target service feature; the first test data corresponds to the target service feature.

2. The method according to claim 1, characterized in that The method further comprises: If the connection state is an abnormal state, the characteristic information of the target service characteristic and the first test data corresponding to the target service characteristic are recorded.

3. The method according to claim 1, characterized in that After detecting the connection state of the low-power Bluetooth connection during the execution of the Bluetooth communication task, the method further includes: If the connection state is a normal state, obtaining second test data corresponding to the target service feature; the second test data is different from the first test data; The target service characteristic is retested according to the characteristic information of the target service characteristic and the second test data until the connection state of the low-power Bluetooth connection is abnormal.

4. The method according to claim 1, characterized in that: The GATT service includes at least two service characteristics; The characteristic information also includes: a characteristic identifier and a read / write status bit; and the characteristic information of the target service characteristic acquired based on the low-power Bluetooth connection includes: Acquire the GATT service provided by the target Bluetooth device based on the Bluetooth low energy connection; Parsing the feature identifier, feature handle, and read / write status bit of each service feature of at least two service features included in the GATT service; Select a service feature whose read / write state is writable from the at least two service features as the service feature to be tested, and write the feature identifier and feature handle of the service feature to be tested into the test feature list; According to the feature identifiers included in the test feature list, a service feature to be tested that has not been tested is selected from the test feature list as a target service feature, and a feature handle of the target service feature is obtained.

5. The method according to claim 4, characterized in that The test feature list includes at least two service features to be tested; And, after detecting the connection state of the low-power Bluetooth connection during the execution of the Bluetooth communication task, the method further includes: If the connection state is a normal state, marking the target service feature as tested in the test feature list according to the feature identifier of the target service feature; A service feature to be tested that has not been tested is selected from the test feature list as a new target service feature, and the step of obtaining a feature handle of the target service feature is performed.

6. The method according to claim 5, characterized in that The method further comprises: If, in the process of executing the Bluetooth communication tasks corresponding to the service features to be tested included in the test feature list, the connection status of the low-power Bluetooth connection remains normal, then obtaining second test data corresponding to the service features to be tested; the third test data corresponding to each of the service features to be tested is different from the first test data corresponding to the service features to be tested; Retest each of the service characteristics to be tested according to the characteristic information of each of the service characteristics to be tested and the third test data respectively corresponding to each of the service characteristics to be tested until the connection state of the low-power Bluetooth connection is in an abnormal state.

7. The method according to any one of claims 1 to 6, characterized in that: Before executing the Bluetooth communication task corresponding to the target service characteristic according to the characteristic information of the target service characteristic and the first test data corresponding to the target service characteristic, the method further includes: Performing a random mutation operation on the sample test data corresponding to the target service feature to obtain first test data corresponding to the target service feature; or, Target test data are selected from the at least two sample test data according to the code coverage of the at least two sample test data, and a random mutation operation is performed on the target test data to obtain first test data corresponding to the target service feature; the target service feature corresponds to the at least two sample test data.

8. A low-power Bluetooth test device, characterized in that: Applied to a test device, where there is a low-power Bluetooth connection between the test device and a target Bluetooth device to be tested; the device comprises: An acquisition module, configured to acquire characteristic information of a target service characteristic based on the low-power Bluetooth connection; the target service characteristic is a service characteristic included in a GATT service provided by the target Bluetooth device; A communication module, configured to execute a Bluetooth communication task corresponding to the target service characteristic according to the characteristic information of the target service characteristic and the first test data corresponding to the target service characteristic; A detection module, used for detecting the connection status of the low-power Bluetooth connection during the execution of the Bluetooth communication task; A determination module, configured to determine that a security vulnerability exists in the target service feature if the connection state is an abnormal state; The characteristic information includes: characteristic handle, read and write status bit; The communication module can also be used to call the first test data through the feature handle of the target service feature when the read-write status bit of the service device to be tested is in a writable state to execute the Bluetooth communication task corresponding to the target service feature, and the first test data corresponds to the target service feature.

9. A testing device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor implements the method according to any one of claims 1 to 7.

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 method according to any one of claims 1 to 7 is implemented.

11. A low-power Bluetooth test system, characterized in that: The system comprises: a test device and a target Bluetooth device to be tested; there is a low-power Bluetooth connection between the test device and the target Bluetooth device; The target Bluetooth device is used to provide GATT services; The test device is used to obtain characteristic information of a target service characteristic based on the low-power Bluetooth connection; the target service characteristic is a service characteristic included in the GATT service; The test device is further used to execute a Bluetooth communication task corresponding to the target service feature according to the feature information of the target service feature and the first test data corresponding to the target service feature; and, during the execution of the Bluetooth communication task, detect the connection state of the low-power Bluetooth connection; and, if the connection state is an abnormal state, determine that the target service feature has a security vulnerability; The characteristic information includes: characteristic handle, read and write status bit; The test device is also used to call the first test data through the feature handle of the target service feature when the read-write status bit of the service device to be tested is in a writable state to execute the Bluetooth communication task corresponding to the target service feature; the first test data corresponds to the target service feature.

Citation Information

Patent Citations

  • Remote security networking device and method based on Bluetooth BLE, computer equipment and storage medium

    CN114390496A