mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2025-12-12 15:50:36 -08:00
Add commands for info and ap/station scanning
This commit is contained in:
@@ -222,6 +222,7 @@ void CommandLine::runCommand(String input) {
|
||||
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);
|
||||
@@ -240,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);
|
||||
@@ -604,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
|
||||
@@ -1200,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
|
||||
|
||||
@@ -56,6 +56,7 @@ const char PROGMEM NMEA_CMD[] = "nmea";
|
||||
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";
|
||||
@@ -77,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";
|
||||
@@ -112,6 +114,7 @@ const char PROGMEM HELP_NMEA_CMD[] = "nmea";
|
||||
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";
|
||||
@@ -132,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>";
|
||||
|
||||
@@ -155,7 +155,6 @@ class MenuFunctions
|
||||
Menu updateMenu;
|
||||
Menu settingsMenu;
|
||||
Menu specSettingMenu;
|
||||
Menu infoMenu;
|
||||
Menu languageMenu;
|
||||
Menu sdDeleteMenu;
|
||||
|
||||
@@ -235,6 +234,8 @@ class MenuFunctions
|
||||
Menu gpsInfoMenu;
|
||||
#endif
|
||||
|
||||
Menu infoMenu;
|
||||
|
||||
Ticker tick;
|
||||
|
||||
uint16_t x = -1, y = -1;
|
||||
|
||||
@@ -1932,11 +1932,13 @@ void WiFiScan::RunGPSNmea() {
|
||||
#endif
|
||||
}
|
||||
|
||||
void WiFiScan::RunAPInfo(uint16_t index) {
|
||||
void WiFiScan::RunAPInfo(uint16_t index, bool do_display) {
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.setCursor(0, (STATUS_BAR_WIDTH * 2) + CHAR_WIDTH + KEY_H);
|
||||
display_obj.tft.setTextSize(1);
|
||||
display_obj.tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
if (do_display) {
|
||||
display_obj.tft.setCursor(0, (STATUS_BAR_WIDTH * 2) + CHAR_WIDTH + KEY_H);
|
||||
display_obj.tft.setTextSize(1);
|
||||
display_obj.tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
}
|
||||
#endif
|
||||
|
||||
Serial.println(" ESSID: " + (String)access_points->get(index).essid);
|
||||
@@ -1947,24 +1949,30 @@ void WiFiScan::RunAPInfo(uint16_t index) {
|
||||
Serial.println("Stations: " + (String)access_points->get(index).stations->size());
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println(" ESSID: " + (String)access_points->get(index).essid);
|
||||
display_obj.tft.println(" BSSID: " + (String)macToString(access_points->get(index).bssid));
|
||||
display_obj.tft.println(" Channel: " + (String)access_points->get(index).channel);
|
||||
display_obj.tft.println(" RSSI: " + (String)access_points->get(index).rssi);
|
||||
display_obj.tft.println(" Frames: " + (String)access_points->get(index).packets);
|
||||
display_obj.tft.println("Stations: " + (String)access_points->get(index).stations->size());
|
||||
if (do_display) {
|
||||
display_obj.tft.println(" ESSID: " + (String)access_points->get(index).essid);
|
||||
display_obj.tft.println(" BSSID: " + (String)macToString(access_points->get(index).bssid));
|
||||
display_obj.tft.println(" Channel: " + (String)access_points->get(index).channel);
|
||||
display_obj.tft.println(" RSSI: " + (String)access_points->get(index).rssi);
|
||||
display_obj.tft.println(" Frames: " + (String)access_points->get(index).packets);
|
||||
display_obj.tft.println("Stations: " + (String)access_points->get(index).stations->size());
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!access_points->get(index).selected) {
|
||||
Serial.println("Selected: false");
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println("Selected: false");
|
||||
if (do_display) {
|
||||
display_obj.tft.println("Selected: false");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
Serial.println("Selected: true");
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println("Selected: true");
|
||||
if (do_display) {
|
||||
display_obj.tft.println("Selected: true");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1990,15 +1998,22 @@ void WiFiScan::RunInfo()
|
||||
display_obj.tft.println(text_table4[22] + (String)esp_get_idf_version());
|
||||
#endif
|
||||
|
||||
Serial.println(text_table4[20]);
|
||||
Serial.println(text_table4[21] + display_obj.version_number);
|
||||
Serial.println("Hardware: " + (String)HARDWARE_NAME);
|
||||
Serial.println(text_table4[22] + (String)esp_get_idf_version());
|
||||
|
||||
if (this->wsl_bypass_enabled) {
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println(text_table4[23]);
|
||||
#endif
|
||||
Serial.println(text_table4[23]);
|
||||
}
|
||||
else {
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println(text_table4[24]);
|
||||
#endif
|
||||
Serial.println(text_table4[24]);
|
||||
}
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
@@ -2006,6 +2021,9 @@ void WiFiScan::RunInfo()
|
||||
display_obj.tft.println(text_table4[26] + ap_mac);
|
||||
display_obj.tft.println(text_table4[27] + free_ram);
|
||||
#endif
|
||||
Serial.println(text_table4[25] + sta_mac);
|
||||
Serial.println(text_table4[26] + ap_mac);
|
||||
Serial.println(text_table4[27] + free_ram);
|
||||
|
||||
#if defined(HAS_SD)
|
||||
if (sd_obj.supported) {
|
||||
@@ -2015,11 +2033,17 @@ void WiFiScan::RunInfo()
|
||||
display_obj.tft.print(sd_obj.card_sz);
|
||||
display_obj.tft.println("MB");
|
||||
#endif
|
||||
Serial.println(text_table4[28]);
|
||||
Serial.print(text_table4[29]);
|
||||
Serial.print(sd_obj.card_sz);
|
||||
Serial.println("MB");
|
||||
} else {
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println(text_table4[30]);
|
||||
display_obj.tft.println(text_table4[31]);
|
||||
#endif
|
||||
Serial.println(text_table4[30]);
|
||||
Serial.println(text_table4[31]);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2030,11 +2054,14 @@ void WiFiScan::RunInfo()
|
||||
display_obj.tft.println(text_table4[32]);
|
||||
display_obj.tft.println(text_table4[33] + (String)battery_obj.battery_level + "%");
|
||||
#endif
|
||||
Serial.println(text_table4[32]);
|
||||
Serial.println(text_table4[33] + (String)battery_obj.battery_level + "%");
|
||||
}
|
||||
else {
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println(text_table4[34]);
|
||||
#endif
|
||||
Serial.println(text_table4[34]);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -461,7 +461,7 @@ class WiFiScan
|
||||
String freeRAM();
|
||||
void changeChannel();
|
||||
void changeChannel(int chan);
|
||||
void RunAPInfo(uint16_t index);
|
||||
void RunAPInfo(uint16_t index, bool do_display = true);
|
||||
void RunInfo();
|
||||
//void RunShutdownBLE();
|
||||
void RunGenerateSSIDs(int count = 20);
|
||||
|
||||
Reference in New Issue
Block a user