diff --git a/esp32_marauder/Assets.h b/esp32_marauder/Assets.h index 5836387..c52dd11 100644 --- a/esp32_marauder/Assets.h +++ b/esp32_marauder/Assets.h @@ -206,7 +206,7 @@ PROGMEM static const unsigned char menu_icons[][66] = { 0xE7, 0xE7, 0x0B, 0xD0, 0xFD, 0xBF, 0xFF, 0xFF} }; -#ifndef MARAUDER_MINI +/*#ifndef MARAUDER_MINI static const uint8_t MarauderTitle[] PROGMEM = { 0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x01, 0x00, 0x60, 0x00, 0x60, 0x00, 0x00, 0xFF, 0xE1, 0x00, 0x22, 0x45, 0x78, 0x69, 0x66, 0x00, 0x00, 0x4D, 0x4D, @@ -1057,7 +1057,7 @@ PROGMEM static const unsigned char menu_icons[][66] = { 0x28, 0xA2, 0x80, 0x0A, 0x28, 0xA2, 0x80, 0x0A, 0x28, 0xA2, 0x80, 0x0A, 0x28, 0xA2, 0x80, 0x0A, 0x28, 0xA2, 0x80, 0x0A, 0x28, 0xA2, 0x80, 0x0A, 0x28, 0xA2, 0x80, 0x0A, 0x28, 0xA2, 0x80, 0x0A, 0x28, 0xA2, 0x80, 0x0A, 0x28, 0xA2, 0x80, 0x3F, 0xFF, 0xD9}; - /*static const uint8_t MarauderTitle[] PROGMEM = { + *//*static const uint8_t MarauderTitle[] PROGMEM = { 0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x01, 0x00, 0x60, 0x00, 0x60, 0x00, 0x00, 0xff, 0xe1, 0x00, 0x66, 0x45, 0x78, 0x69, 0x66, 0x00, 0x00, 0x4d, 0x4d, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x08, 0x00, 0x04, 0x01, 0x1a, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, @@ -1455,8 +1455,9 @@ PROGMEM static const unsigned char menu_icons[][66] = { 0xc4, 0x8b, 0x1c, 0x7b, 0xe4, 0x66, 0x6d, 0xaa, 0xbc, 0x05, 0xce, 0x00, 0xe0, 0x50, 0x07, 0x96, 0xd1, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x01, 0xff, 0xd9 };*/ -#endif +//#endif +/* #ifdef MARAUDER_MINI const uint8_t MarauderTitle[] PROGMEM = { 0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x01, 0x00, 0x60, @@ -1832,5 +1833,6 @@ PROGMEM static const unsigned char menu_icons[][66] = { 0x28, 0x00, 0xA2, 0x80, 0x0A, 0x28, 0x03, 0xFF, 0xD9}; #endif +*/ #endif diff --git a/esp32_marauder/Display.cpp b/esp32_marauder/Display.cpp index f150e5c..d23776a 100644 --- a/esp32_marauder/Display.cpp +++ b/esp32_marauder/Display.cpp @@ -422,6 +422,7 @@ void Display::scrollAddress(uint16_t vsp) { // JPEG_functions +/* void Display::drawJpeg(const char *filename, int xpos, int ypos) { // Open the named file (the Jpeg decoder library will close it after rendering image) @@ -452,6 +453,7 @@ void Display::drawJpeg(const char *filename, int xpos, int ypos) { // Serial.println(F("Jpeg file format not supported!")); //} } +*/ /*void Display::setupDraw() { this->tft.drawLine(0, 0, 10, 0, TFT_MAGENTA); diff --git a/esp32_marauder/Display.h b/esp32_marauder/Display.h index 9397651..4526c9c 100644 --- a/esp32_marauder/Display.h +++ b/esp32_marauder/Display.h @@ -110,7 +110,7 @@ class Display void buildBanner(String msg, int xpos); void clearScreen(); void displayBuffer(bool do_clear = false); - void drawJpeg(const char *filename, int xpos, int ypos); + //void drawJpeg(const char *filename, int xpos, int ypos); void getTouchWhileFunction(bool pressed); void initScrollValues(bool tte = false); void jpegInfo(); diff --git a/esp32_marauder/MenuFunctions.cpp b/esp32_marauder/MenuFunctions.cpp index ae49925..ba4b8b9 100644 --- a/esp32_marauder/MenuFunctions.cpp +++ b/esp32_marauder/MenuFunctions.cpp @@ -1222,6 +1222,7 @@ void MenuFunctions::displaySetting(String key, Menu* menu, int index) { void MenuFunctions::RunSetup() { extern LinkedList* access_points; + extern LinkedList* stations; this->disable_touch = false; @@ -1257,6 +1258,9 @@ void MenuFunctions::RunSetup() wifiAttackMenu.list = new LinkedList(); wifiGeneralMenu.list = new LinkedList(); wifiAPMenu.list = new LinkedList(); + #ifndef HAS_ILI9341 + wifiStationMenu.list = new LinkedList(); + #endif // WiFi HTML menu stuff htmlMenu.list = new LinkedList(); @@ -1312,6 +1316,9 @@ void MenuFunctions::RunSetup() clearSSIDsMenu.name = text_table1[28]; clearAPsMenu.name = text_table1[29]; wifiAPMenu.name = "Access Points"; + #ifndef HAS_ILI9341 + wifiStationMenu.name = "Select Stations"; + #endif #ifdef HAS_GPS gpsInfoMenu.name = "GPS Data"; #endif @@ -1533,12 +1540,14 @@ void MenuFunctions::RunSetup() wifi_scan_obj.StartScan(LV_ADD_SSID, TFT_RED); addAPGFX(); }); + // Select Stations on OG this->addNodes(&wifiGeneralMenu, text_table1[61], TFT_LIGHTGREY, NULL, KEYBOARD_ICO, [this](){ display_obj.clearScreen(); wifi_scan_obj.currentScanMode = LV_ADD_SSID; wifi_scan_obj.StartScan(LV_ADD_SSID, TFT_RED); addStationGFX(); }); + // Select Evil Portal Files on OG this->addNodes(&wifiGeneralMenu, "Select EP HTML File", TFT_CYAN, NULL, KEYBOARD_ICO, [this](){ display_obj.clearScreen(); wifi_scan_obj.currentScanMode = LV_ADD_SSID; @@ -1621,11 +1630,11 @@ void MenuFunctions::RunSetup() current_menu->list->set(i + 1, new_node); // Change selection status of button key - if (new_ap.selected) { - this->buttonSelected(i + 1); - } else { - this->buttonNotSelected(i + 1); - } + //if (new_ap.selected) { + // this->buttonSelected(i + 1); + //} else { + // this->buttonNotSelected(i + 1); + //} access_points->set(i, new_ap); }, access_points->get(i).selected); } @@ -1636,6 +1645,115 @@ void MenuFunctions::RunSetup() this->addNodes(&wifiAPMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() { this->changeMenu(wifiAPMenu.parentMenu); }); + + // Select Stations on Mini v1 + /* + this->addNodes(&wifiGeneralMenu, "Select Stations", TFT_CYAN, NULL, KEYBOARD_ICO, [this](){ + wifiStationMenu.list->clear(); + this->addNodes(&wifiStationMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() { + this->changeMenu(wifiStationMenu.parentMenu); + }); + int menu_limit; + + // Find out how many buttons we will need + if (stations->size() <= BUTTON_ARRAY_LEN) + menu_limit = stations->size(); + else + menu_limit = BUTTON_ARRAY_LEN; + + // Load buttons with stations + for (int i = 0; i < stations->size(); i++) { + + // Check if there is even space left + if (current_menu->list->size() >= menu_limit) + break; + + int cur_ap_sta = i; + + this->addNodes(&wifiStationMenu, wifi_scan_obj.macToString(stations->get(cur_ap_sta)), TFT_CYAN, NULL, KEYBOARD_ICO, [this, i, cur_ap_sta](){ + Station new_sta = stations->get(cur_ap_sta); + new_sta.selected = !stations->get(cur_ap_sta).selected; + + // Change selection status of menu node + MenuNode new_node = current_menu->list->get(i + 1); + new_node.selected = !current_menu->list->get(i + 1).selected; + current_menu->list->set(i + 1, new_node); + + // Change selection status of button key + //if (new_sta.selected) { + // this->buttonSelected(i + 1); + //} else { + // this->buttonNotSelected(i + 1); + //} + + stations->set(cur_ap_sta, new_sta); + }, stations->get(cur_ap_sta).selected); + } + this->changeMenu(&wifiStationMenu); + }); + */ + + // Select Stations on Mini v2 + this->addNodes(&wifiGeneralMenu, "Select Stations", TFT_CYAN, NULL, KEYBOARD_ICO, [this](){ + wifiAPMenu.list->clear(); + this->addNodes(&wifiAPMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() { + this->changeMenu(wifiAPMenu.parentMenu); + }); + + int menu_limit; + + if (access_points->size() <= BUTTON_ARRAY_LEN) + menu_limit = access_points->size(); + else + menu_limit = BUTTON_ARRAY_LEN; + + for (int i = 0; i < menu_limit - 1; i++) { + wifiStationMenu.list->clear(); + this->addNodes(&wifiAPMenu, access_points->get(i).essid, TFT_CYAN, NULL, KEYBOARD_ICO, [this, i](){ + + wifiStationMenu.list->clear(); + + // Add back button to the APs + this->addNodes(&wifiStationMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() { + this->changeMenu(wifiStationMenu.parentMenu); + }); + + // Add the AP's stations to the specific AP menu + for (int x = 0; x < access_points->get(i).stations->size(); x++) { + int cur_ap_sta = access_points->get(i).stations->get(x); + + this->addNodes(&wifiStationMenu, wifi_scan_obj.macToString(stations->get(cur_ap_sta)), TFT_CYAN, NULL, KEYBOARD_ICO, [this, i, cur_ap_sta, x](){ + Station new_sta = stations->get(cur_ap_sta); + new_sta.selected = !stations->get(cur_ap_sta).selected; + + // Change selection status of menu node + MenuNode new_node = current_menu->list->get(x + 1); + new_node.selected = !current_menu->list->get(x + 1).selected; + current_menu->list->set(x + 1, new_node); + + // Change selection status of button key + //if (new_sta.selected) { + // this->buttonSelected(i + 1); + //} else { + // this->buttonNotSelected(i + 1); + //} + + stations->set(cur_ap_sta, new_sta); + }, stations->get(cur_ap_sta).selected); + } + + // Final change menu to the menu of Stations + this->changeMenu(&wifiStationMenu); + + }, false); + } + this->changeMenu(&wifiAPMenu); + }); + + wifiStationMenu.parentMenu = &wifiAPMenu; + this->addNodes(&wifiStationMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() { + this->changeMenu(wifiStationMenu.parentMenu); + }); #endif // Build generate ssids menu diff --git a/esp32_marauder/MenuFunctions.h b/esp32_marauder/MenuFunctions.h index 0f225d9..a41a739 100644 --- a/esp32_marauder/MenuFunctions.h +++ b/esp32_marauder/MenuFunctions.h @@ -148,6 +148,9 @@ class MenuFunctions Menu wifiAttackMenu; Menu wifiGeneralMenu; Menu wifiAPMenu; + #ifndef HAS_ILI9341 + Menu wifiStationMenu; + #endif // WiFi General Menu Menu htmlMenu; diff --git a/esp32_marauder/WiFiScan.cpp b/esp32_marauder/WiFiScan.cpp index b19320e..148ccf7 100644 --- a/esp32_marauder/WiFiScan.cpp +++ b/esp32_marauder/WiFiScan.cpp @@ -305,6 +305,14 @@ WiFiScan::WiFiScan() { } +String WiFiScan::macToString(const Station& station) { + char macStr[18]; // 6 pairs of hex digits + 5 colons + null terminator + snprintf(macStr, sizeof(macStr), "%02X:%02X:%02X:%02X:%02X:%02X", + station.mac[0], station.mac[1], station.mac[2], + station.mac[3], station.mac[4], station.mac[5]); + return String(macStr); +} + void WiFiScan::RunSetup() { if (ieee80211_raw_frame_sanity_check(31337, 0, 0) == 1) this->wsl_bypass_enabled = true; diff --git a/esp32_marauder/WiFiScan.h b/esp32_marauder/WiFiScan.h index b614553..5b5ec60 100644 --- a/esp32_marauder/WiFiScan.h +++ b/esp32_marauder/WiFiScan.h @@ -400,6 +400,7 @@ class WiFiScan bool save_serial = false; void startPcap(String file_name); void startLog(String file_name); + String macToString(const Station& station); static void getMAC(char *addr, uint8_t* data, uint16_t offset); static void pwnSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type); diff --git a/esp32_marauder/configs.h b/esp32_marauder/configs.h index 9da578c..5fe5a4a 100644 --- a/esp32_marauder/configs.h +++ b/esp32_marauder/configs.h @@ -8,10 +8,10 @@ //// BOARD TARGETS //#define MARAUDER_M5STICKC - //#define MARAUDER_MINI + #define MARAUDER_MINI //#define MARAUDER_V4 //#define MARAUDER_V6 - #define MARAUDER_V6_1 + //#define MARAUDER_V6_1 //#define MARAUDER_KIT //#define GENERIC_ESP32 //#define MARAUDER_FLIPPER diff --git a/esp32_marauder/esp32_marauder.ino b/esp32_marauder/esp32_marauder.ino index a974e19..a310ac1 100644 --- a/esp32_marauder/esp32_marauder.ino +++ b/esp32_marauder/esp32_marauder.ino @@ -192,6 +192,7 @@ void setup() backlightOff(); // Draw the title screen + /* #ifdef HAS_SCREEN #ifndef MARAUDER_MINI display_obj.drawJpeg("/marauder3L.jpg", 0 , 0); // 240 x 320 image @@ -199,6 +200,7 @@ void setup() display_obj.drawJpeg("/marauder3L.jpg", 0, 0); #endif #endif + */ #ifdef HAS_SCREEN #ifndef MARAUDER_MINI @@ -210,6 +212,7 @@ void setup() #endif #endif + backlightOn(); // Need this #ifdef HAS_SCREEN