The fuzzer plugins for libbtcore
are designed based on the understanding of the source code and tries to achieve the following:
The configuration parameters are not hard-coded, but instead selected based on incoming data. This ensures more code paths are reached by the fuzzers.
Fuzzers assigns values to the following parameters to pass on to libbtcore:
deviceType
)mode
)btAddress
)deviceClassT
)Parameter | Valid Values | Configured Value |
---|---|---|
deviceType | 0.BT_DEVICE_DEVTYPE_BREDR 1.BT_DEVICE_DEVTYPE_BLE 2.BT_DEVICE_DEVTYPE_DUAL | Value obtained from FuzzedDataProvider |
mode | 0.BT_SCAN_MODE_NONE 1.BT_SCAN_MODE_CONNECTABLE 2.BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE | Value obtained from FuzzedDataProvider |
btAddress | Values inside array ranges from 0x0 to 0xFF | Value obtained from FuzzedDataProvider |
deviceClassT | Values inside array ranges from 0x0 to 0xFF | Value obtained from FuzzedDataProvider |
This also ensures that the plugins are always deterministic for any given input. |
The plugins feed the entire input data to the module. This ensures that the plugins tolerates any kind of input (empty, huge, malformed, etc) and doesn't exit()
on any input and thereby increasing the chance of identifying vulnerabilities.
This describes steps to build btcore_device_class_fuzzer, btcore_property_fuzzer and btcore_module_fuzzer binaries.
Build the fuzzer
$ mm -j$(nproc) btcore_device_class_fuzzer $ mm -j$(nproc) btcore_property_fuzzer $ mm -j$(nproc) btcore_module_fuzzer
To run on device
$ adb sync data $ adb shell /data/fuzz/arm64/btcore_device_class_fuzzer/btcore_device_class_fuzzer $ adb shell /data/fuzz/arm64/btcore_property_fuzzer/btcore_property_fuzzer $ adb shell /data/fuzz/arm64/btcore_module_fuzzer/btcore_module_fuzzer