diff --git a/esp32_marauder/MenuFunctions.cpp b/esp32_marauder/MenuFunctions.cpp index b1b4d42fd..6111ef21a 100644 --- a/esp32_marauder/MenuFunctions.cpp +++ b/esp32_marauder/MenuFunctions.cpp @@ -686,6 +686,8 @@ void MenuFunctions::main(uint32_t currentTime) (wifi_scan_obj.currentScanMode == WIFI_SCAN_EAPOL)) { if (wifi_scan_obj.set_channel < 14) wifi_scan_obj.changeChannel(wifi_scan_obj.set_channel + 1); + else + wifi_scan_obj.changeChannel(1); } } #endif @@ -719,6 +721,8 @@ void MenuFunctions::main(uint32_t currentTime) (wifi_scan_obj.currentScanMode == WIFI_SCAN_EAPOL)) { if (wifi_scan_obj.set_channel > 1) wifi_scan_obj.changeChannel(wifi_scan_obj.set_channel - 1); + else + wifi_scan_obj.changeChannel(14); } } if(c_btn_press){ diff --git a/esp32_marauder/WiFiScan.cpp b/esp32_marauder/WiFiScan.cpp index 7f763bdbc..3dc43c1f7 100644 --- a/esp32_marauder/WiFiScan.cpp +++ b/esp32_marauder/WiFiScan.cpp @@ -555,6 +555,8 @@ void WiFiScan::startWiFiAttacks(uint8_t scan_mode, uint16_t color, String title_ flipper_led.attackLED(); #elif defined(XIAO_ESP32_S3) xiao_led.attackLED(); + #elif defined(MARAUDER_M5STICKC) + stickc_led.attackLED(); #else led_obj.setMode(MODE_ATTACK); #endif @@ -578,6 +580,8 @@ bool WiFiScan::shutdownWiFi() { flipper_led.offLED(); #elif defined(XIAO_ESP32_S3) xiao_led.offLED(); + #elif defined(MARAUDER_M5STICKC) + stickc_led.offLED(); #else led_obj.setMode(MODE_OFF); #endif @@ -603,6 +607,8 @@ bool WiFiScan::shutdownBLE() { flipper_led.offLED(); #elif defined(XIAO_ESP32_S3) xiao_led.offLED(); + #elif defined(MARAUDER_M5STICKC) + stickc_led.offLED(); #else led_obj.setMode(MODE_OFF); #endif @@ -839,6 +845,8 @@ void WiFiScan::RunEvilPortal(uint8_t scan_mode, uint16_t color) flipper_led.sniffLED(); #elif defined(XIAO_ESP32_S3) xiao_led.sniffLED(); + #elif defined(MARAUDER_M5STICKC) + stickc_led.sniffLED(); #else led_obj.setMode(MODE_SNIFF); #endif @@ -886,6 +894,8 @@ void WiFiScan::RunAPScan(uint8_t scan_mode, uint16_t color) flipper_led.sniffLED(); #elif defined(XIAO_ESP32_S3) xiao_led.sniffLED(); + #elif defined(MARAUDER_M5STICKC) + stickc_led.sniffLED(); #else led_obj.setMode(MODE_SNIFF); #endif @@ -1169,6 +1179,8 @@ void WiFiScan::RunPacketMonitor(uint8_t scan_mode, uint16_t color) flipper_led.sniffLED(); #elif defined(XIAO_ESP32_S3) xiao_led.sniffLED(); + #elif defined(MARAUDER_M5STICKC) + stickc_led.sniffLED(); #else led_obj.setMode(MODE_SNIFF); #endif @@ -1252,6 +1264,8 @@ void WiFiScan::RunEapolScan(uint8_t scan_mode, uint16_t color) flipper_led.sniffLED(); #elif defined(XIAO_ESP32_S3) xiao_led.sniffLED(); + #elif defined(MARAUDER_M5STICKC) + stickc_led.sniffLED(); #else led_obj.setMode(MODE_SNIFF); #endif @@ -1267,7 +1281,7 @@ void WiFiScan::RunEapolScan(uint8_t scan_mode, uint16_t color) #ifdef WRITE_PACKETS_SERIAL buffer_obj.open(); - #else + #elif defined(HAS_SD) sd_obj.openCapture("eapol"); #endif @@ -1407,6 +1421,8 @@ void WiFiScan::RunPwnScan(uint8_t scan_mode, uint16_t color) flipper_led.sniffLED(); #elif defined(XIAO_ESP32_S3) xiao_led.sniffLED(); + #elif defined(MARAUDER_M5STICKC) + stickc_led.sniffLED(); #else led_obj.setMode(MODE_SNIFF); #endif @@ -1591,6 +1607,8 @@ void WiFiScan::RunBeaconScan(uint8_t scan_mode, uint16_t color) flipper_led.sniffLED(); #elif defined(XIAO_ESP32_S3) xiao_led.sniffLED(); + #elif defined(MARAUDER_M5STICKC) + stickc_led.sniffLED(); #else led_obj.setMode(MODE_SNIFF); #endif @@ -1654,6 +1672,8 @@ void WiFiScan::RunStationScan(uint8_t scan_mode, uint16_t color) flipper_led.sniffLED(); #elif defined(XIAO_ESP32_S3) xiao_led.sniffLED(); + #elif defined(MARAUDER_M5STICKC) + stickc_led.sniffLED(); #else led_obj.setMode(MODE_SNIFF); #endif @@ -1702,6 +1722,8 @@ void WiFiScan::RunRawScan(uint8_t scan_mode, uint16_t color) flipper_led.sniffLED(); #elif defined(XIAO_ESP32_S3) xiao_led.sniffLED(); + #elif defined(MARAUDER_M5STICKC) + stickc_led.sniffLED(); #else led_obj.setMode(MODE_SNIFF); #endif @@ -1752,6 +1774,8 @@ void WiFiScan::RunDeauthScan(uint8_t scan_mode, uint16_t color) flipper_led.sniffLED(); #elif defined(XIAO_ESP32_S3) xiao_led.sniffLED(); + #elif defined(MARAUDER_M5STICKC) + stickc_led.sniffLED(); #else led_obj.setMode(MODE_SNIFF); #endif @@ -1811,6 +1835,8 @@ void WiFiScan::RunProbeScan(uint8_t scan_mode, uint16_t color) flipper_led.sniffLED(); #elif defined(XIAO_ESP32_S3) xiao_led.sniffLED(); + #elif defined(MARAUDER_M5STICKC) + stickc_led.sniffLED(); #else led_obj.setMode(MODE_SNIFF); #endif @@ -1932,10 +1958,16 @@ void WiFiScan::RunBluetoothScan(uint8_t scan_mode, uint16_t color) #elif defined(HAS_SD) #ifdef HAS_GPS if (gps_obj.getGpsModuleStatus()) { - if (scan_mode == BT_SCAN_WAR_DRIVE) - sd_obj.openLog("bt_wardrive"); - else if (scan_mode == BT_SCAN_WAR_DRIVE_CONT) - sd_obj.openLog("bt_wardrive_cont"); + if (scan_mode == BT_SCAN_WAR_DRIVE) { + #ifdef HAS_SD + sd_obj.openLog("bt_wardrive"); + #endif + } + else if (scan_mode == BT_SCAN_WAR_DRIVE_CONT) { + #ifdef HAS_SD + sd_obj.openLog("bt_wardrive_cont"); + #endif + } String header_line = "WigleWifi-1.4,appRelease=" + (String)MARAUDER_VERSION + ",model=ESP32 Marauder,release=" + (String)MARAUDER_VERSION + ",device=ESP32 Marauder,display=SPI TFT,board=ESP32 Marauder,brand=JustCallMeKoko\nMAC,SSID,AuthMode,FirstSeen,Channel,RSSI,CurrentLatitude,CurrentLongitude,AltitudeMeters,AccuracyMeters,Type\n"; evil_portal_obj.addLog(header_line, header_line.length()); } @@ -3582,12 +3614,13 @@ void WiFiScan::wifiSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type) //Serial.print(" "); - #ifdef MARAUDER_MINI + #ifdef SCREEN_BUFFER if (display_obj.display_buffer->size() == 0) { display_obj.loading = true; display_obj.display_buffer->add(display_string); display_obj.loading = false; + Serial.println(display_string); } #endif #endif @@ -3667,7 +3700,7 @@ void WiFiScan::eapolSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type) Serial.print(" "); - #ifdef MARAUDER_MINI + #ifdef SCREEN_BUFFER if (display_obj.display_buffer->size() == 0) { display_obj.loading = true; @@ -3920,7 +3953,9 @@ void WiFiScan::addPacket(wifi_promiscuous_pkt_t *snifferPacket, int len) { //delay(50); } - sd_obj.main(); + #ifdef HAS_SD + sd_obj.main(); + #endif } @@ -4145,7 +4180,9 @@ void WiFiScan::addPacket(wifi_promiscuous_pkt_t *snifferPacket, int len) { //delay(50); } - sd_obj.main(); + #ifdef HAS_SD + sd_obj.main(); + #endif } diff --git a/esp32_marauder/WiFiScan.h b/esp32_marauder/WiFiScan.h index b84856be6..093ff070c 100644 --- a/esp32_marauder/WiFiScan.h +++ b/esp32_marauder/WiFiScan.h @@ -36,6 +36,8 @@ #include "flipperLED.h" #elif defined(XIAO_ESP32_S3) #include "xiaoLED.h" +#elif defined(MARAUDER_M5STICKC) + #include "stickcLED.h" #else #include "LedInterface.h" #endif @@ -108,6 +110,8 @@ extern Settings settings_obj; extern flipperLED flipper_led; #elif defined(XIAO_ESP32_S3) extern xiaoLED xiao_led; +#elif defined(MARAUDER_M5STICKC) + extern stickcLED stickc_led; #else extern LedInterface led_obj; #endif diff --git a/esp32_marauder/configs.h b/esp32_marauder/configs.h index e866e53b8..95720e376 100644 --- a/esp32_marauder/configs.h +++ b/esp32_marauder/configs.h @@ -22,7 +22,7 @@ //#define XIAO_ESP32_S3 //// END BOARD TARGETS - #define MARAUDER_VERSION "v0.13.3" + #define MARAUDER_VERSION "v0.13.4" //// BOARD FEATURES #ifdef MARAUDER_M5STICKC @@ -30,13 +30,13 @@ #define HAS_BATTERY #define HAS_BT #define HAS_BUTTONS - #define HAS_NEOPIXEL_LED + //#define HAS_NEOPIXEL_LED #define HAS_PWR_MGMT #define HAS_SCREEN #define HAS_SD #define USE_SD #define HAS_TEMP_SENSOR - //#define HAS_GPS + #define HAS_GPS #endif #ifdef MARAUDER_MINI @@ -238,8 +238,8 @@ #define TFT_CS 5 #define TFT_DC 23 #define TFT_RST 18 - #define TFT_BL 10 - #define TOUCH_CS 10 + #define TFT_BL -1 + #define TOUCH_CS -1 //#define SD_CS 1 #define SCREEN_BUFFER @@ -825,6 +825,11 @@ #define GPS_TX 9 #define GPS_RX 21 #define mac_history_len 512 + #elif defined(MARAUDER_M5STICKC) + #define GPS_SERIAL_INDEX 1 + #define GPS_TX 33 + #define GPS_RX 32 + #define mac_history_len 512 #endif #else #define mac_history_len 512 diff --git a/esp32_marauder/esp32_marauder.ino b/esp32_marauder/esp32_marauder.ino index d5e54a1eb..83a664162 100644 --- a/esp32_marauder/esp32_marauder.ino +++ b/esp32_marauder/esp32_marauder.ino @@ -39,6 +39,8 @@ https://www.online-utility.org/image/convert/to/XBM #include "flipperLED.h" #elif defined(XIAO_ESP32_S3) #include "xiaoLED.h" +#elif defined(MARAUDER_M5STICKC) + #include "stickcLED.h" #else #include "LedInterface.h" #endif @@ -121,6 +123,8 @@ CommandLine cli_obj; flipperLED flipper_led; #elif defined(XIAO_ESP32_S3) xiaoLED xiao_led; +#elif defined(MARAUDER_M5STICKC) + stickcLED stickc_led; #else LedInterface led_obj; #endif @@ -305,8 +309,6 @@ void setup() display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK); #endif } - #else - return; #endif #ifdef HAS_BATTERY @@ -341,6 +343,8 @@ void setup() flipper_led.RunSetup(); #elif defined(XIAO_ESP32_S3) xiao_led.RunSetup(); + #elif defined(MARAUDER_M5STICKC) + stickc_led.RunSetup(); #else led_obj.RunSetup(); #endif @@ -389,7 +393,7 @@ void loop() currentTime = millis(); bool mini = false; - #ifdef MARAUDER_MINI + #ifdef SCREEN_BUFFER mini = true; #endif @@ -437,6 +441,8 @@ void loop() flipper_led.main(); #elif defined(XIAO_ESP32_S3) xiao_led.main(); + #elif defined(MARAUDER_M5STICKC) + stickc_led.main(); #else led_obj.main(currentTime); #endif diff --git a/esp32_marauder/stickcLED.cpp b/esp32_marauder/stickcLED.cpp new file mode 100644 index 000000000..e561f2679 --- /dev/null +++ b/esp32_marauder/stickcLED.cpp @@ -0,0 +1,53 @@ +#include "stickcLED.h" +// NB M5Stick C Plus LED is active low, so digitalWrite() calls are inverted +void stickcLED::RunSetup() { + pinMode(STICKC_LED_PIN, OUTPUT); + +if (!settings_obj.loadSetting("EnableLED")) { + digitalWrite(STICKC_LED_PIN, HIGH); + return; +} + +delay(50); + + digitalWrite(STICKC_LED_PIN, LOW); + delay(500); + digitalWrite(STICKC_LED_PIN, HIGH); + delay(250); + digitalWrite(STICKC_LED_PIN, LOW); + delay(500); + digitalWrite(STICKC_LED_PIN, HIGH); + delay(250); + digitalWrite(STICKC_LED_PIN, LOW); + delay(500); + digitalWrite(STICKC_LED_PIN, HIGH); +} + +void stickcLED::attackLED() { + if (!settings_obj.loadSetting("EnableLED")) + return; + + digitalWrite(STICKC_LED_PIN, LOW); + delay(300); + digitalWrite(STICKC_LED_PIN, HIGH); +} + +void stickcLED::sniffLED() { + if (!settings_obj.loadSetting("EnableLED")) + return; + + digitalWrite(STICKC_LED_PIN, LOW); + delay(300); + digitalWrite(STICKC_LED_PIN, HIGH); +} + +void stickcLED::offLED() { + if (!settings_obj.loadSetting("EnableLED")) + return; + + digitalWrite(STICKC_LED_PIN, HIGH); +} + +void stickcLED::main() { + // do nothing +} diff --git a/esp32_marauder/stickcLED.h b/esp32_marauder/stickcLED.h new file mode 100644 index 000000000..63d9e975f --- /dev/null +++ b/esp32_marauder/stickcLED.h @@ -0,0 +1,23 @@ +#ifndef stickcLED_H +#define stickcLED_H + +#include "configs.h" +#include "settings.h" + +#include + +#define STICKC_LED_PIN 10 + +extern Settings settings_obj; + +class stickcLED { + + public: + void RunSetup(); + void main(); + void attackLED(); + void sniffLED(); + void offLED(); +}; + +#endif /* stickcLED_H */