From c6ab4702b3a3d7ca8f6c3de23922f64932408598 Mon Sep 17 00:00:00 2001 From: Just Call Me Koko Date: Mon, 23 Feb 2026 21:30:29 -0500 Subject: [PATCH 1/2] toggle channel hop beacon sniff --- esp32_marauder/Display.cpp | 69 +++++++++++++++++++++++++++++--- esp32_marauder/Display.h | 3 +- esp32_marauder/MenuFunctions.cpp | 2 +- esp32_marauder/WiFiScan.cpp | 66 +++++++++++++----------------- esp32_marauder/configs.h | 10 ++--- 5 files changed, 99 insertions(+), 51 deletions(-) diff --git a/esp32_marauder/Display.cpp b/esp32_marauder/Display.cpp index e2e760c..d2634ad 100644 --- a/esp32_marauder/Display.cpp +++ b/esp32_marauder/Display.cpp @@ -382,6 +382,64 @@ void Display::tftDrawChannelScaleButtons(int set_channel, bool lnd_an) key[5].drawButton(); } +void Display::tftDrawChanHopButton(bool lnd_an, bool en) { + if (lnd_an) { + if (!en) { + key[7].initButton(&tft, // Exit box + 137, + 10, // x, y, w, h, outline, fill, text + EXT_BUTTON_WIDTH, + EXT_BUTTON_WIDTH, + TFT_ORANGE, // Outline + TFT_RED, // Fill + TFT_BLACK, // Text + "X", + 2); + } else { + key[7].initButton(&tft, // Exit box + 137, + 10, // x, y, w, h, outline, fill, text + EXT_BUTTON_WIDTH, + EXT_BUTTON_WIDTH, + TFT_WHITE, // Outline + TFT_GREEN, // Fill + TFT_BLACK, // Text + "O", + 2); + } + } + + else { + if (!en) { + key[7].initButton(&tft, // Exit box + (EXT_BUTTON_WIDTH / 2) * 14, + (STATUS_BAR_WIDTH * 2) + CHAR_WIDTH - 1, // x, y, w, h, outline, fill, text + EXT_BUTTON_WIDTH, + EXT_BUTTON_WIDTH, + TFT_ORANGE, // Outline + TFT_RED, // Fill + TFT_BLACK, // Text + "HOP", + 1); + } else { + key[7].initButton(&tft, // Exit box + (EXT_BUTTON_WIDTH / 2) * 14, + (STATUS_BAR_WIDTH * 2) + CHAR_WIDTH - 1, // x, y, w, h, outline, fill, text + EXT_BUTTON_WIDTH, + EXT_BUTTON_WIDTH, + TFT_WHITE, // Outline + TFT_GREEN, // Fill + TFT_BLACK, // Text + "HOP", + 1); + } + } + + key[7].setLabelDatum(1, 5, MC_DATUM); + + key[7].drawButton(); +} + void Display::tftDrawExitScaleButtons(bool lnd_an) { //tft.drawFastVLine(178, 0, 20, TFT_WHITE); @@ -403,7 +461,7 @@ void Display::tftDrawExitScaleButtons(bool lnd_an) else { key[6].initButton(&tft, // Exit box - EXT_BUTTON_WIDTH / 2, + EXT_BUTTON_WIDTH, (STATUS_BAR_WIDTH * 2) + CHAR_WIDTH - 1, // x, y, w, h, outline, fill, text EXT_BUTTON_WIDTH, EXT_BUTTON_WIDTH, @@ -539,10 +597,11 @@ void Display::displayBuffer(bool do_clear) screen_buffer->add(display_buffer->shift()); for (int i = 0; i < this->screen_buffer->size(); i++) { - //tft.setCursor(xPos, (i * 12) + (SCREEN_HEIGHT / 6)); - //String spaces = String(' ', TFT_WIDTH / CHAR_WIDTH); - //tft.print(spaces); - tft.setCursor(xPos, (i * 12) + (SCREEN_HEIGHT / 6)); + #ifdef HAS_TOUCH + tft.setCursor(xPos, (i * 12) + ((TFT_HEIGHT / 6) * 1.1)); + #else + tft.setCursor(xPos, (i * 12) + (TFT_HEIGHT / 6)); + #endif this->processAndPrintString(tft, this->screen_buffer->get(i)); } diff --git a/esp32_marauder/Display.h b/esp32_marauder/Display.h index 6c4fba7..7a0d473 100644 --- a/esp32_marauder/Display.h +++ b/esp32_marauder/Display.h @@ -74,7 +74,7 @@ class Display public: Display(); TFT_eSPI tft = TFT_eSPI(); - TFT_eSPI_Button key[BUTTON_ARRAY_LEN + 3]; + TFT_eSPI_Button key[BUTTON_ARRAY_LEN + 4]; const String PROGMEM version_number = MARAUDER_VERSION; #ifdef HAS_CYD_TOUCH @@ -127,6 +127,7 @@ class Display void tftDrawYScaleButtons(byte y_scale); void tftDrawChannelScaleButtons(int set_channel, bool lnd_an = true); void tftDrawExitScaleButtons(bool lnd_an = true); + void tftDrawChanHopButton(bool lnd_an = true, bool en = false); void buildBanner(String msg, int xpos); void clearScreen(); void displayBuffer(bool do_clear = false); diff --git a/esp32_marauder/MenuFunctions.cpp b/esp32_marauder/MenuFunctions.cpp index a157e9b..c14b140 100644 --- a/esp32_marauder/MenuFunctions.cpp +++ b/esp32_marauder/MenuFunctions.cpp @@ -207,7 +207,6 @@ void MenuFunctions::main(uint32_t currentTime) (wifi_scan_obj.currentScanMode == WIFI_SCAN_DETECT_FOLLOW) || (wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION_WAR_DRIVE) || (wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION) || - (wifi_scan_obj.currentScanMode == WIFI_SCAN_AP) || (wifi_scan_obj.currentScanMode == WIFI_SCAN_WAR_DRIVE) || (wifi_scan_obj.currentScanMode == WIFI_SCAN_EVIL_PORTAL) || (wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP) || @@ -414,6 +413,7 @@ void MenuFunctions::main(uint32_t currentTime) (wifi_scan_obj.currentScanMode != WIFI_SCAN_CHAN_ANALYZER) && (wifi_scan_obj.currentScanMode != WIFI_SCAN_CHAN_ACT) && (wifi_scan_obj.currentScanMode != WIFI_SCAN_SIG_STREN) && + (wifi_scan_obj.currentScanMode != WIFI_SCAN_AP) && (wifi_scan_obj.currentScanMode != WIFI_ATTACK_FUNNY_BEACON) && (wifi_scan_obj.currentScanMode != WIFI_SCAN_EAPOL) && (wifi_scan_obj.currentScanMode != WIFI_ATTACK_RICK_ROLL)) diff --git a/esp32_marauder/WiFiScan.cpp b/esp32_marauder/WiFiScan.cpp index 3154b5a..6d0795d 100644 --- a/esp32_marauder/WiFiScan.cpp +++ b/esp32_marauder/WiFiScan.cpp @@ -4996,11 +4996,19 @@ void WiFiScan::RunBeaconScan(uint8_t scan_mode, uint16_t color) display_obj.tft.drawCentreString("Wardrive", TFT_WIDTH / 2, 16, 2); } #ifdef HAS_ILI9341 - display_obj.touchToExit(); + if (scan_mode != WIFI_SCAN_AP) + display_obj.touchToExit(); #endif #endif display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK); - display_obj.setupScrollArea(display_obj.TOP_FIXED_AREA_2, BOT_FIXED_AREA); + if (scan_mode != WIFI_SCAN_AP) + display_obj.setupScrollArea(display_obj.TOP_FIXED_AREA_2, BOT_FIXED_AREA); + else { + display_obj.setupScrollArea((STATUS_BAR_WIDTH * 2) + CHAR_WIDTH - 1, BOT_FIXED_AREA); + display_obj.tftDrawChannelScaleButtons(set_channel, false); + display_obj.tftDrawExitScaleButtons(false); + display_obj.tftDrawChanHopButton(false, settings_obj.loadSetting("ChanHop")); + } #endif if (scan_mode != WIFI_SCAN_WAR_DRIVE) { @@ -10288,41 +10296,6 @@ bool WiFiScan::filterActive() { y_pos_x = 0; y_pos_y = 0; y_pos_z = 0; - /*boolean pressed = false; - - uint16_t t_x = 0, t_y = 0; // To store the touch coordinates - - // Do the touch stuff - #ifdef HAS_ILI9341 - pressed = display_obj.tft.getTouch(&t_x, &t_y); - #endif - - if (pressed) { - Serial.print("Got touch | X: "); - Serial.print(t_x); - Serial.print(" Y: "); - Serial.println(t_y); - } - - - // Check buttons for presses - for (uint8_t b = 0; b < BUTTON_ARRAY_LEN; b++) - { - if (pressed && display_obj.key[b].contains(t_x, t_y)) - { - display_obj.key[b].press(true); - } else { - display_obj.key[b].press(false); - } - }*/ - - // Which buttons pressed - //for (uint8_t b = 0; b < BUTTON_ARRAY_LEN; b++) - //{ - - // if (display_obj.key[b].justReleased()) - // { - // do_break = true; int8_t b = this->checkAnalyzerButtons(currentTime); @@ -10504,6 +10477,10 @@ void WiFiScan::channelHop(bool filtered, bool ranged) int top_chan = 0; int bot_chan = 0; + if ((!settings_obj.loadSetting("ChanHop")) && + (this->currentScanMode == WIFI_SCAN_AP)) + return; + if (!filtered) { #ifndef HAS_DUAL_BAND if (ranged) { @@ -10657,6 +10634,13 @@ void WiFiScan::signalAnalyzerLoop(uint32_t tick) { } #endif } + + else if (b == 7) { + settings_obj.toggleSetting("ChanHop"); + this->channel_hop = settings_obj.loadSetting("ChanHop"); + display_obj.tftDrawChanHopButton(false, this->channel_hop); + return; + } #endif #endif } @@ -11377,11 +11361,15 @@ void WiFiScan::main(uint32_t currentTime) (currentScanMode == WIFI_SCAN_STATION_WAR_DRIVE) || (currentScanMode == WIFI_SCAN_ALL)) { - if (currentTime - initTime >= this->channel_hop_delay * HOP_DELAY) - { + if (currentTime - initTime >= this->channel_hop_delay * HOP_DELAY) { initTime = millis(); channelHop(); } + if (currentScanMode == WIFI_SCAN_AP) { + #ifdef HAS_ILI9341 + this->signalAnalyzerLoop(currentTime); + #endif + } } else if (currentScanMode == WIFI_SCAN_SAE_COMMIT) { if (currentTime - initTime >= 250) { diff --git a/esp32_marauder/configs.h b/esp32_marauder/configs.h index ca468b5..e4ab7c9 100644 --- a/esp32_marauder/configs.h +++ b/esp32_marauder/configs.h @@ -1115,7 +1115,7 @@ #define SCREEN_BUFFER - #define MAX_SCREEN_BUFFER 22 + #define MAX_SCREEN_BUFFER 21 #define SCREEN_ORIENTATION 0 @@ -1189,7 +1189,7 @@ #define SCREEN_BUFFER - #define MAX_SCREEN_BUFFER 22 + #define MAX_SCREEN_BUFFER 21 #define SCREEN_ORIENTATION 0 @@ -1258,7 +1258,7 @@ #define SCREEN_BUFFER - #define MAX_SCREEN_BUFFER 22 + #define MAX_SCREEN_BUFFER 21 #define SCREEN_ORIENTATION 0 @@ -1328,7 +1328,7 @@ #define SCREEN_BUFFER - #define MAX_SCREEN_BUFFER 22 + #define MAX_SCREEN_BUFFER 21 #define SCREEN_ORIENTATION 0 @@ -1471,7 +1471,7 @@ #define SCREEN_BUFFER - #define MAX_SCREEN_BUFFER 22 + #define MAX_SCREEN_BUFFER 21 #define SCREEN_ORIENTATION 0 From 0c820ab2fc9b43dc335fe502267ae423c91cd559 Mon Sep 17 00:00:00 2001 From: Just Call Me Koko Date: Tue, 24 Feb 2026 00:51:33 -0500 Subject: [PATCH 2/2] More efficient sniffer buttons --- esp32_marauder/Display.cpp | 2 +- esp32_marauder/WiFiScan.cpp | 34 +++++++++++++++++++--------------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/esp32_marauder/Display.cpp b/esp32_marauder/Display.cpp index d2634ad..f44b708 100644 --- a/esp32_marauder/Display.cpp +++ b/esp32_marauder/Display.cpp @@ -564,7 +564,7 @@ void Display::displayBuffer(bool do_clear) if (this->display_buffer->size() > 0) { - int print_count = 10; + int print_count = 2; while ((display_buffer->size() > 0) && (print_count > 0)) { diff --git a/esp32_marauder/WiFiScan.cpp b/esp32_marauder/WiFiScan.cpp index 6d0795d..94854f2 100644 --- a/esp32_marauder/WiFiScan.cpp +++ b/esp32_marauder/WiFiScan.cpp @@ -10159,32 +10159,36 @@ bool WiFiScan::filterActive() { // Do the touch stuff #ifdef HAS_ILI9341 pressed = display_obj.updateTouch(&t_x, &t_y); - //pressed = display_obj.tft.getTouch(&t_x, &t_y); #endif - // Check buttons for presses - for (int8_t b = 0; b < BUTTON_ARRAY_LEN; b++) - { - if (pressed && display_obj.key[b].contains(t_x, t_y)) - { - display_obj.key[b].press(true); - } else { - display_obj.key[b].press(false); + if (pressed) { + while(display_obj.updateTouch(&t_x, &t_y)) { + + + // Check buttons for presses + for (int8_t b = 0; b < BUTTON_ARRAY_LEN; b++) + { + if (pressed && display_obj.key[b].contains(t_x, t_y)) + display_obj.key[b].press(true); + else + display_obj.key[b].press(false); + } } + } else { + for (int8_t b = 0; b < BUTTON_ARRAY_LEN; b++) + display_obj.key[b].press(false); } // Which buttons pressed for (int8_t b = 0; b < BUTTON_ARRAY_LEN; b++) - { - if (display_obj.key[b].justReleased()) return b; - } + if (display_obj.key[b].justReleased()) + return b; return -1; } #endif #ifdef HAS_SCREEN - void WiFiScan::eapolMonitorMain(uint32_t currentTime) - { + void WiFiScan::eapolMonitorMain(uint32_t currentTime) { for (x_pos = (11 + x_scale); x_pos <= 320; x_pos = x_pos) { currentTime = millis(); @@ -10602,7 +10606,7 @@ void WiFiScan::signalAnalyzerLoop(uint32_t tick) { return; } #else - if (this->dual_band_channel_index > 1) { + if (this->dual_band_channel_index > 0) { this->dual_band_channel_index--; this->set_channel = this->dual_band_channels[this->dual_band_channel_index]; display_obj.tftDrawChannelScaleButtons(this->set_channel, false);