Compare commits

..

53 Commits

Author SHA1 Message Date
Just Call Me Koko
1767f76362 Merge pull request #702 from justcallmekoko/develop
Adjust conditions for MAC set errors
2025-04-10 11:40:56 -04:00
Just Call Me Koko
908aae7965 Adjust conditions for MAC set errors 2025-04-10 11:35:58 -04:00
Just Call Me Koko
4127e4d3d0 Merge pull request #700 from justcallmekoko/develop
Make select -s all actually select all stations
2025-04-09 12:57:59 -04:00
Just Call Me Koko
cc4a069af3 Make select -s all actually select all 2025-04-09 12:52:10 -04:00
Just Call Me Koko
dae7e19abe Merge pull request #699 from justcallmekoko/develop
Fix evil portal AP name character limit
2025-04-09 12:48:05 -04:00
Just Call Me Koko
2a8006a59d Fix evil portal AP name character limit 2025-04-09 12:28:26 -04:00
Just Call Me Koko
f0d1c048f5 Merge pull request #691 from justcallmekoko/develop
Fix PSRAM crash issue with dual esp32 devices
2025-04-06 14:00:29 -04:00
Just Call Me Koko
94a7c6c587 Increment version number to v1.4.1 2025-04-06 13:52:52 -04:00
Just Call Me Koko
0a395944c6 Fix psram crash issue on dual ESP32 devices 2025-04-06 13:52:24 -04:00
Just Call Me Koko
00b27c8e87 Merge pull request #690 from justcallmekoko/develop
Increment version number to v1.4.0
2025-04-04 16:17:33 -04:00
Just Call Me Koko
065e931376 Increment version number to v1.4.0 2025-04-04 16:11:50 -04:00
Just Call Me Koko
9b7d1ab31f Merge pull request #689 from justcallmekoko/develop
Get signal strength working on ILI9341 again
2025-04-04 16:11:08 -04:00
Just Call Me Koko
593dd99d1a Fix non-display scanning 2025-04-04 16:06:28 -04:00
Just Call Me Koko
12794f57bc Get signal strength working on ILI9341 again
Allow channel scrolling on signal strength analyzer for ILI9341 devices
2025-04-04 15:49:14 -04:00
Just Call Me Koko
7c73689a13 Merge pull request #688 from justcallmekoko/develop
Add channel analyzer to ILI9341 devices
2025-04-04 12:02:14 -04:00
Just Call Me Koko
20e70e9343 Add channel analyzer to ILI9341 devices 2025-04-04 11:55:45 -04:00
Just Call Me Koko
25567aca81 Merge pull request #687 from justcallmekoko/develop
Add channel and exit buttons for ILI9341 to do raw capture
2025-04-04 11:39:09 -04:00
Just Call Me Koko
0ecc183b59 Remove button delay 2025-04-04 10:46:17 -04:00
Just Call Me Koko
df5e495f3a ILI9431 can do sniff raw now 2025-04-04 10:44:04 -04:00
Just Call Me Koko
aa5cb56b97 Merge pull request #686 from justcallmekoko/develop
Remove Scan AP and Scan Sta menu options from ILI9341 and replace with Scan All
2025-04-04 10:36:02 -04:00
Just Call Me Koko
cd5d537373 Actually remove scan ap from ILI9341 2025-04-04 10:29:26 -04:00
Just Call Me Koko
868c8a85de Merge pull request #685 from justcallmekoko/develop
Add clone STA MAC
2025-04-04 10:21:50 -04:00
Just Call Me Koko
d3299474c6 Remove scan ap and scan sta from ili9341 devices
To save menu space, remove these because we have scan all now
2025-04-04 10:17:12 -04:00
Just Call Me Koko
e662f917bc Start bringing features to ILI9341 2025-04-03 19:43:21 -04:00
Just Call Me Koko
4004e4e6d0 Add clone STA MAC 2025-04-03 14:47:37 -04:00
Just Call Me Koko
cdae54be5a Merge pull request #684 from justcallmekoko/develop
Add clone AP MAC
2025-04-03 14:19:03 -04:00
Just Call Me Koko
4dd856999f Add clone AP MAC 2025-04-03 14:13:57 -04:00
Just Call Me Koko
231d331ff7 Merge pull request #683 from justcallmekoko/develop
Add generate random MACs for AP and Station WiFi interface
2025-04-03 12:18:57 -04:00
Just Call Me Koko
1cc7b3f620 Fix printing for non screen models 2025-04-03 11:13:00 -04:00
Just Call Me Koko
caecd09d74 Create set macs menu and fix wifi init for macs 2025-04-03 10:57:01 -04:00
Just Call Me Koko
3c5b3bd544 Fix button icon color on scroll 2025-04-03 10:12:37 -04:00
Just Call Me Koko
4d145d5c0b Set MACs before every wifi function 2025-04-02 22:11:28 -04:00
Just Call Me Koko
020d0ace3c Get ready for setting new MACs 2025-04-02 16:35:28 -04:00
Just Call Me Koko
6229ad6d2a Add commands for info and ap/station scanning 2025-04-02 15:39:30 -04:00
Just Call Me Koko
649f619f87 Merge pull request #682 from justcallmekoko/develop
Fix EP HTML file menu
2025-04-02 11:00:29 -04:00
Just Call Me Koko
695aed1710 Fix EP HTML file menu 2025-04-02 10:27:25 -04:00
Just Call Me Koko
76dd3f020d Merge pull request #681 from justcallmekoko/develop
Make Raw Capture prioritize PCAP instead of display
2025-04-02 09:23:56 -04:00
Just Call Me Koko
60d8a9004b Fix display buffer keys for no display 2025-04-01 21:46:24 -04:00
Just Call Me Koko
84fc9738d4 Merge pull request #680 from justcallmekoko/develop
Add single scan for AP and Stations
2025-04-01 21:38:50 -04:00
Just Call Me Koko
ed65e6d2f7 Remove hardware def 2025-04-01 21:32:23 -04:00
Just Call Me Koko
fad44231cf Add wifi scan ap sta 2025-04-01 21:30:58 -04:00
Just Call Me Koko
974ed246dc Merge pull request #679 from justcallmekoko/develop
Add AP info and reduce button array size
2025-04-01 19:08:59 -04:00
Just Call Me Koko
960c66247d Fix AP info when no screen 2025-04-01 18:28:16 -04:00
Just Call Me Koko
39b53e22ba Start at menu top on back button 2025-04-01 18:26:08 -04:00
Just Call Me Koko
1bc2b36c9c Add AP info and reduce button array size 2025-04-01 18:13:02 -04:00
Just Call Me Koko
fe6ab68819 Merge pull request #678 from justcallmekoko/develop
Add packet count function and fix signal monitor
2025-03-29 23:32:35 -04:00
Just Call Me Koko
f4634638a9 Add packet count command 2025-03-29 20:23:38 -04:00
Just Call Me Koko
e3f32106d9 Create packet rate monitor 2025-03-29 14:13:53 -04:00
Just Call Me Koko
1e5b083d14 Add OUI check to station sniff 2025-03-28 17:55:54 -04:00
Just Call Me Koko
46dafaa2e4 Merge pull request #677 from justcallmekoko/develop
Add quick names to analyzer graphs
2025-03-27 14:25:26 -04:00
Just Call Me Koko
fab8088198 Clear board definitions 2025-03-27 13:57:48 -04:00
Just Call Me Koko
e16d421213 Add quick names to analyzer graph 2025-03-27 13:57:27 -04:00
Just Call Me Koko
3ba30ec5d9 Merge pull request #676 from justcallmekoko/master
Merge master into develop
2025-03-26 10:43:20 -04:00
15 changed files with 1526 additions and 518 deletions

View File

@@ -220,7 +220,9 @@ void CommandLine::runCommand(String input) {
// WiFi sniff/scan
Serial.println(HELP_EVIL_PORTAL_CMD);
Serial.println(HELP_PACKET_COUNT_CMD);
Serial.println(HELP_SIGSTREN_CMD);
Serial.println(HELP_SCAN_ALL_CMD);
Serial.println(HELP_SCANAP_CMD);
Serial.println(HELP_SCANSTA_CMD);
Serial.println(HELP_SNIFF_RAW_CMD);
@@ -239,6 +241,7 @@ void CommandLine::runCommand(String input) {
Serial.println(HELP_ATTACK_CMD);
// WiFi Aux
Serial.println(HELP_INFO_CMD);
Serial.println(HELP_LIST_AP_CMD_A);
Serial.println(HELP_LIST_AP_CMD_B);
Serial.println(HELP_LIST_AP_CMD_C);
@@ -520,6 +523,16 @@ void CommandLine::runCommand(String input) {
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(WIFI_SCAN_SIG_STREN, TFT_MAGENTA);
wifi_scan_obj.renderPacketRate();
}
// Packet count
else if (cmd_args.get(0) == PACKET_COUNT_CMD) {
Serial.println("Starting Packet Count Scan. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(WIFI_SCAN_PACKET_RATE, TFT_ORANGE);
}
// Wardrive
else if (cmd_args.get(0) == WARDRIVE_CMD) {
@@ -593,6 +606,10 @@ void CommandLine::runCommand(String input) {
}
}
}
else if (cmd_args.get(0) == SCAN_ALL_CMD) {
Serial.println("Scanning for APs and Stations. Stop with " + (String)STOPSCAN_CMD);
wifi_scan_obj.StartScan(WIFI_SCAN_AP_STA, TFT_MAGENTA);
}
else if (cmd_args.get(0) == SCANAP_CMD) {
int full_sw = -1;
#ifdef HAS_SCREEN
@@ -1189,6 +1206,21 @@ void CommandLine::runCommand(String input) {
return;
}
}
else if (cmd_args.get(0) == INFO_CMD) {
int ap_sw = this->argSearch(&cmd_args, "-a");
if (ap_sw != -1) {
int filter_ap = cmd_args.get(ap_sw + 1).toInt();
wifi_scan_obj.RunAPInfo(filter_ap, false);
}
else {
wifi_scan_obj.currentScanMode = SHOW_INFO;
#ifdef HAS_SCREEN
menu_function_obj.changeMenu(&menu_function_obj.infoMenu);
#endif
wifi_scan_obj.RunInfo();
}
}
// Select access points or stations
else if (cmd_args.get(0) == SEL_CMD) {
// Get switches
@@ -1313,26 +1345,43 @@ void CommandLine::runCommand(String input) {
// Get list of indices
LinkedList<String> ss_index = this->parseCommand(cmd_args.get(ss_sw + 1), ",");
// Mark APs as selected
for (int i = 0; i < ss_index.size(); i++) {
int index = ss_index.get(i).toInt();
if (!this->inRange(ssids->size(), index)) {
Serial.println("Index not in range: " + (String)index);
continue;
// Select ALL SSIDs
if (cmd_args.get(ss_sw + 1) == "all") {
for (int i = 0; i < ssids->size(); i++) {
if (ssids->get(i).selected) {
ssid new_ssid = ssids->get(i);
new_ssid.selected = false;
ssids->set(i, new_ssid);
count_unselected += 1;
}
else {
ssid new_ssid = ssids->get(i);
new_ssid.selected = true;
ssids->set(i, new_ssid);
count_selected += 1;
}
}
if (ssids->get(index).selected) {
// Unselect "selected" ap
ssid new_ssid = ssids->get(index);
new_ssid.selected = false;
ssids->set(index, new_ssid);
count_unselected += 1;
}
else {
// Select "unselected" ap
ssid new_ssid = ssids->get(index);
new_ssid.selected = true;
ssids->set(index, new_ssid);
count_selected += 1;
}
else {
// Mark SSIDs as selected
for (int i = 0; i < ss_index.size(); i++) {
int index = ss_index.get(i).toInt();
if (!this->inRange(ssids->size(), index)) {
Serial.println("Index not in range: " + (String)index);
continue;
}
if (ssids->get(index).selected) {
ssid new_ssid = ssids->get(index);
new_ssid.selected = false;
ssids->set(index, new_ssid);
count_unselected += 1;
}
else {
ssid new_ssid = ssids->get(index);
new_ssid.selected = true;
ssids->set(index, new_ssid);
count_selected += 1;
}
}
}
this->showCounts(count_selected, count_unselected);

View File

@@ -54,7 +54,9 @@ const char PROGMEM NMEA_CMD[] = "nmea";
// WiFi sniff/scan
const char PROGMEM EVIL_PORTAL_CMD[] = "evilportal";
const char PROGMEM PACKET_COUNT_CMD[] = "packetcount";
const char PROGMEM SIGSTREN_CMD[] = "sigmon";
const char PROGMEM SCAN_ALL_CMD[] = "scanall";
const char PROGMEM SCANAP_CMD[] = "scanap";
const char PROGMEM SCANSTA_CMD[] = "scansta";
const char PROGMEM SNIFF_RAW_CMD[] = "sniffraw";
@@ -76,6 +78,7 @@ const char PROGMEM ATTACK_TYPE_RR[] = "rickroll";
// WiFi Aux
const char PROGMEM LIST_AP_CMD[] = "list";
const char PROGMEM INFO_CMD[] = "info";
const char PROGMEM SEL_CMD[] = "select";
const char PROGMEM SSID_CMD[] = "ssid";
const char PROGMEM SAVE_CMD[] = "save";
@@ -109,7 +112,9 @@ const char PROGMEM HELP_NMEA_CMD[] = "nmea";
// WiFi sniff/scan
const char PROGMEM HELP_EVIL_PORTAL_CMD[] = "evilportal [-c start [-w html.html]/sethtml <html.html>]";
const char PROGMEM HELP_PACKET_COUNT_CMD[] = "packetcount";
const char PROGMEM HELP_SIGSTREN_CMD[] = "sigmon";
const char PROGMEM HELP_SCAN_ALL_CMD[] = "scanall";
const char PROGMEM HELP_SCANAP_CMD[] = "scanap";
const char PROGMEM HELP_SCANSTA_CMD[] = "scansta";
const char PROGMEM HELP_SNIFF_RAW_CMD[] = "sniffraw";
@@ -130,6 +135,7 @@ const char PROGMEM HELP_LIST_AP_CMD_A[] = "list -s";
const char PROGMEM HELP_LIST_AP_CMD_B[] = "list -a";
const char PROGMEM HELP_LIST_AP_CMD_C[] = "list -c";
const char PROGMEM HELP_LIST_AP_CMD_D[] = "list -t";
const char PROGMEM HELP_INFO_CMD[] = "info [-a <index>]";
const char PROGMEM HELP_SEL_CMD_A[] = "select -a/-s/-c <index (comma separated)>/-f \"equals <String> or contains <String>\"";
const char PROGMEM HELP_SSID_CMD_A[] = "ssid -a [-g <count>/-n <name>]";
const char PROGMEM HELP_SSID_CMD_B[] = "ssid -r <index>";

View File

@@ -189,31 +189,56 @@ void Display::tftDrawYScaleButtons(byte y_scale)
key[3].drawButton();
}
void Display::tftDrawChannelScaleButtons(int set_channel)
void Display::tftDrawChannelScaleButtons(int set_channel, bool lnd_an)
{
tft.drawFastVLine(178, 0, 20, TFT_WHITE);
tft.setCursor(145, 21); tft.setTextColor(TFT_WHITE); tft.setTextSize(1); tft.print(text10); tft.print(set_channel);
if (lnd_an) {
tft.drawFastVLine(178, 0, 20, TFT_WHITE);
tft.setCursor(145, 21); tft.setTextColor(TFT_WHITE); tft.setTextSize(1); tft.print(text10); tft.print(set_channel);
key[4].initButton(&tft, // channel - box
164,
10, // x, y, w, h, outline, fill, text
20,
20,
TFT_BLACK, // Outline
TFT_BLUE, // Fill
TFT_BLACK, // Text
"-",
2);
key[5].initButton(&tft, // channel + box
193,
10, // x, y, w, h, outline, fill, text
20,
20,
TFT_BLACK, // Outline
TFT_BLUE, // Fill
TFT_BLACK, // Text
"+",
2);
key[4].initButton(&tft, // channel - box
164,
10, // x, y, w, h, outline, fill, text
EXT_BUTTON_WIDTH,
EXT_BUTTON_WIDTH,
TFT_BLACK, // Outline
TFT_BLUE, // Fill
TFT_BLACK, // Text
"-",
2);
key[5].initButton(&tft, // channel + box
193,
10, // x, y, w, h, outline, fill, text
EXT_BUTTON_WIDTH,
EXT_BUTTON_WIDTH,
TFT_BLACK, // Outline
TFT_BLUE, // Fill
TFT_BLACK, // Text
"+",
2);
}
else {
key[4].initButton(&tft, // channel - box
(EXT_BUTTON_WIDTH / 2) * 6,
(STATUS_BAR_WIDTH * 2) + CHAR_WIDTH - 1, // x, y, w, h, outline, fill, text
EXT_BUTTON_WIDTH,
EXT_BUTTON_WIDTH,
TFT_BLACK, // Outline
TFT_BLUE, // Fill
TFT_BLACK, // Text
"-",
2);
key[5].initButton(&tft, // channel + box
(EXT_BUTTON_WIDTH / 2) * 10,
(STATUS_BAR_WIDTH * 2) + CHAR_WIDTH - 1, // x, y, w, h, outline, fill, text
EXT_BUTTON_WIDTH,
EXT_BUTTON_WIDTH,
TFT_BLACK, // Outline
TFT_BLUE, // Fill
TFT_BLACK, // Text
"+",
2);
}
key[4].setLabelDatum(1, 5, MC_DATUM);
key[5].setLabelDatum(1, 5, MC_DATUM);
@@ -222,21 +247,37 @@ void Display::tftDrawChannelScaleButtons(int set_channel)
key[5].drawButton();
}
void Display::tftDrawExitScaleButtons()
void Display::tftDrawExitScaleButtons(bool lnd_an)
{
//tft.drawFastVLine(178, 0, 20, TFT_WHITE);
//tft.setCursor(145, 21); tft.setTextColor(TFT_WHITE); tft.setTextSize(1); tft.print("Channel:"); tft.print(set_channel);
key[6].initButton(&tft, // Exit box
137,
10, // x, y, w, h, outline, fill, text
20,
20,
TFT_ORANGE, // Outline
TFT_RED, // Fill
TFT_BLACK, // Text
"X",
2);
if (lnd_an) {
key[6].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[6].initButton(&tft, // Exit box
EXT_BUTTON_WIDTH / 2,
(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
"X",
2);
}
key[6].setLabelDatum(1, 5, MC_DATUM);
@@ -270,8 +311,13 @@ void Display::touchToExit()
void Display::clearScreen()
{
//Serial.println(F("clearScreen()"));
tft.fillScreen(TFT_BLACK);
tft.setCursor(0, 0);
#ifndef MARAUDER_V7
tft.fillScreen(TFT_BLACK);
tft.setCursor(0, 0);
#else
tft.fillRect(0, 0, TFT_WIDTH, TFT_HEIGHT, TFT_BLACK);
tft.setCursor(0, 0);
#endif
}
#ifdef SCREEN_BUFFER
@@ -340,7 +386,7 @@ void Display::displayBuffer(bool do_clear)
blank[(18+(yStart - TOP_FIXED_AREA_2) / TEXT_HEIGHT)%19] = xPos;
#else
xPos = 0;
if (this->screen_buffer->size() >= MAX_SCREEN_BUFFER)
if (this->screen_buffer->size() >= MAX_SCREEN_BUFFER)
this->scrollScreenBuffer();
screen_buffer->add(display_buffer->shift());
@@ -348,14 +394,10 @@ void Display::displayBuffer(bool do_clear)
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);
//for (int x = 0; x < TFT_WIDTH / CHAR_WIDTH; x++)
// tft.print(" ");
tft.print(spaces);
tft.setCursor(xPos, (i * 12) + (SCREEN_HEIGHT / 6));
this->processAndPrintString(tft, this->screen_buffer->get(i));
//tft.setTextColor(TFT_GREEN, TFT_BLACK);
//tft.print(this->screen_buffer->get(i));
}
#endif

View File

@@ -112,8 +112,8 @@ class Display
void tftDrawColorKey();
void tftDrawXScaleButtons(byte x_scale);
void tftDrawYScaleButtons(byte y_scale);
void tftDrawChannelScaleButtons(int set_channel);
void tftDrawExitScaleButtons();
void tftDrawChannelScaleButtons(int set_channel, bool lnd_an = true);
void tftDrawExitScaleButtons(bool lnd_an = true);
void buildBanner(String msg, int xpos);
void clearScreen();
void displayBuffer(bool do_clear = false);

View File

@@ -14,8 +14,6 @@ void EvilPortal::setup() {
html_files = new LinkedList<String>();
html_files->add("Back");
#ifdef HAS_SD
if (sd_obj.supported) {
sd_obj.listDirToLinkedList(html_files, "/", "html");

View File

@@ -33,7 +33,7 @@ extern Buffer buffer_obj;
#define RESET_CMD "reset"
#define START_CMD "start"
#define ACK_CMD "ack"
#define MAX_AP_NAME_SIZE 30
#define MAX_AP_NAME_SIZE 32
#define WIFI_SCAN_EVIL_PORTAL 30
char apName[MAX_AP_NAME_SIZE] = "PORTAL";
@@ -52,8 +52,9 @@ struct AccessPoint {
uint8_t bssid[6];
bool selected;
LinkedList<char>* beacon;
char rssi;
int8_t rssi;
LinkedList<uint16_t>* stations;
uint16_t packets;
};
class CaptiveRequestHandler : public AsyncWebHandler {

View File

@@ -321,14 +321,17 @@ MenuFunctions::MenuFunctions()
list_btn = lv_list_add_btn(list1, LV_SYMBOL_CLOSE, text09);
lv_obj_set_event_cb(list_btn, ap_list_cb);
if (type == "AP") {
if ((type == "AP") || (type == "AP Info")) {
for (int i = 0; i < access_points->size(); i++) {
char buf[access_points->get(i).essid.length() + 1] = {};
access_points->get(i).essid.toCharArray(buf, access_points->get(i).essid.length() + 1);
list_btn = lv_list_add_btn(list1, LV_SYMBOL_WIFI, buf);
lv_btn_set_checkable(list_btn, true);
lv_obj_set_event_cb(list_btn, ap_list_cb);
if (type == "AP")
lv_obj_set_event_cb(list_btn, ap_list_cb);
else if (type == "AP Info")
lv_obj_set_event_cb(list_btn, ap_info_list_cb);
if (access_points->get(i).selected)
lv_btn_toggle(list_btn);
@@ -473,6 +476,43 @@ MenuFunctions::MenuFunctions()
}
}
}
void ap_info_list_cb(lv_obj_t * btn, lv_event_t event) {
extern LinkedList<AccessPoint>* access_points;
extern MenuFunctions menu_function_obj;
extern WiFiScan wifi_scan_obj;
String btn_text = lv_list_get_btn_text(btn);
String display_string = "";
// Exit function
if (event == LV_EVENT_CLICKED) {
if (btn_text != text09) {
for (int i = 0; i < access_points->size(); i++) {
if (access_points->get(i).essid == btn_text) {
lv_obj_del_async(lv_obj_get_parent(lv_obj_get_parent(btn)));
printf("LV_EVENT_CANCEL\n");
menu_function_obj.deinitLVGL();
wifi_scan_obj.StartScan(WIFI_SCAN_OFF);
//display_obj.exit_draw = true; // set everything back to normal
menu_function_obj.orientDisplay();
menu_function_obj.changeMenu(&menu_function_obj.apInfoMenu);
wifi_scan_obj.RunAPInfo(i);
}
}
}
else {
Serial.println("Exiting...");
lv_obj_del_async(lv_obj_get_parent(lv_obj_get_parent(btn)));
printf("LV_EVENT_CANCEL\n");
menu_function_obj.deinitLVGL();
wifi_scan_obj.StartScan(WIFI_SCAN_OFF);
display_obj.exit_draw = true; // set everything back to normal
}
}
}
void MenuFunctions::addSSIDGFX(){
extern LinkedList<ssid>* ssids;
@@ -665,19 +705,6 @@ void MenuFunctions::main(uint32_t currentTime)
}
}
// Do channel analyzer stuff
/*if (wifi_scan_obj.currentScanMode == WIFI_SCAN_CHAN_ANALYZER) {
if (currentTime - this->initTime >= GRAPH_REFRESH) {
Serial.println("Refreshing graph: " + (String)currentTime);
this->initTime = millis();
this->setGraphScale(this->graphScaleCheck(wifi_scan_obj._analyzer_values));
this->drawGraph(wifi_scan_obj._analyzer_values);
}
}*/
boolean pressed = false;
// This is code from bodmer's keypad example
@@ -719,14 +746,13 @@ void MenuFunctions::main(uint32_t currentTime)
// Stop the current scan
if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_PROBE) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION_WAR_DRIVE) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_RAW_CAPTURE) ||
(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_SIG_STREN) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP_FULL) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_AP_STA) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_PWN) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ESPRESSIF) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ALL) ||
@@ -796,6 +822,7 @@ void MenuFunctions::main(uint32_t currentTime)
(wifi_scan_obj.currentScanMode == WIFI_SCAN_SIG_STREN) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP_FULL) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_AP_STA) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_PWN) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ESPRESSIF) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ALL) ||
@@ -827,6 +854,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_PACKET_RATE) ||
(wifi_scan_obj.currentScanMode == BT_SCAN_ANALYZER))
{
wifi_scan_obj.StartScan(WIFI_SCAN_OFF);
@@ -850,6 +878,8 @@ void MenuFunctions::main(uint32_t currentTime)
// Check if any key coordinate boxes contain the touch coordinates
// This is for when on a menu
// Make sure to add certain scanning functions here or else
// menu items will be selected while scans and attacks are running
#ifdef HAS_ILI9341
if ((wifi_scan_obj.currentScanMode != WIFI_ATTACK_BEACON_SPAM) &&
(wifi_scan_obj.currentScanMode != WIFI_ATTACK_AP_SPAM) &&
@@ -858,6 +888,10 @@ void MenuFunctions::main(uint32_t currentTime)
(wifi_scan_obj.currentScanMode != WIFI_ATTACK_DEAUTH_MANUAL) &&
(wifi_scan_obj.currentScanMode != WIFI_ATTACK_DEAUTH_TARGETED) &&
(wifi_scan_obj.currentScanMode != WIFI_ATTACK_MIMIC) &&
(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_SIG_STREN) &&
(wifi_scan_obj.currentScanMode != WIFI_ATTACK_RICK_ROLL))
{
// Need this to set all keys to false
@@ -880,7 +914,7 @@ void MenuFunctions::main(uint32_t currentTime)
menu_icons[current_menu->list->get(b).icon],
ICON_W,
ICON_H,
current_menu->list->get(b).color,
this->getColor(current_menu->list->get(b).color),
TFT_BLACK);
}
@@ -900,7 +934,7 @@ void MenuFunctions::main(uint32_t currentTime)
ICON_W,
ICON_H,
TFT_BLACK,
current_menu->list->get(b).color);
this->getColor(current_menu->list->get(b).color));
}
display_obj.tft.setFreeFont(NULL);
@@ -942,7 +976,10 @@ void MenuFunctions::main(uint32_t currentTime)
}
else if ((wifi_scan_obj.currentScanMode == WIFI_PACKET_MONITOR) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EAPOL) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_CHAN_ANALYZER)) {
(wifi_scan_obj.currentScanMode == WIFI_SCAN_CHAN_ANALYZER) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_PACKET_RATE) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_RAW_CAPTURE) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_SIG_STREN)) {
if (wifi_scan_obj.set_channel < 14)
wifi_scan_obj.changeChannel(wifi_scan_obj.set_channel + 1);
else
@@ -987,7 +1024,10 @@ void MenuFunctions::main(uint32_t currentTime)
}
else if ((wifi_scan_obj.currentScanMode == WIFI_PACKET_MONITOR) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EAPOL) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_CHAN_ANALYZER)) {
(wifi_scan_obj.currentScanMode == WIFI_SCAN_CHAN_ANALYZER) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_PACKET_RATE) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_RAW_CAPTURE) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_SIG_STREN)) {
if (wifi_scan_obj.set_channel > 1)
wifi_scan_obj.changeChannel(wifi_scan_obj.set_channel - 1);
else
@@ -1446,6 +1486,9 @@ void MenuFunctions::RunSetup()
#endif
wifiGeneralMenu.list = new LinkedList<MenuNode>();
wifiAPMenu.list = new LinkedList<MenuNode>();
apInfoMenu.list = new LinkedList<MenuNode>();
setMacMenu.list = new LinkedList<MenuNode>();
genAPMacMenu.list = new LinkedList<MenuNode>();
#ifdef HAS_BT
airtagMenu.list = new LinkedList<MenuNode>();
#endif
@@ -1512,6 +1555,9 @@ void MenuFunctions::RunSetup()
clearSSIDsMenu.name = text_table1[28];
clearAPsMenu.name = text_table1[29];
wifiAPMenu.name = "Access Points";
apInfoMenu.name = "AP Info";
setMacMenu.name = "Set MACs";
genAPMacMenu.name = "Generate AP MAC";
#ifdef HAS_BT
airtagMenu.name = "Select Airtag";
#endif
@@ -1585,6 +1631,12 @@ void MenuFunctions::RunSetup()
this->drawStatusBar();
wifi_scan_obj.StartScan(WIFI_SCAN_DEAUTH, TFT_RED);
});
this->addNodes(&wifiSnifferMenu, "Packet Count", TFTORANGE, NULL, PACKET_MONITOR, [this]() {
display_obj.clearScreen();
this->drawStatusBar();
wifi_scan_obj.StartScan(WIFI_SCAN_PACKET_RATE, TFT_ORANGE);
wifi_scan_obj.renderPacketRate();
});
#ifdef HAS_ILI9341
this->addNodes(&wifiSnifferMenu, text_table1[46], TFTVIOLET, NULL, EAPOL, [this]() {
wifi_scan_obj.StartScan(WIFI_SCAN_EAPOL, TFT_VIOLET);
@@ -1592,7 +1644,7 @@ void MenuFunctions::RunSetup()
this->addNodes(&wifiSnifferMenu, text_table1[45], TFTBLUE, NULL, PACKET_MONITOR, [this]() {
wifi_scan_obj.StartScan(WIFI_PACKET_MONITOR, TFT_BLUE);
});
#else
#else // No touch
this->addNodes(&wifiSnifferMenu, text_table1[46], TFTVIOLET, NULL, EAPOL, [this]() {
display_obj.clearScreen();
this->drawStatusBar();
@@ -1603,42 +1655,57 @@ void MenuFunctions::RunSetup()
this->drawStatusBar();
wifi_scan_obj.StartScan(WIFI_PACKET_MONITOR, TFT_BLUE);
});
this->addNodes(&wifiSnifferMenu, "Channel Analyzer", TFTCYAN, NULL, PACKET_MONITOR, [this]() {
/*this->addNodes(&wifiSnifferMenu, "Packet Count", TFTORANGE, NULL, PACKET_MONITOR, [this]() {
display_obj.clearScreen();
this->drawStatusBar();
this->renderGraphUI(WIFI_SCAN_CHAN_ANALYZER);
wifi_scan_obj.StartScan(WIFI_SCAN_CHAN_ANALYZER, TFT_CYAN);
});
wifi_scan_obj.StartScan(WIFI_SCAN_PACKET_RATE, TFT_ORANGE);
wifi_scan_obj.renderPacketRate();
});*/
#endif
//#ifndef HAS_ILI9341
this->addNodes(&wifiSnifferMenu, text_table1[47], TFTRED, NULL, PWNAGOTCHI, [this]() {
this->addNodes(&wifiSnifferMenu, "Channel Analyzer", TFTCYAN, NULL, PACKET_MONITOR, [this]() {
display_obj.clearScreen();
this->drawStatusBar();
wifi_scan_obj.StartScan(WIFI_SCAN_PWN, TFT_RED);
});
//#endif
this->addNodes(&wifiSnifferMenu, text_table1[49], TFTMAGENTA, NULL, BEACON_SNIFF, [this]() {
display_obj.clearScreen();
this->drawStatusBar();
wifi_scan_obj.StartScan(WIFI_SCAN_TARGET_AP, TFT_MAGENTA);
this->renderGraphUI(WIFI_SCAN_CHAN_ANALYZER);
wifi_scan_obj.StartScan(WIFI_SCAN_CHAN_ANALYZER, TFT_CYAN);
});
this->addNodes(&wifiSnifferMenu, text_table1[58], TFTWHITE, NULL, PACKET_MONITOR, [this]() {
display_obj.clearScreen();
this->drawStatusBar();
wifi_scan_obj.StartScan(WIFI_SCAN_RAW_CAPTURE, TFT_WHITE);
});
this->addNodes(&wifiSnifferMenu, text_table1[59], TFTORANGE, NULL, PACKET_MONITOR, [this]() {
this->addNodes(&wifiSnifferMenu, text_table1[47], TFTRED, NULL, PWNAGOTCHI, [this]() {
display_obj.clearScreen();
this->drawStatusBar();
wifi_scan_obj.StartScan(WIFI_SCAN_STATION, TFT_WHITE);
wifi_scan_obj.StartScan(WIFI_SCAN_PWN, TFT_RED);
});
#ifdef HAS_ILI9341
this->addNodes(&wifiSnifferMenu, "Signal Monitor", TFTCYAN, NULL, PACKET_MONITOR, [this]() {
#ifndef HAS_ILI9341
this->addNodes(&wifiSnifferMenu, text_table1[49], TFTMAGENTA, NULL, BEACON_SNIFF, [this]() {
display_obj.clearScreen();
this->drawStatusBar();
wifi_scan_obj.StartScan(WIFI_SCAN_SIG_STREN, TFT_CYAN);
wifi_scan_obj.StartScan(WIFI_SCAN_TARGET_AP, TFT_MAGENTA);
});
#endif
this->addNodes(&wifiSnifferMenu, "Scan All", TFTLIME, NULL, BEACON_SNIFF, [this]() {
display_obj.clearScreen();
this->drawStatusBar();
wifi_scan_obj.StartScan(WIFI_SCAN_AP_STA, 0x97e0);
});
#ifndef HAS_ILI9341
this->addNodes(&wifiSnifferMenu, text_table1[59], TFTORANGE, NULL, PACKET_MONITOR, [this]() {
display_obj.clearScreen();
this->drawStatusBar();
wifi_scan_obj.StartScan(WIFI_SCAN_STATION, TFT_WHITE);
});
#endif
//#ifdef HAS_ILI9341
this->addNodes(&wifiSnifferMenu, "Signal Monitor", TFTCYAN, NULL, PACKET_MONITOR, [this]() {
display_obj.clearScreen();
this->drawStatusBar();
wifi_scan_obj.StartScan(WIFI_SCAN_SIG_STREN, TFT_CYAN);
});
//#endif
// Build Wardriving menu
wardrivingMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
@@ -1693,6 +1760,7 @@ void MenuFunctions::RunSetup()
display_obj.clearScreen();
this->drawStatusBar();
wifi_scan_obj.StartScan(WIFI_SCAN_EVIL_PORTAL, TFT_ORANGE);
wifi_scan_obj.setMac();
});
this->addNodes(&wifiAttackMenu, text_table1[54], TFTRED, NULL, DEAUTH_SNIFF, [this]() {
display_obj.clearScreen();
@@ -1766,46 +1834,31 @@ void MenuFunctions::RunSetup()
wifi_scan_obj.StartScan(LV_ADD_SSID, TFT_RED);
selectEPHTMLGFX();
});
apInfoMenu.parentMenu = &wifiGeneralMenu;
this->addNodes(&apInfoMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(apInfoMenu.parentMenu);
});
#else // Mini EP HTML select
this->addNodes(&wifiGeneralMenu, "Select EP HTML File", TFTCYAN, NULL, KEYBOARD_ICO, [this](){
// Add the back button
htmlMenu.list->clear();
this->addNodes(&htmlMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(htmlMenu.parentMenu);
});
// Populate the menu with buttons
for (int i = 0; i < evil_portal_obj.html_files->size(); i++) {
// This is the menu node
this->addNodes(&htmlMenu, evil_portal_obj.html_files->get(i), TFTCYAN, NULL, 255, [this, i](){
evil_portal_obj.selected_html_index = i;
evil_portal_obj.target_html_name = evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index);
Serial.println("Set Evil Portal HTML as " + evil_portal_obj.target_html_name);
evil_portal_obj.using_serial_html = false;
this->changeMenu(htmlMenu.parentMenu);
return;
});
}
this->changeMenu(&htmlMenu);
#if (defined(HAS_BUTTONS) && defined(HAS_SD))
#if !(defined(MARAUDER_V6) || defined(MARAUDER_V6_1))
while(true) {
if (d_btn.justPressed()) {
if (evil_portal_obj.selected_html_index > 0)
evil_portal_obj.selected_html_index--;
else
evil_portal_obj.selected_html_index = evil_portal_obj.html_files->size() - 1;
this->htmlMenu.list->set(0, MenuNode{evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index), false, TFTCYAN, 0, NULL, true, NULL});
this->buildButtons(&htmlMenu);
this->displayCurrentMenu();
}
#if !defined(MARAUDER_M5STICKC) || defined(MARAUDER_M5STICKCP2)
if (u_btn.justPressed()) {
if (evil_portal_obj.selected_html_index < evil_portal_obj.html_files->size() - 1)
evil_portal_obj.selected_html_index++;
else
evil_portal_obj.selected_html_index = 0;
this->htmlMenu.list->set(0, MenuNode{evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index), false, TFTCYAN, 0, NULL, true, NULL});
this->buildButtons(&htmlMenu, 0, evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index));
this->displayCurrentMenu();
}
#endif
if (c_btn.justPressed()) {
if (evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index) != "Back") {
evil_portal_obj.target_html_name = evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index);
Serial.println("Set Evil Portal HTML as " + evil_portal_obj.target_html_name);
evil_portal_obj.using_serial_html = false;
}
this->changeMenu(htmlMenu.parentMenu);
break;
}
}
#endif
#endif
});
#if (!defined(HAS_ILI9341) && defined(HAS_BUTTONS))
@@ -1828,15 +1881,8 @@ void MenuFunctions::RunSetup()
this->changeMenu(wifiAPMenu.parentMenu);
});
// Determine how big the whole menu is going to be
int menu_limit = access_points->size();
/*if (access_points->size() <= BUTTON_ARRAY_LEN)
menu_limit = access_points->size();
else
menu_limit = BUTTON_ARRAY_LEN;*/
// Populate the menu with buttons
for (int i = 0; i < menu_limit; i++) {
for (int i = 0; i < access_points->size(); i++) {
// This is the menu node
this->addNodes(&wifiAPMenu, access_points->get(i).essid, TFTCYAN, NULL, 255, [this, i](){
AccessPoint new_ap = access_points->get(i);
@@ -1853,6 +1899,29 @@ void MenuFunctions::RunSetup()
this->changeMenu(&wifiAPMenu);
});
this->addNodes(&wifiGeneralMenu, "View AP Info", TFTCYAN, NULL, KEYBOARD_ICO, [this](){
// Add the back button
wifiAPMenu.list->clear();
this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(wifiAPMenu.parentMenu);
});
// Populate the menu with buttons
for (int i = 0; i < access_points->size(); i++) {
// This is the menu node
this->addNodes(&wifiAPMenu, access_points->get(i).essid, TFTCYAN, NULL, 255, [this, i](){
this->changeMenu(&apInfoMenu);
wifi_scan_obj.RunAPInfo(i);
});
}
this->changeMenu(&wifiAPMenu);
});
apInfoMenu.parentMenu = &wifiAPMenu;
this->addNodes(&apInfoMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(apInfoMenu.parentMenu);
});
wifiAPMenu.parentMenu = &wifiGeneralMenu;
this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(wifiAPMenu.parentMenu);
@@ -1922,6 +1991,83 @@ void MenuFunctions::RunSetup()
});
#endif
#ifdef HAS_ILI9341
this->addNodes(&wifiGeneralMenu, "View AP Info", TFTLIGHTGREY, NULL, 0, [this]() {
display_obj.clearScreen();
wifi_scan_obj.currentScanMode = LV_ADD_SSID;
wifi_scan_obj.StartScan(LV_ADD_SSID, TFT_WHITE);
addAPGFX("AP Info");
});
#endif
this->addNodes(&wifiGeneralMenu, "Set MACs", TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(&setMacMenu);
});
// Menu for generating and setting MAC addrs for AP and STA
setMacMenu.parentMenu = &wifiGeneralMenu;
this->addNodes(&setMacMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(setMacMenu.parentMenu);
});
// Generate random MAC for AP
this->addNodes(&setMacMenu, "Generate AP MAC", TFTLIME, NULL, 0, [this]() {
this->changeMenu(&genAPMacMenu);
wifi_scan_obj.RunGenerateRandomMac(true);
});
// Generate random MAC for AP
this->addNodes(&setMacMenu, "Generate STA MAC", TFTCYAN, NULL, 0, [this]() {
this->changeMenu(&genAPMacMenu);
wifi_scan_obj.RunGenerateRandomMac(false);
});
// Clone AP MAC to ESP32 for button folks
#ifndef HAS_ILI9341
this->addNodes(&setMacMenu, "Clone AP MAC", TFTRED, NULL, CLEAR_ICO, [this](){
// Add the back button
wifiAPMenu.list->clear();
this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(wifiAPMenu.parentMenu);
});
// Populate the menu with buttons
for (int i = 0; i < access_points->size(); i++) {
// This is the menu node
this->addNodes(&wifiAPMenu, access_points->get(i).essid, TFTLIME, NULL, 255, [this, i](){
this->changeMenu(&genAPMacMenu);
wifi_scan_obj.RunSetMac(access_points->get(i).bssid, true);
});
}
this->changeMenu(&wifiAPMenu);
});
this->addNodes(&setMacMenu, "Clone STA MAC", TFTMAGENTA, NULL, CLEAR_ICO, [this](){
// Add the back button
wifiAPMenu.list->clear();
this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(wifiAPMenu.parentMenu);
});
// Populate the menu with buttons
for (int i = 0; i < stations->size(); i++) {
// This is the menu node
this->addNodes(&wifiAPMenu, macToString(stations->get(i).mac), TFTMAGENTA, NULL, 255, [this, i](){
this->changeMenu(&genAPMacMenu);
wifi_scan_obj.RunSetMac(stations->get(i).mac, false);
});
}
this->changeMenu(&wifiAPMenu);
});
#endif
// Menu for generating and setting access point MAC (just goes bacK)
genAPMacMenu.parentMenu = &wifiGeneralMenu;
this->addNodes(&genAPMacMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(genAPMacMenu.parentMenu);
});
// Build generate ssids menu
generateSSIDsMenu.parentMenu = &wifiGeneralMenu;
this->addNodes(&generateSSIDsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
@@ -2686,6 +2832,7 @@ uint16_t MenuFunctions::getColor(uint16_t color) {
else if (color == TFTSILVER) return TFT_SILVER;
else if (color == TFTDARKGREY) return TFT_DARKGREY;
else if (color == TFTSKYBLUE) return TFT_SKYBLUE;
else if (color == TFTLIME) return 0x97e0;
else return color;
}
@@ -2697,6 +2844,8 @@ void MenuFunctions::changeMenu(Menu * menu)
display_obj.tft.init();
current_menu = menu;
current_menu->selected = 0;
buildButtons(menu);
displayCurrentMenu();

View File

@@ -85,6 +85,7 @@ PROGMEM static void ta_event_cb(lv_obj_t * ta, lv_event_t event);
PROGMEM static void add_ssid_keyboard_event_cb(lv_obj_t * keyboard, lv_event_t event);
PROGMEM static void html_list_cb(lv_obj_t * btn, lv_event_t event);
PROGMEM static void ap_list_cb(lv_obj_t * btn, lv_event_t event);
PROGMEM static void ap_info_list_cb(lv_obj_t * btn, lv_event_t event);
PROGMEM static void at_list_cb(lv_obj_t * btn, lv_event_t event);
PROGMEM static void station_list_cb(lv_obj_t * btn, lv_event_t event);
PROGMEM static void setting_dropdown_cb(lv_obj_t * btn, lv_event_t event);
@@ -155,7 +156,6 @@ class MenuFunctions
Menu updateMenu;
Menu settingsMenu;
Menu specSettingMenu;
Menu infoMenu;
Menu languageMenu;
Menu sdDeleteMenu;
@@ -178,6 +178,9 @@ class MenuFunctions
Menu htmlMenu;
Menu miniKbMenu;
Menu saveFileMenu;
Menu genAPMacMenu;
Menu cloneAPMacMenu;
Menu setMacMenu;
// Bluetooth menu stuff
Menu bluetoothSnifferMenu;
@@ -234,6 +237,9 @@ class MenuFunctions
Menu gpsInfoMenu;
#endif
Menu infoMenu;
Menu apInfoMenu;
Ticker tick;
uint16_t x = -1, y = -1;

File diff suppressed because it is too large Load Diff

View File

@@ -100,9 +100,13 @@
#define BT_SCAN_FLIPPER 45
#define WIFI_SCAN_CHAN_ANALYZER 46
#define BT_SCAN_ANALYZER 47
#define WIFI_SCAN_PACKET_RATE 48
#define WIFI_SCAN_AP_STA 49
#define BASE_MULTIPLIER 4
#define ANALYZER_NAME_REFRESH 100 // Number of events to refresh the name
#define MAX_CHANNEL 14
extern EvilPortal evil_portal_obj;
@@ -178,6 +182,9 @@ class WiFiScan
// Wardriver thanks to https://github.com/JosephHewitt
struct mac_addr mac_history[mac_history_len];
uint8_t ap_mac[6] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
uint8_t sta_mac[6] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
// Settings
uint mac_history_cursor = 0;
uint8_t channel_hop_delay = 1;
@@ -323,7 +330,9 @@ class WiFiScan
void startWiFiAttacks(uint8_t scan_mode, uint16_t color, String title_string);
void signalAnalyzerLoop(uint32_t tick);
void channelAnalyzerLoop(uint32_t tick);
void packetRateLoop(uint32_t tick);
void packetMonitorMain(uint32_t currentTime);
void eapolMonitorMain(uint32_t currentTime);
void updateMidway();
@@ -368,6 +377,16 @@ class WiFiScan
//LinkedList<ssid>* ssids;
// Stuff for RAW stats
uint32_t mgmt_frames = 0;
uint32_t data_frames = 0;
String analyzer_name_string = "";
uint8_t analyzer_frames_recvd = 0;
bool analyzer_name_update = false;
uint8_t set_channel = 1;
uint8_t old_channel = 0;
@@ -424,6 +443,13 @@ class WiFiScan
wifi_config_t ap_config;
#ifdef HAS_SCREEN
int8_t checkAnalyzerButtons(uint32_t currentTime);
#endif
void setMac();
void renderRawStats();
void renderPacketRate();
void displayAnalyzerString(String str);
String security_int_to_string(int security_type);
char* stringToChar(String string);
void RunSetup();
@@ -443,8 +469,11 @@ class WiFiScan
String freeRAM();
void changeChannel();
void changeChannel(int chan);
void RunAPInfo(uint16_t index, bool do_display = true);
void RunInfo();
//void RunShutdownBLE();
void RunSetMac(uint8_t * mac, bool ap = true);
void RunGenerateRandomMac(bool ap = true);
void RunGenerateSSIDs(int count = 20);
void RunClearSSIDs();
void RunClearAPs();

View File

@@ -23,7 +23,7 @@
//#define MARAUDER_REV_FEATHER
//// END BOARD TARGETS
#define MARAUDER_VERSION "v1.3.0"
#define MARAUDER_VERSION "v1.4.2"
#define GRAPH_REFRESH 100
@@ -413,6 +413,8 @@
#define GRAPH_VERT_LIM TFT_HEIGHT/2
#define EXT_BUTTON_WIDTH 0
#define CHAR_WIDTH 6
#define SCREEN_WIDTH TFT_HEIGHT // Originally 240
#define SCREEN_HEIGHT TFT_WIDTH // Originally 320
@@ -430,7 +432,7 @@
//#define MENU_FONT &FreeSans9pt7b
//#define MENU_FONT &FreeSansBold9pt7b
#define BUTTON_SCREEN_LIMIT 6
#define BUTTON_ARRAY_LEN 100
#define BUTTON_ARRAY_LEN BUTTON_SCREEN_LIMIT
#define STATUS_BAR_WIDTH (TFT_HEIGHT/16)
#define LVGL_TICK_PERIOD 6
@@ -483,6 +485,8 @@
#define GRAPH_VERT_LIM TFT_HEIGHT/2
#define EXT_BUTTON_WIDTH 0
#define CHAR_WIDTH 6
#define SCREEN_WIDTH TFT_HEIGHT // Originally 240
#define SCREEN_HEIGHT TFT_WIDTH // Originally 320
@@ -500,7 +504,7 @@
//#define MENU_FONT &FreeSans9pt7b
//#define MENU_FONT &FreeSansBold9pt7b
#define BUTTON_SCREEN_LIMIT 6
#define BUTTON_ARRAY_LEN 13
#define BUTTON_ARRAY_LEN BUTTON_SCREEN_LIMIT
#define STATUS_BAR_WIDTH (TFT_HEIGHT/16)
#define LVGL_TICK_PERIOD 6
@@ -543,6 +547,8 @@
#define GRAPH_VERT_LIM TFT_HEIGHT/2
#define EXT_BUTTON_WIDTH 20
#define CHAR_WIDTH 12
#define SCREEN_WIDTH TFT_WIDTH
#define SCREEN_HEIGHT TFT_HEIGHT
@@ -560,7 +566,7 @@
//#define MENU_FONT &FreeSans9pt7b
//#define MENU_FONT &FreeSansBold9pt7b
#define BUTTON_SCREEN_LIMIT 12
#define BUTTON_ARRAY_LEN 12
#define BUTTON_ARRAY_LEN BUTTON_SCREEN_LIMIT
#define STATUS_BAR_WIDTH 16
#define LVGL_TICK_PERIOD 6
@@ -603,6 +609,12 @@
#define TFT_DIY
#define GRAPH_VERT_LIM TFT_HEIGHT/2
#define EXT_BUTTON_WIDTH 20
#define SCREEN_BUFFER
#define MAX_SCREEN_BUFFER 22
#define CHAR_WIDTH 12
#define SCREEN_WIDTH TFT_WIDTH
@@ -621,7 +633,7 @@
//#define MENU_FONT &FreeSans9pt7b
//#define MENU_FONT &FreeSansBold9pt7b
#define BUTTON_SCREEN_LIMIT 12
#define BUTTON_ARRAY_LEN 12
#define BUTTON_ARRAY_LEN BUTTON_SCREEN_LIMIT
#define STATUS_BAR_WIDTH 16
#define LVGL_TICK_PERIOD 6
@@ -668,6 +680,8 @@
#define SCREEN_BUFFER
#define MAX_SCREEN_BUFFER 22
#define EXT_BUTTON_WIDTH 0
#define CHAR_WIDTH 12
#define SCREEN_WIDTH TFT_WIDTH
@@ -686,7 +700,7 @@
//#define MENU_FONT &FreeSans9pt7b
//#define MENU_FONT &FreeSansBold9pt7b
#define BUTTON_SCREEN_LIMIT 12
#define BUTTON_ARRAY_LEN 100
#define BUTTON_ARRAY_LEN BUTTON_SCREEN_LIMIT
#define STATUS_BAR_WIDTH 16
#define LVGL_TICK_PERIOD 6
@@ -730,6 +744,8 @@
#define TFT_DIY
#define KIT
#define EXT_BUTTON_WIDTH 20
#define CHAR_WIDTH 12
#define SCREEN_WIDTH TFT_WIDTH
@@ -748,7 +764,7 @@
//#define MENU_FONT &FreeSans9pt7b
//#define MENU_FONT &FreeSansBold9pt7b
#define BUTTON_SCREEN_LIMIT 12
#define BUTTON_ARRAY_LEN 12
#define BUTTON_ARRAY_LEN BUTTON_SCREEN_LIMIT
#define STATUS_BAR_WIDTH 16
#define LVGL_TICK_PERIOD 6
@@ -802,6 +818,8 @@
#define GRAPH_VERT_LIM TFT_HEIGHT/2
#define EXT_BUTTON_WIDTH 0
#define CHAR_WIDTH 6
#define SCREEN_WIDTH TFT_WIDTH // Originally 240
#define SCREEN_HEIGHT TFT_HEIGHT // Originally 320
@@ -819,7 +837,7 @@
//#define MENU_FONT &FreeSans9pt7b
//#define MENU_FONT &FreeSansBold9pt7b
#define BUTTON_SCREEN_LIMIT 10
#define BUTTON_ARRAY_LEN 100
#define BUTTON_ARRAY_LEN BUTTON_SCREEN_LIMIT
#define STATUS_BAR_WIDTH (TFT_HEIGHT/16)
#define LVGL_TICK_PERIOD 6
@@ -871,6 +889,8 @@
#define GRAPH_VERT_LIM TFT_HEIGHT/2
#define EXT_BUTTON_WIDTH 0
#define CHAR_WIDTH 6
#define SCREEN_WIDTH TFT_WIDTH // Originally 240
#define SCREEN_HEIGHT TFT_HEIGHT // Originally 320
@@ -888,7 +908,7 @@
//#define MENU_FONT &FreeSans9pt7b
//#define MENU_FONT &FreeSansBold9pt7b
#define BUTTON_SCREEN_LIMIT 5
#define BUTTON_ARRAY_LEN 100
#define BUTTON_ARRAY_LEN BUTTON_SCREEN_LIMIT
#define STATUS_BAR_WIDTH (TFT_HEIGHT/16)
#define LVGL_TICK_PERIOD 6
@@ -1119,6 +1139,7 @@
#define TFTSILVER 15
#define TFTDARKGREY 16
#define TFTSKYBLUE 17
#define TFTLIME 18
//// END SPACE SAVING COLORS
//// SCREEN STUFF

View File

@@ -148,9 +148,10 @@ void backlightOff() {
#endif
}
void setup()
{
esp_spiram_init();
#ifdef defined(MARAUDER_M5STICKC) && !defined(MARAUDER_M5STICKCP2)
axp192_obj.begin();
#endif
@@ -346,7 +347,9 @@ void loop()
bool mini = false;
#ifdef SCREEN_BUFFER
mini = true;
#ifndef HAS_ILI9341
mini = true;
#endif
#endif
#ifdef HAS_ILI9341
@@ -366,20 +369,11 @@ void loop()
#endif
// Update all of our objects
/*#ifdef HAS_SCREEN
bool do_draw = display_obj.draw_tft;
#else
bool do_draw = false;
#endif*/
//if ((!do_draw) && (wifi_scan_obj.currentScanMode != ESP_UPDATE))
//{
cli_obj.main(currentTime);
#ifdef HAS_SCREEN
display_obj.main(wifi_scan_obj.currentScanMode);
#endif
wifi_scan_obj.main(currentTime);
//evil_portal_obj.main(wifi_scan_obj.currentScanMode);
#ifdef HAS_GPS
gps_obj.main();
@@ -395,7 +389,6 @@ void loop()
#ifdef HAS_BATTERY
battery_obj.main(currentTime);
//temp_obj.main(currentTime);
#endif
settings_obj.main(currentTime);
if (((wifi_scan_obj.currentScanMode != WIFI_PACKET_MONITOR) && (wifi_scan_obj.currentScanMode != WIFI_SCAN_EAPOL)) ||
@@ -403,7 +396,6 @@ void loop()
#ifdef HAS_SCREEN
menu_function_obj.main(currentTime);
#endif
//cli_obj.main(currentTime);
}
#ifdef MARAUDER_FLIPPER
flipper_led.main();
@@ -415,29 +407,9 @@ void loop()
led_obj.main(currentTime);
#endif
//if (wifi_scan_obj.currentScanMode == OTA_UPDATE)
// web_obj.main();
#ifdef HAS_SCREEN
delay(1);
#else
delay(50);
#endif
//}
/*else if (wifi_scan_obj.currentScanMode == ESP_UPDATE) {
#ifdef HAS_SCREEN
display_obj.main(wifi_scan_obj.currentScanMode);
menu_function_obj.main(currentTime);
#endif
#ifdef MARAUDER_FLIPPER
flipper_led.main();
#elif defined(XIAO_ESP32_S3)
xiao_led.main();
#else
led_obj.main(currentTime);
#endif
//cli_obj.main(currentTime);
delay(1);
}*/
}

View File

@@ -12,6 +12,136 @@ struct mac_addr {
struct Station {
uint8_t mac[6];
bool selected;
uint16_t packets;
};
const char apple_ouis[][9] PROGMEM = {
"00:17:F2", "00:1E:C2", "00:26:08", "F8:1E:DF", "BC:92:6B",
"28:E0:2C", "3C:07:54", "7C:D1:C3", "DC:A9:04", "F0:D1:A9",
"C0:2C:5C", "00:03:93", "00:03:94", "00:03:95", "00:03:96",
"00:03:97", "00:03:98", "00:03:99", "00:03:9A", "00:03:9B",
"00:03:9C", "00:03:9D", "00:03:9E", "00:03:9F", "00:03:A0",
"00:03:A1", "00:03:A2", "00:03:A3", "00:03:A4", "00:03:A5",
"00:03:A6", "00:03:A7", "00:03:A8", "00:03:A9", "00:03:AA",
"00:03:AB", "00:03:AC", "00:03:AD", "00:03:AE", "00:03:AF",
"00:03:B0", "00:03:B1", "00:03:B2", "00:03:B3", "00:03:B4",
"00:03:B5", "00:03:B6", "00:03:B7", "00:03:B8", "00:03:B9",
"00:03:BA", "00:03:BB", "00:03:BC", "00:03:BD", "00:03:BE",
"00:03:BF", "00:03:C0", "00:03:C1", "00:03:C2", "00:03:C3",
"00:03:C4", "00:03:C5", "00:03:C6", "00:03:C7", "00:03:C8",
"00:03:C9", "00:03:CA", "00:03:CB", "00:03:CC", "00:03:CD",
"00:03:CE", "00:03:CF", "00:03:D0", "00:03:D1", "00:03:D2",
"00:03:D3", "00:03:D4", "00:03:D5", "00:03:D6", "00:03:D7",
"00:03:D8", "00:03:D9", "00:03:DA", "00:03:DB", "00:03:DC",
"00:03:DD", "00:03:DE", "00:03:DF", "00:03:E0", "00:03:E1",
"00:03:E2", "00:03:E3", "00:03:E4", "00:03:E5", "00:03:E6",
"00:03:E7", "00:03:E8", "00:03:E9", "00:03:EA", "00:03:EB",
"00:03:EC", "00:03:ED", "00:03:EE", "00:03:EF", "00:03:F0",
"00:03:F1", "00:03:F2", "00:03:F3", "00:03:F4", "00:03:F5",
"00:03:F6", "00:03:F7", "00:03:F8", "00:03:F9", "00:03:FA",
"00:03:FB", "00:03:FC", "00:03:FD", "00:03:FE", "00:03:FF"
};
const char asus_ouis[][9] PROGMEM = {
"00:0C:6E", "00:0E:A6", "00:11:2F", "00:11:D8", "00:13:D4", "00:15:F2", "00:17:31", "00:18:F3", "00:1A:92",
"00:1B:FC", "00:1D:60", "00:1E:8C", "00:1F:C6", "00:22:15", "00:23:54", "00:24:8C", "00:26:18", "00:E0:18",
"04:42:1A", "04:92:26", "04:D4:C4", "04:D9:F5", "08:60:6E", "08:62:66", "08:BF:B8", "0C:9D:92", "10:7B:44",
"10:7C:61", "10:BF:48", "10:C3:7B", "14:DA:E9", "14:DD:A9", "18:31:BF", "1C:87:2C", "1C:B7:2C", "20:CF:30",
"24:4B:FE", "2C:4D:54", "2C:56:DC", "2C:FD:A1", "30:5A:3A", "30:85:A9", "34:97:F6", "38:2C:4A", "38:D5:47",
"3C:7C:3F", "40:16:7E", "40:B0:76", "48:5B:39", "4C:ED:FB", "50:46:5D", "50:EB:F6", "54:04:A6", "54:A0:50",
"58:11:22", "60:45:CB", "60:A4:4C", "60:CF:84", "70:4D:7B", "70:8B:CD", "74:D0:2B", "78:24:AF", "7C:10:C9",
"88:D7:F6", "90:E6:BA", "9C:5C:8E", "A0:36:BC", "A8:5E:45", "AC:22:0B", "AC:9E:17", "B0:6E:BF", "BC:AE:C5",
"BC:EE:7B", "C8:60:00", "C8:7F:54", "CC:28:AA", "D0:17:C2", "D4:5D:64", "D8:50:E6", "E0:3F:49", "E0:CB:4E",
"E8:9C:25", "F0:2F:74", "F0:79:59", "F4:6D:04", "F8:32:E4", "FC:34:97", "FC:C2:33"
};
const char belkin_ouis[][9] PROGMEM = {
"00:11:50", "00:17:3F", "00:30:BD", "08:BD:43", "14:91:82", "24:F5:A2", "30:23:03", "80:69:1A", "94:10:3E",
"94:44:52", "B4:75:0E", "C0:56:27", "C4:41:1E", "D8:EC:5E", "E8:9F:80", "EC:1A:59", "EC:22:80"
};
const char cisco_ouis[][9] PROGMEM = {
"00:1B:0D", "00:1D:45", "00:1E:7A", "00:25:9C", "00:50:56",
"40:55:39", "58:8D:09", "A4:4C:C8", "F8:0F:F9"
};
const char dlink_ouis[][9] PROGMEM = {
"00:05:5D", "00:0D:88", "00:0F:3D", "00:11:95", "00:13:46", "00:15:E9", "00:17:9A", "00:19:5B", "00:1B:11",
"00:1C:F0", "00:1E:58", "00:21:91", "00:22:B0", "00:24:01", "00:26:5A", "00:AD:24", "04:BA:D6", "08:5A:11",
"0C:0E:76", "0C:B6:D2", "10:62:EB", "10:BE:F5", "14:D6:4D", "18:0F:76", "1C:5F:2B", "1C:7E:E5", "1C:AF:F7",
"1C:BD:B9", "28:3B:82", "30:23:03", "34:08:04", "34:0A:33", "3C:1E:04", "3C:33:32", "40:86:CB", "40:9B:CD",
"54:B8:0A", "5C:D9:98", "60:63:4C", "64:29:43", "6C:19:8F", "6C:72:20", "74:44:01", "74:DA:DA", "78:32:1B",
"78:54:2E", "78:98:E8", "80:26:89", "84:C9:B2", "88:76:B9", "90:8D:78", "90:94:E4", "9C:D6:43", "A0:63:91",
"A0:AB:1B", "A4:2A:95", "A8:63:7D", "AC:F1:DF", "B4:37:D8", "B8:A3:86", "BC:0F:9A", "BC:22:28", "BC:F6:85",
"C0:A0:BB", "C4:A8:1D", "C4:E9:0A", "C8:78:7D", "C8:BE:19", "C8:D3:A3", "CC:B2:55", "D8:FE:E3", "DC:EA:E7",
"E0:1C:FC", "E4:6F:13", "E8:CC:18", "EC:22:80", "EC:AD:E0", "F0:7D:68", "F0:B4:D2", "F4:8C:EB", "F8:E9:03",
"FC:75:16"
};
const char google_ouis[][9] PROGMEM = {
"3C:5A:B4", "5C:BF:C0", "78:4F:43", "A4:77:33", "D4:97:0B", "F0:72:8C"
};
const char huawei_ouis[][9] PROGMEM = {
"00:1A:2B", "28:FF:3C", "5C:4C:A9", "8C:71:F8", "C8:D1:5E",
"E4:4C:A9", "F4:12:FA"
};
const char lg_ouis[][9] PROGMEM = {
"00:17:C0", "18:AF:8F", "38:2D:AE", "5C:87:9C", "68:27:37",
"78:5D:C8", "94:65:2D", "A4:77:33", "C4:43:8F"
};
const char linksys_ouis[][9] PROGMEM = {
"00:04:5A", "00:06:25", "00:0C:41", "00:0E:08", "00:0F:66", "00:12:17", "00:13:10", "00:14:BF", "00:16:B6",
"00:18:39", "00:18:F8", "00:1A:70", "00:1C:10", "00:1D:7E", "00:1E:E5", "00:21:29", "00:22:6B", "00:23:69",
"00:25:9C", "00:23:54", "00:24:B2", "00:31:92", "00:5F:67", "10:27:F5", "14:EB:B6", "1C:61:B4", "20:36:26",
"28:87:BA", "30:5A:3A", "2C:FD:A1", "30:23:03", "30:46:9A", "40:ED:00", "48:22:54", "50:91:E3", "54:AF:97",
"5C:A2:F4", "5C:A6:E6", "5C:E9:31", "60:A4:B7", "68:7F:F0", "6C:5A:B0", "78:8C:B5", "7C:C2:C6", "9C:53:22",
"9C:A2:F4", "A8:42:A1", "AC:15:A2", "B0:A7:B9", "B4:B0:24", "C0:06:C3", "CC:68:B6", "E8:48:B8", "F0:A7:31"
};
const char netgear_ouis[][9] PROGMEM = {
"00:09:5B", "00:0F:B5", "00:14:6C", "00:1B:2F", "00:1E:2A", "00:1F:33", "00:22:3F", "00:22:4B", "00:26:F2",
"00:8E:F2", "08:02:8E", "08:36:C9", "08:BD:43", "10:0C:6B", "10:0D:7F", "10:DA:43", "14:59:C0", "20:4E:7F",
"20:E5:2A", "28:80:88", "28:94:01", "28:C6:8E", "2C:30:33", "2C:B0:5D", "30:46:9A", "34:98:B5", "38:94:ED",
"3C:37:86", "40:5D:82", "44:A5:6E", "4C:60:DE", "50:4A:6E", "50:6A:03", "54:07:7D", "58:EF:68", "60:38:E0",
"6C:B0:CE", "6C:CD:D6", "74:44:01", "80:37:73", "84:1B:5E", "8C:3B:AD", "94:18:65", "9C:3D:CF", "9C:C9:EB",
"9C:D3:6D", "A0:04:60", "A0:21:B7", "A0:40:A0", "A4:2B:8C", "B0:39:56", "B0:7F:B9", "B0:B9:8A", "BC:A5:11",
"C0:3F:0E", "C0:FF:D4", "C4:04:15", "C4:3D:C7", "C8:9E:43", "CC:40:D0", "DC:EF:09", "E0:46:9A", "E0:46:EE",
"E0:91:F5", "E4:F4:C6", "E8:FC:AF", "F8:73:94"
};
const char oneplus_ouis[][9] PROGMEM = {
"08:EC:A9", "30:9C:23", "38:78:62", "64:A2:F9", "74:AC:B9",
"A8:14:51", "B4:86:55", "D8:CB:8A", "F4:8C:50"
};
const char samsung_ouis[][9] PROGMEM = {
"00:12:47", "00:15:99", "00:16:6B", "00:1B:FC", "10:5F:06",
"18:59:36", "20:02:AF", "24:4B:03", "38:2D:3D", "40:B8:37",
"00:1F:12", "00:1D:0F", "00:1A:9A", "00:19:E1", "00:18:FF",
"00:17:77", "00:16:72", "00:14:69", "00:13:65", "00:12:60",
"30:37:0D", "40:8C:47", "50:55:5F", "60:47:A1", "70:0A:AD",
"80:61:43", "90:48:F7", "A0:4C:CB", "B0:5E:93", "C0:3D:F5",
"D0:31:AA", "E0:4F:02", "F0:3B:94"
};
const char sony_ouis[][9] PROGMEM = {
"00:19:C5", "00:1B:59", "00:1E:DC", "10:68:3F", "54:42:49",
"A8:E3:EE", "B8:F9:34", "CC:5D:4E", "E8:89:2F"
};
const char tplink_ouis[][9] PROGMEM = {
"00:31:92", "00:5F:67", "10:27:F5", "14:EB:B6", "1C:61:B4", "20:36:26", "28:87:BA", "30:DE:4B", "34:60:F9",
"3C:52:A1", "40:ED:00", "48:22:54", "50:91:E3", "54:AF:97", "5C:62:8B", "5C:A6:E6", "5C:E9:31", "60:A4:B7",
"68:7F:F0", "6C:5A:B0", "78:8C:B5", "7C:C2:C6", "9C:53:22", "9C:A2:F4", "A8:42:A1", "AC:15:A2", "B0:A7:B9",
"B4:B0:24", "C0:06:C3", "CC:68:B6", "E8:48:B8", "F0:A7:31"
};
const char xiaomi_ouis[][9] PROGMEM = {
"04:CF:8C", "18:59:36", "38:1A:2D", "64:B4:73", "78:02:F8",
"90:4E:91", "C4:0B:CB", "D0:DB:32"
};
String byteArrayToHexString(const std::vector<uint8_t>& byteArray) {
@@ -127,4 +257,63 @@ void convertMacStringToUint8(const String& macStr, uint8_t macAddr[6]) {
}
}
// Function to check if the given MAC address matches any known OUI
const char* getManufacturer(const char *addr) {
static char oui[9]; // Temporary buffer for extracted OUI
// Extract the first three bytes (OUI) from addr
strncpy(oui, addr, 8);
oui[8] = '\0'; // Ensure null termination
// Convert the addr (OUI) to lowercase
for (int i = 0; i < 8; i++) {
oui[i] = tolower(oui[i]);
}
// Helper macro to check against an array stored in PROGMEM
#define CHECK_OUI(manufacturer, list) \
for (uint8_t i = 0; i < sizeof(list) / sizeof(list[0]); i++) { \
char storedOUI[9]; \
strcpy_P(storedOUI, list[i]); \
/* Convert the stored OUI to lowercase */ \
for (int j = 0; j < 8; j++) { \
storedOUI[j] = tolower(storedOUI[j]); \
} \
if (strcmp(oui, storedOUI) == 0) return manufacturer; \
}
// Check against known manufacturers
CHECK_OUI("Apple", apple_ouis);
CHECK_OUI("Asus", asus_ouis);
CHECK_OUI("Belkin", belkin_ouis);
CHECK_OUI("Cisco", cisco_ouis);
CHECK_OUI("DLink", dlink_ouis);
CHECK_OUI("Google", google_ouis);
CHECK_OUI("Huawei", huawei_ouis);
CHECK_OUI("LG", lg_ouis);
CHECK_OUI("Linksys", linksys_ouis);
CHECK_OUI("Netgear", netgear_ouis);
CHECK_OUI("OnePlus", oneplus_ouis);
CHECK_OUI("Samsung", samsung_ouis);
CHECK_OUI("Sony", sony_ouis);
CHECK_OUI("TP-Link", tplink_ouis);
CHECK_OUI("Xiaomi", xiaomi_ouis);
return ""; // Return "Unknown" if no match is found
}
String replaceOUIWithManufacturer(const char *sta_addr) {
const char *manufacturer = getManufacturer(sta_addr);
if (manufacturer == nullptr || strlen(manufacturer) == 0) {
return String(sta_addr); // Return original if no manufacturer found
}
// Skip the first 8 characters (3 bytes and 2 colons)
const char *mac_suffix = sta_addr + 8;
// Construct the new address: manufacturer + the remaining MAC address (after the first 3 bytes)
return String(manufacturer) + mac_suffix;
}
#endif