MCPcopy Create free account
hub / github.com/BruceDevices/firmware / testHIDVulnerability

Method testHIDVulnerability

src/modules/ble/BLE_Suite.cpp:926–952  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

924}
925
926bool HIDExploitEngine::testHIDVulnerability(NimBLEAddress target) {
927 String connectionMethod = "";
928 NimBLEClient *pClient = attemptConnectionWithStrategies(target, connectionMethod);
929 if (!pClient) return false;
930
931 bool hasHID = false, hasWriteAccess = false;
932 const std::vector<NimBLERemoteService *> &services = pClient->getServices(true);
933 for (auto &service : services) {
934 std::string uuidStr = service->getUUID().toString();
935 if (uuidStr.find("1812") != std::string::npos) {
936 hasHID = true;
937 const std::vector<NimBLERemoteCharacteristic *> &chars = service->getCharacteristics(true);
938 for (auto &ch : chars) {
939 if (ch->canWrite()) {
940 hasWriteAccess = true;
941 break;
942 }
943 }
944 }
945 }
946
947 pClient->disconnect();
948 BLEStateManager::unregisterClient(pClient);
949 NimBLEDevice::deleteClient(pClient);
950 BLEStateManager::deinitBLE(true);
951 return hasHID && hasWriteAccess;
952}
953
954//=============================================================================
955// WhisperPair Exploit (FastPair Crypto Attacks)

Callers 1

showHIDSubMenuFunction · 0.80

Calls 1

Tested by

no test coverage detected