mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2025-12-12 07:40:58 -08:00
add channel summary backend
This commit is contained in:
@@ -1021,6 +1021,7 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ACTIVE_LIST_EAPOL) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_PACKET_MONITOR) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_CHAN_ANALYZER) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_CHAN_ACT) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_PACKET_RATE) ||
|
||||
(wifi_scan_obj.currentScanMode == BT_SCAN_ANALYZER))
|
||||
{
|
||||
@@ -1062,6 +1063,7 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
(wifi_scan_obj.currentScanMode != WIFI_SCAN_PACKET_RATE) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_SCAN_RAW_CAPTURE) &&
|
||||
(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_ATTACK_FUNNY_BEACON) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_ATTACK_RICK_ROLL))
|
||||
@@ -2260,6 +2262,12 @@ void MenuFunctions::RunSetup()
|
||||
this->renderGraphUI(WIFI_SCAN_CHAN_ANALYZER);
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_CHAN_ANALYZER, TFT_CYAN);
|
||||
});
|
||||
this->addNodes(&wifiSnifferMenu, "Channel Summary", TFTORANGE, NULL, PACKET_MONITOR, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
this->renderGraphUI(WIFI_SCAN_CHAN_ACT);
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_CHAN_ACT, TFT_CYAN);
|
||||
});
|
||||
|
||||
this->addNodes(&wifiSnifferMenu, text_table1[58], TFTWHITE, NULL, PACKET_MONITOR, [this]() {
|
||||
display_obj.clearScreen();
|
||||
|
||||
@@ -1040,7 +1040,8 @@ void WiFiScan::StartScan(uint8_t scan_mode, uint16_t color)
|
||||
#endif
|
||||
}
|
||||
else if ((scan_mode == WIFI_SCAN_CHAN_ANALYZER) ||
|
||||
(scan_mode == WIFI_SCAN_PACKET_RATE)) {
|
||||
(scan_mode == WIFI_SCAN_PACKET_RATE) ||
|
||||
(scan_mode == WIFI_SCAN_CHAN_ACT)) {
|
||||
//#ifdef HAS_SCREEN
|
||||
RunPacketMonitor(scan_mode, color);
|
||||
//#endif
|
||||
@@ -1348,6 +1349,7 @@ void WiFiScan::StopScan(uint8_t scan_mode)
|
||||
(currentScanMode == WIFI_ATTACK_FUNNY_BEACON) ||
|
||||
(currentScanMode == WIFI_PACKET_MONITOR) ||
|
||||
(currentScanMode == WIFI_SCAN_CHAN_ANALYZER) ||
|
||||
(currentScanMode == WIFI_SCAN_CHAN_ACT) ||
|
||||
(currentScanMode == WIFI_SCAN_PACKET_RATE) ||
|
||||
(currentScanMode == WIFI_CONNECTED) ||
|
||||
(currentScanMode == LV_JOIN_WIFI) ||
|
||||
@@ -2825,7 +2827,8 @@ void WiFiScan::RunPacketMonitor(uint8_t scan_mode, uint16_t color)
|
||||
|
||||
#ifdef HAS_ILI9341
|
||||
if ((scan_mode != WIFI_SCAN_PACKET_RATE) &&
|
||||
(scan_mode != WIFI_SCAN_CHAN_ANALYZER)) {
|
||||
(scan_mode != WIFI_SCAN_CHAN_ANALYZER) &&
|
||||
(scan_mode != WIFI_SCAN_CHAN_ACT)) {
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.init();
|
||||
display_obj.tft.setRotation(1);
|
||||
@@ -2871,6 +2874,10 @@ void WiFiScan::RunPacketMonitor(uint8_t scan_mode, uint16_t color)
|
||||
display_obj.tft.setTextColor(TFT_BLACK, color);
|
||||
display_obj.tft.drawCentreString("Channel Analyzer", TFT_WIDTH / 2, 16, 2);
|
||||
}
|
||||
else if (scan_mode == WIFI_SCAN_CHAN_ACT) {
|
||||
display_obj.tft.setTextColor(TFT_BLACK, color);
|
||||
display_obj.tft.drawCentreString("Channel Summary", TFT_WIDTH / 2, 16, 2);
|
||||
}
|
||||
else if (scan_mode == WIFI_SCAN_PACKET_RATE) {
|
||||
display_obj.tft.drawCentreString("Packet Rate", TFT_WIDTH / 2, 16, 2);
|
||||
}
|
||||
@@ -2899,6 +2906,8 @@ void WiFiScan::RunPacketMonitor(uint8_t scan_mode, uint16_t color)
|
||||
display_obj.tft.drawCentreString(text_table1[45],TFT_WIDTH / 2,16,2);
|
||||
else if (scan_mode == WIFI_SCAN_CHAN_ANALYZER)
|
||||
display_obj.tft.drawCentreString("Channel Analyzer", TFT_WIDTH / 2, 16, 2);
|
||||
else if (scan_mode == WIFI_SCAN_CHAN_ACT)
|
||||
display_obj.tft.drawCentreString("Channel Summary", TFT_WIDTH / 2, 16, 2);
|
||||
else if (scan_mode == WIFI_SCAN_PACKET_RATE)
|
||||
display_obj.tft.drawCentreString("Packet Rate", TFT_WIDTH / 2, 16, 2);
|
||||
#endif
|
||||
@@ -7123,7 +7132,8 @@ void WiFiScan::wifiSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
|
||||
#endif
|
||||
|
||||
if ((wifi_scan_obj.currentScanMode != WIFI_SCAN_CHAN_ANALYZER) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_SCAN_PACKET_RATE)) {
|
||||
(wifi_scan_obj.currentScanMode != WIFI_SCAN_PACKET_RATE) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_SCAN_CHAN_ACT)) {
|
||||
|
||||
if (type == WIFI_PKT_MGMT)
|
||||
{
|
||||
@@ -7235,6 +7245,11 @@ void WiFiScan::wifiSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (wifi_scan_obj.currentScanMode == WIFI_SCAN_CHAN_ACT) {
|
||||
#ifndef HAS_DUAL_BAND
|
||||
wifi_scan_obj.channel_activity[wifi_scan_obj.set_channel - 1] = wifi_scan_obj.channel_activity[wifi_scan_obj.set_channel - 1] + 1;
|
||||
#endif
|
||||
}
|
||||
else if (wifi_scan_obj.currentScanMode == WIFI_SCAN_PACKET_RATE) {
|
||||
bool found = false;
|
||||
// Get the source addr
|
||||
@@ -7881,20 +7896,41 @@ void WiFiScan::changeChannel()
|
||||
}
|
||||
|
||||
// Function to cycle to the next channel
|
||||
void WiFiScan::channelHop(bool filtered)
|
||||
void WiFiScan::channelHop(bool filtered, bool ranged)
|
||||
{
|
||||
bool channel_match = false;
|
||||
bool ap_selected = true;
|
||||
|
||||
int top_chan = 0;
|
||||
int bot_chan = 0;
|
||||
|
||||
if (!filtered) {
|
||||
#ifndef HAS_DUAL_BAND
|
||||
if (ranged) {
|
||||
top_chan = activity_page * CHAN_PER_PAGE;
|
||||
bot_chan = (activity_page * CHAN_PER_PAGE) - CHAN_PER_PAGE + 1;
|
||||
}
|
||||
else {
|
||||
top_chan = MAX_CHANNEL;
|
||||
bot_chan = 1;
|
||||
}
|
||||
|
||||
this->set_channel = this->set_channel + 1;
|
||||
if (this->set_channel > 14) {
|
||||
this->set_channel = 1;
|
||||
if (this->set_channel > top_chan) {
|
||||
this->set_channel = bot_chan;
|
||||
}
|
||||
#else
|
||||
if (this->dual_band_channel_index >= DUAL_BAND_CHANNELS)
|
||||
this->dual_band_channel_index = 0;
|
||||
if (ranged) {
|
||||
top_chan = activity_page * CHAN_PER_PAGE - 1;
|
||||
bot_chan = (activity_page * CHAN_PER_PAGE) - CHAN_PER_PAGE;
|
||||
}
|
||||
else {
|
||||
top_chan = DUAL_BAND_CHANNELS;
|
||||
bot_chan = 0;
|
||||
}
|
||||
|
||||
if (this->dual_band_channel_index >= top_chan)
|
||||
this->dual_band_channel_index = bot_chan;
|
||||
else
|
||||
this->dual_band_channel_index++;
|
||||
this->set_channel = this->dual_band_channels[this->dual_band_channel_index];
|
||||
@@ -8024,6 +8060,68 @@ void WiFiScan::signalAnalyzerLoop(uint32_t tick) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void WiFiScan::channelActivityLoop(uint32_t tick) {
|
||||
#ifdef HAS_SCREEN
|
||||
/*if (tick - this->initTime >= BANNER_TIME) {
|
||||
this->initTime = millis();
|
||||
this->addAnalyzerValue(this->_analyzer_value * BASE_MULTIPLIER, -72, this->_analyzer_values, TFT_WIDTH);
|
||||
this->_analyzer_value = 0;
|
||||
if (this->analyzer_name_update) {
|
||||
this->displayAnalyzerString(this->analyzer_name_string);
|
||||
this->analyzer_name_update = false;
|
||||
}
|
||||
}*/
|
||||
|
||||
#ifdef HAS_ILI9341
|
||||
int8_t b = this->checkAnalyzerButtons(millis());
|
||||
|
||||
if (b == 6) {
|
||||
this->StartScan(WIFI_SCAN_OFF);
|
||||
this->orient_display = true;
|
||||
return;
|
||||
}
|
||||
else if (b == 4) {
|
||||
Serial.println("Down");
|
||||
#ifndef HAS_DUAL_BAND
|
||||
if (this->activity_page > 1) {
|
||||
this->activity_page--;
|
||||
display_obj.tftDrawChannelScaleButtons(set_channel, false);
|
||||
display_obj.tftDrawExitScaleButtons(false);
|
||||
return;
|
||||
}
|
||||
#else
|
||||
if (this->activity_page > 1) {
|
||||
this->activity_page--;
|
||||
display_obj.tftDrawChannelScaleButtons(this->set_channel, false);
|
||||
display_obj.tftDrawExitScaleButtons(false);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Channel + button pressed
|
||||
else if (b == 5) {
|
||||
Serial.println("Up");
|
||||
#ifndef HAS_DUAL_BAND
|
||||
if (this->activity_page < MAX_CHANNEL / CHAN_PER_PAGE) {
|
||||
this->activity_page++;
|
||||
display_obj.tftDrawChannelScaleButtons(set_channel, false);
|
||||
display_obj.tftDrawExitScaleButtons(false);
|
||||
return;
|
||||
}
|
||||
#else
|
||||
if (this->activity_page < DUAL_BAND_CHANNELS / CHAN_PER_PAGE) {
|
||||
this->activity_page++;
|
||||
display_obj.tftDrawChannelScaleButtons(this->set_channel, false);
|
||||
display_obj.tftDrawExitScaleButtons(false);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void WiFiScan::channelAnalyzerLoop(uint32_t tick) {
|
||||
#ifdef HAS_SCREEN
|
||||
if (tick - this->initTime >= BANNER_TIME) {
|
||||
@@ -8651,6 +8749,22 @@ void WiFiScan::main(uint32_t currentTime)
|
||||
(currentScanMode == BT_SCAN_ANALYZER)) {
|
||||
this->channelAnalyzerLoop(currentTime);
|
||||
}
|
||||
else if (currentScanMode == WIFI_SCAN_CHAN_ACT) {
|
||||
this->channelActivityLoop(currentTime);
|
||||
|
||||
if (currentTime - chanActTime >= 100) {
|
||||
chanActTime = millis();
|
||||
this->channelHop(false, true);
|
||||
}
|
||||
if (currentTime - initTime >= 1000) {
|
||||
initTime = millis();
|
||||
Serial.println("--------------");
|
||||
for (int i = (activity_page * CHAN_PER_PAGE) - CHAN_PER_PAGE; i < activity_page * CHAN_PER_PAGE; i++) {
|
||||
Serial.println((String)(i+1) + ": " + (String)channel_activity[i]);
|
||||
channel_activity[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((currentScanMode == WIFI_SCAN_PACKET_RATE) ||
|
||||
(currentScanMode == WIFI_SCAN_RAW_CAPTURE)) {
|
||||
this->packetRateLoop(currentTime);
|
||||
|
||||
@@ -137,6 +137,7 @@
|
||||
#define WIFI_SCAN_RDP 68
|
||||
#define WIFI_HOSTSPOT 69 // Nice
|
||||
#define BT_SCAN_AIRTAG_MON 70
|
||||
#define WIFI_SCAN_CHAN_ACT 71
|
||||
|
||||
#define WIFI_ATTACK_FUNNY_BEACON 99
|
||||
|
||||
@@ -239,6 +240,16 @@ class WiFiScan
|
||||
struct mac_addr mac_history[mac_history_len];
|
||||
#endif
|
||||
|
||||
#ifdef HAS_DUAL_BAND
|
||||
uint8_t channel_activity[DUAL_BAND_CHANNELS] = {};
|
||||
#else
|
||||
uint8_t channel_activity[MAX_CHANNEL] = {};
|
||||
#endif
|
||||
|
||||
uint8_t activity_page = 1;
|
||||
|
||||
uint32_t chanActTime = 0;
|
||||
|
||||
uint8_t ap_mac[6] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
|
||||
uint8_t sta_mac[6] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
|
||||
|
||||
@@ -545,6 +556,7 @@ class WiFiScan
|
||||
|
||||
void signalAnalyzerLoop(uint32_t tick);
|
||||
void channelAnalyzerLoop(uint32_t tick);
|
||||
void channelActivityLoop(uint32_t tick);
|
||||
void packetRateLoop(uint32_t tick);
|
||||
void packetMonitorMain(uint32_t currentTime);
|
||||
void eapolMonitorMain(uint32_t currentTime);
|
||||
@@ -748,7 +760,7 @@ class WiFiScan
|
||||
void RunSaveATList(bool save_as = true);
|
||||
void RunLoadATList();
|
||||
void RunSetupGPSTracker(uint8_t scan_mode);
|
||||
void channelHop(bool filtered = false);
|
||||
void channelHop(bool filtered = false, bool ranged = false);
|
||||
uint8_t currentScanMode = 0;
|
||||
void main(uint32_t currentTime);
|
||||
void StartScan(uint8_t scan_mode, uint16_t color = 0);
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
//#define MARAUDER_V8
|
||||
//// END BOARD TARGETS
|
||||
|
||||
#define MARAUDER_VERSION "v1.8.9"
|
||||
#define MARAUDER_VERSION "v1.8.10"
|
||||
|
||||
#define GRAPH_REFRESH 100
|
||||
|
||||
@@ -711,6 +711,8 @@
|
||||
#ifdef HAS_SCREEN
|
||||
|
||||
#ifdef MARAUDER_M5STICKC
|
||||
#define CHAN_PER_PAGE 7
|
||||
|
||||
#define SCREEN_CHAR_WIDTH 40
|
||||
//#define TFT_MISO 19
|
||||
#define TFT_MOSI 15
|
||||
@@ -785,6 +787,8 @@
|
||||
#endif
|
||||
|
||||
#if defined(MARAUDER_M5STICKCP2)
|
||||
#define CHAN_PER_PAGE 7
|
||||
|
||||
#define MARAUDER_M5STICKC // From now on, everything is the same, except for one check in esp32_marauder.ino amd stickc_led.cpp/h
|
||||
|
||||
#define SCREEN_CHAR_WIDTH 40
|
||||
@@ -859,6 +863,8 @@
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_CARDPUTER
|
||||
#define CHAN_PER_PAGE 7
|
||||
|
||||
#define SCREEN_CHAR_WIDTH 40
|
||||
//#define TFT_MISO -1
|
||||
#define TFT_MOSI 35
|
||||
@@ -932,6 +938,8 @@
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_V4
|
||||
#define CHAN_PER_PAGE 7
|
||||
|
||||
#define SCREEN_CHAR_WIDTH 40
|
||||
#define HAS_ILI9341
|
||||
#define BANNER_TEXT_SIZE 2
|
||||
@@ -996,6 +1004,8 @@
|
||||
#endif
|
||||
|
||||
#if defined(MARAUDER_V6) || defined(MARAUDER_V6_1)
|
||||
#define CHAN_PER_PAGE 7
|
||||
|
||||
#define SCREEN_CHAR_WIDTH 40
|
||||
#define HAS_ILI9341
|
||||
|
||||
@@ -1067,6 +1077,8 @@
|
||||
#endif
|
||||
|
||||
#if defined(MARAUDER_V8)
|
||||
#define CHAN_PER_PAGE 7
|
||||
|
||||
#define SCREEN_CHAR_WIDTH 40
|
||||
#define HAS_ILI9341
|
||||
|
||||
@@ -1139,6 +1151,8 @@
|
||||
#endif
|
||||
|
||||
#if defined(MARAUDER_CYD_MICRO)
|
||||
#define CHAN_PER_PAGE 7
|
||||
|
||||
#define SCREEN_CHAR_WIDTH 40
|
||||
#define HAS_ILI9341
|
||||
|
||||
@@ -1206,6 +1220,8 @@
|
||||
#endif
|
||||
|
||||
#if defined(MARAUDER_CYD_2USB)
|
||||
#define CHAN_PER_PAGE 7
|
||||
|
||||
#define SCREEN_CHAR_WIDTH 40
|
||||
#define HAS_ILI9341
|
||||
#define HAS_ST7789
|
||||
@@ -1274,6 +1290,8 @@
|
||||
#endif
|
||||
|
||||
#if defined(MARAUDER_CYD_3_5_INCH)
|
||||
#define CHAN_PER_PAGE 7
|
||||
|
||||
#define SCREEN_CHAR_WIDTH 40
|
||||
#define HAS_ILI9341
|
||||
#define HAS_ST7796
|
||||
@@ -1344,6 +1362,8 @@
|
||||
#endif
|
||||
|
||||
#if defined(MARAUDER_CYD_GUITION)
|
||||
#define CHAN_PER_PAGE 7
|
||||
|
||||
#define SCREEN_CHAR_WIDTH 40
|
||||
#define HAS_ILI9341
|
||||
|
||||
@@ -1413,6 +1433,8 @@
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_V7
|
||||
#define CHAN_PER_PAGE 7
|
||||
|
||||
#define SCREEN_CHAR_WIDTH 40
|
||||
//#define HAS_ILI9341
|
||||
|
||||
@@ -1482,6 +1504,8 @@
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_V7_1
|
||||
#define CHAN_PER_PAGE 7
|
||||
|
||||
#define SCREEN_CHAR_WIDTH 40
|
||||
//#define HAS_ILI9341
|
||||
|
||||
@@ -1551,6 +1575,8 @@
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_KIT
|
||||
#define CHAN_PER_PAGE 7
|
||||
|
||||
#define SCREEN_CHAR_WIDTH 40
|
||||
#define HAS_ILI9341
|
||||
|
||||
@@ -1617,6 +1643,8 @@
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_MINI
|
||||
#define CHAN_PER_PAGE 7
|
||||
|
||||
#define SCREEN_CHAR_WIDTH 40
|
||||
#define TFT_MISO 19
|
||||
#define TFT_MOSI 23
|
||||
@@ -1690,6 +1718,8 @@
|
||||
#endif
|
||||
|
||||
#ifdef MARAUDER_REV_FEATHER
|
||||
#define CHAN_PER_PAGE 7
|
||||
|
||||
#define SCREEN_CHAR_WIDTH 40
|
||||
//#define TFT_MISO 37
|
||||
//#define TFT_MOSI 35
|
||||
|
||||
Reference in New Issue
Block a user