From 866030eb496f1c745c7ad02967caf41ca8bafce6 Mon Sep 17 00:00:00 2001 From: Just Call Me Koko Date: Wed, 22 Apr 2026 18:54:52 -0400 Subject: [PATCH 1/3] Move flock wardrive to main wardrive --- esp32_marauder/WiFiScan.cpp | 366 +++++++++++++++++------------------- esp32_marauder/WiFiScan.h | 2 + 2 files changed, 174 insertions(+), 194 deletions(-) diff --git a/esp32_marauder/WiFiScan.cpp b/esp32_marauder/WiFiScan.cpp index 4401c2f..7085b50 100644 --- a/esp32_marauder/WiFiScan.cpp +++ b/esp32_marauder/WiFiScan.cpp @@ -551,6 +551,23 @@ extern "C" { wifi_scan_obj.save_mac(mac_char); wifi_scan_obj.bt_frames++; + + #ifndef HAS_NIMBLE_2 + uint8_t* payLoad = advertisedDevice->getPayload(); + size_t len = advertisedDevice->getPayloadLength(); + #else + const std::vector& payloadVec = advertisedDevice->getPayload(); + const uint8_t* payLoad = payloadVec.data(); + size_t len = payloadVec.size(); + #endif + + String name = advertisedDevice->getName().c_str(); + + String serial; + + // Final decision on marking as Flock Penguin battery + if (wifi_scan_obj.isFlockCamera(payLoad, len, name, &serial)) + wifi_scan_obj.flock_devices++; } } #endif @@ -732,6 +749,8 @@ extern "C" { } #endif + wif_scan_obj.flock_devices++; + // To-do: // track in a list like AirTag / Flipper, if you want // (struct FlockBattery { String mac; String name; String serial; int rssi; uint32_t last_seen; }; etc.) @@ -911,6 +930,8 @@ extern "C" { if (do_save) buffer_obj.append(wardrive_line); + wif_scan_obj.flock_devices++; + // To-do: // track in a list like AirTag / Flipper, if you want // (struct FlockBattery { String mac; String name; String serial; int rssi; uint32_t last_seen; }; etc.) @@ -1323,6 +1344,23 @@ extern "C" { wifi_scan_obj.save_mac(mac_char); + #ifndef HAS_NIMBLE_2 + uint8_t* payLoad = advertisedDevice->getPayload(); + size_t len = advertisedDevice->getPayloadLength(); + #else + const std::vector& payloadVec = advertisedDevice->getPayload(); + const uint8_t* payLoad = payloadVec.data(); + size_t len = payloadVec.size(); + #endif + + String name = advertisedDevice->getName().c_str(); + + String serial; + + // Final decision on marking as Flock Penguin battery + if (wifi_scan_obj.isFlockCamera(payLoad, len, name, &serial)) + wifi_scan_obj.flock_devices++; + wifi_scan_obj.bt_frames++; } } @@ -1353,108 +1391,17 @@ extern "C" { uint8_t* payLoad = advertisedDevice->getPayload(); size_t len = advertisedDevice->getPayloadLength(); #else - const std::vector& payLoad = advertisedDevice->getPayload(); - size_t len = payLoad.size(); + const std::vector& payloadVec = advertisedDevice->getPayload(); + const uint8_t* payLoad = payloadVec.data(); + size_t len = payloadVec.size(); #endif - bool hasXuntongMfg = false; - size_t mfgIndex = 0; // index of 0xFF (AD type) - - // Look for Company ID XUNTONG (0x09C8), - for (size_t i = 1; i + 3 < len; i++) { - if (payLoad[i] == 0xFF && // AD type: Manufacturer Specific - payLoad[i + 1] == 0xC8 && - payLoad[i + 2] == 0x09) { - hasXuntongMfg = true; - mfgIndex = i; - break; - } - } - String name = advertisedDevice->getName().c_str(); - // Check for old penguin name - bool penguin = false; - - if (name.length() > 0) { - // Old firmware: "Penguin-XXXXXXXXXX" - if (name.startsWith("Penguin-") && name.length() == 18) { - bool allDigits = true; - for (int i = 8; i < name.length(); i++) { - char c = name.charAt(i); - if (c < '0' || c > '9') { - allDigits = false; - break; - } - } - if (allDigits) { - penguin = true; - } - } - - // Legacy name: "FS Ext Battery" - if (name == "FS Ext Battery") { - penguin = true; - } - - // New firmware: "NNNNNNNNNN" (10 digits) - if (name.length() == 10) { - bool allDigits = true; - for (int i = 0; i < name.length(); i++) { - char c = name.charAt(i); - if (c < '0' || c > '9') { - allDigits = false; - break; - } - } - if (allDigits) { - penguin = true; - } - } - } - - // Try to extract serial number from the XUNTONG manufacturer data - String serial = ""; - - if (hasXuntongMfg && mfgIndex > 0) { - uint8_t adLen = payLoad[mfgIndex - 1]; // length byte for this AD structure - size_t adStart = mfgIndex - 1; - size_t adEnd = adStart + adLen; // exclusive end index - - if (adEnd > len) { - adEnd = len; - } - - size_t vendorStart = mfgIndex + 3; - if (vendorStart < adEnd) { - bool started = false; - - for (size_t k = vendorStart; k < adEnd; k++) { - char c = (char)payLoad[k]; - - if (!started) { - if (c == 'T' && (k + 1) < adEnd && (char)payLoad[k + 1] == 'N') { - started = true; - serial += 'T'; - serial += 'N'; - k++; - } - } else { - // Once started, append digits (skip separators; stop on anything else) - if (c >= '0' && c <= '9') { - serial += c; - } else if (c == ' ' || c == '#' || c == '-') { - continue; - } else { - break; - } - } - } - } - } + String serial; // Final decision on marking as Flock Penguin battery - if (hasXuntongMfg && (penguin || name.length() == 0)) { + if (wifi_scan_obj.isFlockCamera(payLoad, len, name, &serial)) { String mac = advertisedDevice->getAddress().toString().c_str(); mac.toUpperCase(); int rssi = advertisedDevice->getRSSI(); @@ -1527,108 +1474,17 @@ extern "C" { uint8_t* payLoad = advertisedDevice->getPayload(); size_t len = advertisedDevice->getPayloadLength(); #else - const std::vector& payLoad = advertisedDevice->getPayload(); - size_t len = payLoad.size(); + const std::vector& payloadVec = advertisedDevice->getPayload(); + const uint8_t* payLoad = payloadVec.data(); + size_t len = payloadVec.size(); #endif - bool hasXuntongMfg = false; - size_t mfgIndex = 0; // index of 0xFF (AD type) - - // Look for Company ID XUNTONG (0x09C8), - for (size_t i = 1; i + 3 < len; i++) { - if (payLoad[i] == 0xFF && // AD type: Manufacturer Specific - payLoad[i + 1] == 0xC8 && - payLoad[i + 2] == 0x09) { - hasXuntongMfg = true; - mfgIndex = i; - break; - } - } - String name = advertisedDevice->getName().c_str(); - // Check for old penguin name - bool penguin = false; - - if (name.length() > 0) { - // Old firmware: "Penguin-XXXXXXXXXX" - if (name.startsWith("Penguin-") && name.length() == 18) { - bool allDigits = true; - for (int i = 8; i < name.length(); i++) { - char c = name.charAt(i); - if (c < '0' || c > '9') { - allDigits = false; - break; - } - } - if (allDigits) { - penguin = true; - } - } - - // Legacy name: "FS Ext Battery" - if (name == "FS Ext Battery") { - penguin = true; - } - - // New firmware: "NNNNNNNNNN" (10 digits) - if (name.length() == 10) { - bool allDigits = true; - for (int i = 0; i < name.length(); i++) { - char c = name.charAt(i); - if (c < '0' || c > '9') { - allDigits = false; - break; - } - } - if (allDigits) { - penguin = true; - } - } - } - - // Try to extract serial number from the XUNTONG manufacturer data - String serial = ""; - - if (hasXuntongMfg && mfgIndex > 0) { - uint8_t adLen = payLoad[mfgIndex - 1]; // length byte for this AD structure - size_t adStart = mfgIndex - 1; - size_t adEnd = adStart + adLen; // exclusive end index - - if (adEnd > len) { - adEnd = len; - } - - size_t vendorStart = mfgIndex + 3; - if (vendorStart < adEnd) { - bool started = false; - - for (size_t k = vendorStart; k < adEnd; k++) { - char c = (char)payLoad[k]; - - if (!started) { - if (c == 'T' && (k + 1) < adEnd && (char)payLoad[k + 1] == 'N') { - started = true; - serial += 'T'; - serial += 'N'; - k++; - } - } else { - // Once started, append digits (skip separators; stop on anything else) - if (c >= '0' && c <= '9') { - serial += c; - } else if (c == ' ' || c == '#' || c == '-') { - continue; - } else { - break; - } - } - } - } - } + String serial; // Final decision on marking as Flock Penguin battery - if (hasXuntongMfg && (penguin || name.length() == 0)) { + if (wifi_scan_obj.isFlockCamera(payLoad, len, name, &serial)) { String mac = advertisedDevice->getAddress().toString().c_str(); mac.toUpperCase(); int rssi = advertisedDevice->getRSSI(); @@ -1684,6 +1540,8 @@ extern "C" { if (do_save) buffer_obj.append(wardrive_line); + wifi_scan_obj.flock_devices++; + // To-do: // track in a list like AirTag / Flipper, if you want // (struct FlockBattery { String mac; String name; String serial; int rssi; uint32_t last_seen; }; etc.) @@ -1850,6 +1708,119 @@ extern "C" { #endif #endif +bool WiFiScan::isFlockCamera(const uint8_t* payload, size_t len, const String& name, String* serial_out) { + if (payload == nullptr || len < 4) { + return false; + } + + bool hasXuntongMfg = false; + size_t mfgIndex = 0; + + // Find XUNTONG manufacturer data (0xFF, 0xC8, 0x09) + for (size_t i = 1; i + 2 < len; i++) { + if (payload[i] == 0xFF && + payload[i + 1] == 0xC8 && + payload[i + 2] == 0x09) { + hasXuntongMfg = true; + mfgIndex = i; + break; + } + } + + if (!hasXuntongMfg) { + return false; + } + + // --- Penguin name detection --- + bool penguin = false; + + if (name.length() > 0) { + + // "Penguin-XXXXXXXXXX" + if (name.startsWith("Penguin-") && name.length() == 18) { + bool allDigits = true; + for (int i = 8; i < name.length(); i++) { + char c = name.charAt(i); + if (c < '0' || c > '9') { + allDigits = false; + break; + } + } + if (allDigits) penguin = true; + } + + // "FS Ext Battery" + if (name == "FS Ext Battery") { + penguin = true; + } + + // "NNNNNNNNNN" + if (name.length() == 10) { + bool allDigits = true; + for (int i = 0; i < name.length(); i++) { + char c = name.charAt(i); + if (c < '0' || c > '9') { + allDigits = false; + break; + } + } + if (allDigits) penguin = true; + } + } + + bool isFlock = (penguin || name.length() == 0); + + if (!isFlock) { + return false; + } + + // --- Serial extraction --- + if (serial_out != nullptr) { + *serial_out = ""; + + if (mfgIndex > 0) { + uint8_t adLen = payload[mfgIndex - 1]; + size_t adStart = mfgIndex - 1; + size_t adEnd = adStart + adLen; + + if (adEnd > len) { + adEnd = len; + } + + size_t vendorStart = mfgIndex + 3; + + if (vendorStart < adEnd) { + bool started = false; + + for (size_t k = vendorStart; k < adEnd; k++) { + char c = (char)payload[k]; + + if (!started) { + if (c == 'T' && + (k + 1) < adEnd && + (char)payload[k + 1] == 'N') { + started = true; + *serial_out += 'T'; + *serial_out += 'N'; + k++; + } + } else { + if (c >= '0' && c <= '9') { + *serial_out += c; + } else if (c == ' ' || c == '#' || c == '-') { + continue; + } else { + break; + } + } + } + } + } + } + + return true; +} + void WiFiScan::RunSetup() { if (ieee80211_raw_frame_sanity_check(31337, 0, 0) == 1) this->wsl_bypass_enabled = true; @@ -2668,6 +2639,7 @@ void WiFiScan::StopScan(uint8_t scan_mode) { this->mgmt_frames = 0; this->data_frames = 0; this->beacon_frames = 0; + this->flock_devices = 0; this->req_frames = 0; this->resp_frames = 0; this->deauth_frames = 0; @@ -5124,13 +5096,19 @@ void WiFiScan::displayWardriveStats() { display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK); display_obj.tft.println("WiFi: " + (String)this->beacon_frames); display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK); - display_obj.tft.println("BT: " + (String)this->bt_frames + "\n"); + display_obj.tft.println("BT: " + (String)this->bt_frames); + display_obj.tft.setTextSize(2); + display_obj.tft.setTextColor(TFT_RED, TFT_BLACK); + display_obj.tft.println("Flock: " + (String)this->flock_devices + "\n"); #else display_obj.tft.setTextSize(2); display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK); display_obj.tft.println("WiFi:" + (String)this->beacon_frames); display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK); - display_obj.tft.println("BT:" + (String)this->bt_frames + "\n"); + display_obj.tft.println("BT:" + (String)this->bt_frames); + display_obj.tft.setTextSize(1); + display_obj.tft.setTextColor(TFT_RED, TFT_BLACK); + display_obj.tft.println("Flock: " + (String)this->flock_devices + "\n"); #endif diff --git a/esp32_marauder/WiFiScan.h b/esp32_marauder/WiFiScan.h index 3d0f72a..c753dd6 100644 --- a/esp32_marauder/WiFiScan.h +++ b/esp32_marauder/WiFiScan.h @@ -717,6 +717,7 @@ class WiFiScan uint32_t deauth_frames = 0; uint32_t eapol_frames = 0; uint32_t complete_eapol = 0; + uint32_t flock_devices = 0; int8_t min_rssi = 0; int8_t max_rssi = -128; @@ -825,6 +826,7 @@ class WiFiScan wifi_config_t ap_config; + bool isFlockCamera(const uint8_t* payload, size_t len, const String& name, String* serial_out); uint16_t rssiToColor(int8_t rssi); bool isMetaIdentifier(uint16_t id); bool isBlockedIdentifier(uint16_t id); From 1297afe012558a4fab29834b7d34c9fb99265649 Mon Sep 17 00:00:00 2001 From: Just Call Me Koko Date: Wed, 22 Apr 2026 22:13:39 -0400 Subject: [PATCH 2/3] Remove Flock Wardrive --- esp32_marauder/CommandLine.cpp | 9 +- esp32_marauder/CommandLine.h | 2 +- esp32_marauder/MenuFunctions.cpp | 7 - esp32_marauder/WiFiScan.cpp | 343 +------------------------------ 4 files changed, 3 insertions(+), 358 deletions(-) diff --git a/esp32_marauder/CommandLine.cpp b/esp32_marauder/CommandLine.cpp index 47719d2..d96ad60 100644 --- a/esp32_marauder/CommandLine.cpp +++ b/esp32_marauder/CommandLine.cpp @@ -553,14 +553,7 @@ void CommandLine::runCommand(String input) { #ifdef HAS_GPS if (gps_obj.getGpsModuleStatus()) { //int sta_sw = this->argSearch(&cmd_args, "-s"); - int flk_sw = this->argSearch(&cmd_args, "-f"); - - if (flk_sw != -1) { - this->startScanFromCLI(BT_SCAN_FLOCK_WARDRIVE, TFT_GREEN, "Flock Wardrive"); - } - else { - this->startScanFromCLI(WIFI_SCAN_WAR_DRIVE, TFT_GREEN, "Wardrive"); - } + this->startScanFromCLI(WIFI_SCAN_WAR_DRIVE, TFT_GREEN, "Wardrive"); } else Serial.println(F("GPS Module not detected")); diff --git a/esp32_marauder/CommandLine.h b/esp32_marauder/CommandLine.h index d06e9b6..3728b04 100644 --- a/esp32_marauder/CommandLine.h +++ b/esp32_marauder/CommandLine.h @@ -152,7 +152,7 @@ const char PROGMEM HELP_SNIFF_MULTISSID_CMD[] = "sniffmultissid"; const char PROGMEM HELP_SNIFF_DEAUTH_CMD[] = "sniffdeauth"; const char PROGMEM HELP_SNIFF_PMKID_CMD[] = "sniffpmkid [-c ][-d][-l]"; const char PROGMEM HELP_STOPSCAN_CMD[] = "stopscan [-f]"; -const char PROGMEM HELP_WARDRIVE_CMD[] = "wardrive [-f]"; +const char PROGMEM HELP_WARDRIVE_CMD[] = "wardrive"; const char PROGMEM HELP_PING_CMD[] = "pingscan"; const char PROGMEM HELP_PORT_SCAN_CMD[] = "portscan [-a -t ]/[-s ]"; const char PROGMEM HELP_ARP_SCAN_CMD[] = "arpscan [-f]"; diff --git a/esp32_marauder/MenuFunctions.cpp b/esp32_marauder/MenuFunctions.cpp index d3f93ff..b1c93bb 100644 --- a/esp32_marauder/MenuFunctions.cpp +++ b/esp32_marauder/MenuFunctions.cpp @@ -302,7 +302,6 @@ void MenuFunctions::main(uint32_t currentTime) (wifi_scan_obj.currentScanMode == BT_SCAN_AIRTAG_MON) || (wifi_scan_obj.currentScanMode == BT_SCAN_FLIPPER) || (wifi_scan_obj.currentScanMode == BT_SCAN_FLOCK) || - (wifi_scan_obj.currentScanMode == BT_SCAN_FLOCK_WARDRIVE) || (wifi_scan_obj.currentScanMode == BT_SCAN_SIMPLE) || (wifi_scan_obj.currentScanMode == BT_SCAN_SIMPLE_TWO) || (wifi_scan_obj.currentScanMode == BT_ATTACK_SOUR_APPLE) || @@ -406,7 +405,6 @@ void MenuFunctions::main(uint32_t currentTime) (wifi_scan_obj.currentScanMode == BT_SCAN_AIRTAG_MON) || (wifi_scan_obj.currentScanMode == BT_SCAN_FLIPPER) || (wifi_scan_obj.currentScanMode == BT_SCAN_FLOCK) || - (wifi_scan_obj.currentScanMode == BT_SCAN_FLOCK_WARDRIVE) || (wifi_scan_obj.currentScanMode == BT_SCAN_SIMPLE) || (wifi_scan_obj.currentScanMode == BT_SCAN_SIMPLE_TWO) || (wifi_scan_obj.currentScanMode == BT_ATTACK_SOUR_APPLE) || @@ -2560,11 +2558,6 @@ void MenuFunctions::RunSetup() this->drawStatusBar(); wifi_scan_obj.StartScan(BT_SCAN_FLOCK, TFT_ORANGE); }); - this->addNodes(&bluetoothSnifferMenu, "Flock Wardrive", TFTCYAN, NULL, FLOCK, [this]() { - display_obj.clearScreen(); - this->drawStatusBar(); - wifi_scan_obj.StartScan(BT_SCAN_FLOCK_WARDRIVE, TFT_CYAN); - }); this->addNodes(&bluetoothSnifferMenu, "Meta Detect", TFTWHITE, NULL, BLUETOOTH_SNIFF, [this]() { display_obj.clearScreen(); this->drawStatusBar(); diff --git a/esp32_marauder/WiFiScan.cpp b/esp32_marauder/WiFiScan.cpp index 7085b50..5788643 100644 --- a/esp32_marauder/WiFiScan.cpp +++ b/esp32_marauder/WiFiScan.cpp @@ -756,189 +756,6 @@ extern "C" { // (struct FlockBattery { String mac; String name; String serial; int rssi; uint32_t last_seen; }; etc.) } } - else if (wifi_scan_obj.currentScanMode == BT_SCAN_FLOCK_WARDRIVE) { - bool do_save = false; - #ifdef HAS_GPS - if (gps_obj.getGpsModuleStatus()) { - - unsigned char mac_char[6]; - wifi_scan_obj.copyNimbleMac(advertisedDevice->getAddress(), mac_char); - - if (wifi_scan_obj.seen_mac(mac_char)) { - wifi_scan_obj.bt_cb_busy = false; - return; - } - - #ifndef HAS_NIMBLE_2 - uint8_t* payLoad = advertisedDevice->getPayload(); - size_t len = advertisedDevice->getPayloadLength(); - #else - const std::vector& payLoad = advertisedDevice->getPayload(); - size_t len = payLoad.size(); - #endif - - bool hasXuntongMfg = false; - size_t mfgIndex = 0; // index of 0xFF (AD type) - - // Look for Company ID XUNTONG (0x09C8), - for (size_t i = 1; i + 3 < len; i++) { - if (payLoad[i] == 0xFF && // AD type: Manufacturer Specific - payLoad[i + 1] == 0xC8 && - payLoad[i + 2] == 0x09) { - hasXuntongMfg = true; - mfgIndex = i; - break; - } - } - - String name = advertisedDevice->getName().c_str(); - - // Check for old penguin name - bool penguin = false; - - if (name.length() > 0) { - // Old firmware: "Penguin-XXXXXXXXXX" - if (name.startsWith("Penguin-") && name.length() == 18) { - bool allDigits = true; - for (int i = 8; i < name.length(); i++) { - char c = name.charAt(i); - if (c < '0' || c > '9') { - allDigits = false; - break; - } - } - if (allDigits) { - penguin = true; - } - } - - // Legacy name: "FS Ext Battery" - if (name == "FS Ext Battery") { - penguin = true; - } - - // New firmware: "NNNNNNNNNN" (10 digits) - if (name.length() == 10) { - bool allDigits = true; - for (int i = 0; i < name.length(); i++) { - char c = name.charAt(i); - if (c < '0' || c > '9') { - allDigits = false; - break; - } - } - if (allDigits) { - penguin = true; - } - } - } - - // Try to extract serial number from the XUNTONG manufacturer data - String serial = ""; - - if (hasXuntongMfg && mfgIndex > 0) { - uint8_t adLen = payLoad[mfgIndex - 1]; // length byte for this AD structure - size_t adStart = mfgIndex - 1; - size_t adEnd = adStart + adLen; // exclusive end index - - if (adEnd > len) { - adEnd = len; - } - - size_t vendorStart = mfgIndex + 3; - if (vendorStart < adEnd) { - bool started = false; - - for (size_t k = vendorStart; k < adEnd; k++) { - char c = (char)payLoad[k]; - - if (!started) { - if (c == 'T' && (k + 1) < adEnd && (char)payLoad[k + 1] == 'N') { - started = true; - serial += 'T'; - serial += 'N'; - k++; - } - } else { - // Once started, append digits (skip separators; stop on anything else) - if (c >= '0' && c <= '9') { - serial += c; - } else if (c == ' ' || c == '#' || c == '-') { - continue; - } else { - break; - } - } - } - } - } - - // Final decision on marking as Flock Penguin battery - if (hasXuntongMfg && (penguin || name.length() == 0)) { - String mac = advertisedDevice->getAddress().toString().c_str(); - mac.toUpperCase(); - int rssi = advertisedDevice->getRSSI(); - - // rssi - // mac - // name - // serial - - if (gps_obj.getFixStatus()) - do_save = true; - - #ifdef HAS_SCREEN - String display_string; - if (!do_save) - display_string = RED_KEY; - else - display_string = GREEN_KEY; - - display_string.concat(String(rssi)); - display_string.concat(" "); - if (serial.length()) { - display_string.concat(serial); - display_string.concat(" "); - } - - if (name.length() == 0) { - display_string.concat(" MAC:"); - display_string.concat(mac); - } - else { - display_string.concat(" "); - display_string.concat(name); - } - - uint8_t temp_len = display_string.length(); - for (uint8_t i = 0; i < 40 - temp_len; i++) { - display_string.concat(" "); - } - - if (!display_obj.printing) { - display_obj.loading = true; - display_obj.display_buffer->add(display_string); - display_obj.loading = false; - } - #endif - - String wardrive_line = (String)advertisedDevice->getAddress().toString().c_str() + ",,[BLE]," + gps_obj.getDatetime() + ",0," + (String)advertisedDevice->getRSSI() + "," + gps_obj.getLat() + "," + gps_obj.getLon() + "," + gps_obj.getAlt() + "," + gps_obj.getAccuracy() + ",BLE\n"; - Serial.print(wardrive_line); - - wifi_scan_obj.save_mac(mac_char); - - if (do_save) - buffer_obj.append(wardrive_line); - - wif_scan_obj.flock_devices++; - - // To-do: - // track in a list like AirTag / Flipper, if you want - // (struct FlockBattery { String mac; String name; String serial; int rssi; uint32_t last_seen; }; etc.) - } - } - #endif - } else if (wifi_scan_obj.currentScanMode == BT_SCAN_SIMPLE) { wifi_scan_obj.bt_frames++; } @@ -1457,98 +1274,6 @@ extern "C" { // (struct FlockBattery { String mac; String name; String serial; int rssi; uint32_t last_seen; }; etc.) } } - else if (wifi_scan_obj.currentScanMode == BT_SCAN_FLOCK_WARDRIVE) { - bool do_save = false; - #ifdef HAS_GPS - if (gps_obj.getGpsModuleStatus()) { - - unsigned char mac_char[6]; - wifi_scan_obj.copyNimbleMac(advertisedDevice->getAddress(), mac_char); - - if (wifi_scan_obj.seen_mac(mac_char)) { - wifi_scan_obj.bt_cb_busy = false; - return; - } - - #ifndef HAS_NIMBLE_2 - uint8_t* payLoad = advertisedDevice->getPayload(); - size_t len = advertisedDevice->getPayloadLength(); - #else - const std::vector& payloadVec = advertisedDevice->getPayload(); - const uint8_t* payLoad = payloadVec.data(); - size_t len = payloadVec.size(); - #endif - - String name = advertisedDevice->getName().c_str(); - - String serial; - - // Final decision on marking as Flock Penguin battery - if (wifi_scan_obj.isFlockCamera(payLoad, len, name, &serial)) { - String mac = advertisedDevice->getAddress().toString().c_str(); - mac.toUpperCase(); - int rssi = advertisedDevice->getRSSI(); - - // rssi - // mac - // name - // serial - - if (gps_obj.getFixStatus()) - do_save = true; - - #ifdef HAS_SCREEN - String display_string; - if (!do_save) - display_string = RED_KEY; - else - display_string = GREEN_KEY; - - display_string.concat(String(rssi)); - display_string.concat(" "); - if (serial.length()) { - display_string.concat(serial); - display_string.concat(" "); - } - - if (name.length() == 0) { - display_string.concat(" MAC:"); - display_string.concat(mac); - } - else { - display_string.concat(" "); - display_string.concat(name); - } - - uint8_t temp_len = display_string.length(); - for (uint8_t i = 0; i < 40 - temp_len; i++) { - display_string.concat(" "); - } - - if (!display_obj.printing) { - display_obj.loading = true; - display_obj.display_buffer->add(display_string); - display_obj.loading = false; - } - #endif - - String wardrive_line = (String)advertisedDevice->getAddress().toString().c_str() + ",,[BLE]," + gps_obj.getDatetime() + ",0," + (String)advertisedDevice->getRSSI() + "," + gps_obj.getLat() + "," + gps_obj.getLon() + "," + gps_obj.getAlt() + "," + gps_obj.getAccuracy() + ",BLE\n"; - Serial.print(wardrive_line); - - wifi_scan_obj.save_mac(mac_char); - - if (do_save) - buffer_obj.append(wardrive_line); - - wifi_scan_obj.flock_devices++; - - // To-do: - // track in a list like AirTag / Flipper, if you want - // (struct FlockBattery { String mac; String name; String serial; int rssi; uint32_t last_seen; }; etc.) - } - } - #endif - } else if (wifi_scan_obj.currentScanMode == BT_SCAN_SIMPLE) { wifi_scan_obj.bt_frames++; } @@ -2306,7 +2031,6 @@ void WiFiScan::StartScan(uint8_t scan_mode, uint16_t color) { (scan_mode == BT_SCAN_AIRTAG_MON) || (scan_mode == BT_SCAN_FLIPPER) || (scan_mode == BT_SCAN_FLOCK) || - (scan_mode == BT_SCAN_FLOCK_WARDRIVE) || (scan_mode == BT_SCAN_ANALYZER) || (scan_mode == BT_SCAN_SIMPLE) || (scan_mode == BT_SCAN_SIMPLE_TWO)) { @@ -2616,7 +2340,6 @@ void WiFiScan::StopScan(uint8_t scan_mode) { (currentScanMode == WIFI_SCAN_PACKET_RATE) || (currentScanMode == WIFI_CONNECTED) || (currentScanMode == BT_SCAN_FLOCK) || - (currentScanMode == BT_SCAN_FLOCK_WARDRIVE) || (currentScanMode == WIFI_SCAN_DETECT_FOLLOW) || (currentScanMode == LV_JOIN_WIFI) || (this->wifi_initialized)) @@ -2670,7 +2393,6 @@ void WiFiScan::StopScan(uint8_t scan_mode) { (currentScanMode == BT_SCAN_AIRTAG_MON) || (currentScanMode == BT_SCAN_FLIPPER) || (currentScanMode == BT_SCAN_FLOCK) || - (currentScanMode == BT_SCAN_FLOCK_WARDRIVE) || (currentScanMode == BT_ATTACK_SOUR_APPLE) || (currentScanMode == BT_ATTACK_APPLE_JUICE) || (currentScanMode == BT_ATTACK_SWIFTPAIR_SPAM) || @@ -4914,48 +4636,8 @@ void WiFiScan::executeWarDrive() { String ssid = WiFi.SSID(i); - if (this->currentScanMode == BT_SCAN_FLOCK_WARDRIVE) { - for (int x = 0; x < sizeof(flock_ssid)/sizeof(this->flock_ssid[0]); x++) { - if (strcasestr(ssid.c_str(), this->flock_ssid[x])) { - do_continue = false; - break; - } - } - if (do_continue) - continue; - } - ssid.replace(",","_"); - if (currentScanMode == BT_SCAN_FLOCK_WARDRIVE) { - if (ssid != "") { - display_string.concat(ssid); - } - else { - display_string.concat(this_bssid); - } - - if (gps_obj.getFixStatus()) { - do_save = true; - display_string.concat(" | Lt: " + gps_obj.getLat()); - display_string.concat(" | Ln: " + gps_obj.getLon()); - } - else { - display_string.concat(" | GPS: No Fix"); - } - - int temp_len = display_string.length(); - - #ifdef HAS_SCREEN - for (int i = 0; i < 40 - temp_len; i++) - { - display_string.concat(" "); - } - - display_obj.display_buffer->add(display_string); - #endif - } - String wardrive_line = WiFi.BSSIDstr(i) + "," + ssid + "," + this->security_int_to_string(WiFi.encryptionType(i)) + "," + gps_obj.getDatetime() + "," + (String)WiFi.channel(i) + "," + (String)WiFi.RSSI(i) + "," + gps_obj.getLat() + "," + gps_obj.getLon() + "," + gps_obj.getAlt() + "," + gps_obj.getAccuracy() + ",WIFI\n"; Serial.print((String)this->mac_history_cursor + " | " + wardrive_line); @@ -5437,7 +5119,6 @@ void WiFiScan::RunBluetoothScan(uint8_t scan_mode, uint16_t color) { #endif if ((scan_mode == BT_SCAN_FLOCK) || - (scan_mode == BT_SCAN_FLOCK_WARDRIVE) || (scan_mode == WIFI_SCAN_WAR_DRIVE) || (scan_mode == WIFI_SCAN_DETECT_FOLLOW) || (scan_mode == BT_SCAN_SIMPLE) || @@ -5459,20 +5140,9 @@ void WiFiScan::RunBluetoothScan(uint8_t scan_mode, uint16_t color) { (scan_mode == BT_SCAN_AIRTAG_MON) || (scan_mode == BT_SCAN_FLIPPER) || (scan_mode == BT_SCAN_FLOCK) || - (scan_mode == BT_SCAN_FLOCK_WARDRIVE) || (scan_mode == BT_SCAN_SIMPLE) || (scan_mode == BT_SCAN_SIMPLE_TWO)) { - #ifdef HAS_GPS - if (gps_obj.getGpsModuleStatus()) { - if (scan_mode == BT_SCAN_FLOCK_WARDRIVE) { - startLog("flock_wardrive"); - this->startWardriverWiFi(); - this->wifi_initialized = true; - } - buffer_obj.append(this->header_line); - } - #endif #ifdef HAS_SCREEN this->setupScanDisplayArea(TFT_BLACK, color); @@ -5488,8 +5158,6 @@ void WiFiScan::RunBluetoothScan(uint8_t scan_mode, uint16_t color) { display_obj.tft.drawCentreString("Flipper Sniff", TFT_WIDTH / 2, 16, 2); else if (scan_mode == BT_SCAN_FLOCK) display_obj.tft.drawCentreString("Flock Sniff", TFT_WIDTH / 2, 16, 2); - else if (scan_mode == BT_SCAN_FLOCK_WARDRIVE) - display_obj.tft.drawCentreString("Flock Wardrive", TFT_WIDTH / 2, 16, 2); else if (scan_mode == BT_SCAN_SIMPLE) display_obj.tft.drawCentreString("Simple Sniff", TFT_WIDTH / 2, 16, 2); else if (scan_mode == BT_SCAN_SIMPLE_TWO) @@ -5511,7 +5179,6 @@ void WiFiScan::RunBluetoothScan(uint8_t scan_mode, uint16_t color) { else if ((scan_mode == BT_SCAN_FLIPPER) || (scan_mode == BT_SCAN_RAYBAN) || (scan_mode == BT_SCAN_FLOCK) || - (scan_mode == BT_SCAN_FLOCK_WARDRIVE) || (scan_mode == BT_SCAN_SIMPLE) || (scan_mode == BT_SCAN_AIRTAG) || (scan_mode == BT_SCAN_AIRTAG_MON) || @@ -5582,8 +5249,7 @@ void WiFiScan::RunBluetoothScan(uint8_t scan_mode, uint16_t color) { (scan_mode == BT_SCAN_ANALYZER) || (scan_mode == BT_SCAN_FLOCK) || (scan_mode == BT_SCAN_SIMPLE) || - (scan_mode == BT_SCAN_SIMPLE_TWO) || - (scan_mode == BT_SCAN_FLOCK_WARDRIVE)) + (scan_mode == BT_SCAN_SIMPLE_TWO)) pBLEScan->setDuplicateFilter(false); if ((scan_mode != WIFI_SCAN_WAR_DRIVE) && (scan_mode != WIFI_SCAN_DETECT_FOLLOW)) { @@ -10055,7 +9721,6 @@ void WiFiScan::main(uint32_t currentTime) } } else if ((currentScanMode == BT_SCAN_FLOCK) || - (currentScanMode == BT_SCAN_FLOCK_WARDRIVE) || (currentScanMode == BT_SCAN_FLIPPER) || (currentScanMode == BT_SCAN_AIRTAG) || (currentScanMode == BT_SCAN_RAYBAN)) { @@ -10085,12 +9750,6 @@ void WiFiScan::main(uint32_t currentTime) #endif if (currentScanMode == BT_SCAN_FLOCK) channelHop(); - else if (currentScanMode == BT_SCAN_FLOCK_WARDRIVE) { - #ifdef HAS_GPS - if (gps_obj.getGpsModuleStatus()) - this->executeWarDrive(); - #endif - } } } else if (currentScanMode == WIFI_PING_SCAN) { From 706048e400c14b479c51932575bbb31cabd22747 Mon Sep 17 00:00:00 2001 From: Just Call Me Koko Date: Wed, 22 Apr 2026 22:18:42 -0400 Subject: [PATCH 3/3] Fix --- esp32_marauder/WiFiScan.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32_marauder/WiFiScan.cpp b/esp32_marauder/WiFiScan.cpp index 5788643..f03cfaf 100644 --- a/esp32_marauder/WiFiScan.cpp +++ b/esp32_marauder/WiFiScan.cpp @@ -749,7 +749,7 @@ extern "C" { } #endif - wif_scan_obj.flock_devices++; + wifi_scan_obj.flock_devices++; // To-do: // track in a list like AirTag / Flipper, if you want