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

Function runQuickTest

src/modules/ble/BLE_Suite.cpp:4534–4581  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4532}
4533
4534void runQuickTest(NimBLEAddress target) {
4535 AutoCleanup cleanup([]() { BLEStateManager::deinitBLE(true); });
4536
4537 showAttackProgress("Quick testing (HFP + FastPair)...", TFT_WHITE);
4538
4539 bool hasHFP = false;
4540 if (xSemaphoreTake(scannerData.mutex, portMAX_DELAY)) {
4541 for (size_t i = 0; i < scannerData.deviceAddresses.size(); i++) {
4542 if (scannerData.deviceAddresses[i] == target.toString().c_str()) {
4543 hasHFP = scannerData.deviceHasHFP[i];
4544 break;
4545 }
4546 }
4547 xSemaphoreGive(scannerData.mutex);
4548 }
4549
4550 std::vector<String> results;
4551
4552 if (hasHFP) {
4553 HFPExploitEngine hfp;
4554 bool hfpVulnerable = hfp.testCVE202536911(target);
4555 results.push_back("HFP (CVE-2025-36911): " + String(hfpVulnerable ? "VULNERABLE" : "SAFE"));
4556 } else {
4557 results.push_back("HFP: Not detected");
4558 }
4559
4560 FastPairExploitEngine fpEngine;
4561 bool fpVulnerable = fpEngine.testVulnerability(target);
4562 results.push_back("FastPair: " + String(fpVulnerable ? "VULNERABLE" : "SAFE"));
4563
4564 std::vector<String> lines;
4565 lines.push_back("QUICK VULNERABILITY TEST");
4566 lines.push_back("Target: " + String(target.toString().c_str()));
4567 for (auto &result : results) lines.push_back(result);
4568 lines.push_back("");
4569 lines.push_back("Test completed");
4570
4571 cleanup.disable();
4572
4573 if (hasHFP && results[0].indexOf("VULNERABLE") != -1) {
4574 lines.push_back("Try HFP-based attacks first!");
4575 showDeviceInfoScreen("VULNERABLE DEVICE", lines, TFT_ORANGE, TFT_BLACK);
4576 } else if (fpVulnerable) {
4577 showDeviceInfoScreen("VULNERABLE", lines, TFT_RED, TFT_WHITE);
4578 } else {
4579 showDeviceInfoScreen("SAFE", lines, TFT_GREEN, TFT_BLACK);
4580 }
4581}
4582
4583void runDeviceProfiling(NimBLEAddress target) {
4584 AutoCleanup cleanup([]() { BLEStateManager::deinitBLE(true); });

Callers 1

Calls 6

showAttackProgressFunction · 0.85
showDeviceInfoScreenFunction · 0.85
sizeMethod · 0.80
testCVE202536911Method · 0.80
testVulnerabilityMethod · 0.80
disableMethod · 0.80

Tested by

no test coverage detected