mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2026-07-28 14:47:16 -07:00
Merge pull request #1227 from justcallmekoko/develop
Remove AP (only) scan
This commit is contained in:
@@ -244,7 +244,6 @@ void CommandLine::runCommand(String input) {
|
||||
Serial.println(HELP_PORT_SCAN_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);
|
||||
Serial.println(HELP_SNIFF_BEACON_CMD);
|
||||
@@ -661,106 +660,36 @@ void CommandLine::runCommand(String input) {
|
||||
Serial.println(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
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
#endif
|
||||
|
||||
if (full_sw == -1) {
|
||||
Serial.print(F("Starting AP scan. Stop with "));
|
||||
Serial.println(STOPSCAN_CMD);
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_TARGET_AP, TFT_MAGENTA);
|
||||
}
|
||||
}
|
||||
// Raw sniff
|
||||
else if (cmd_args.get(0) == SNIFF_RAW_CMD) {
|
||||
else if (cmd_args.get(0) == SNIFF_RAW_CMD)
|
||||
this->startScanFromCLI(WIFI_SCAN_RAW_CAPTURE, TFT_WHITE, "Raw sniff");
|
||||
/*Serial.println(STOPSCAN_CMD);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
#endif
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_RAW_CAPTURE, TFT_WHITE);*/
|
||||
}
|
||||
// Scan stations
|
||||
/*else if (cmd_args.get(0) == SCANSTA_CMD) {
|
||||
if(access_points->size() < 1)
|
||||
Serial.print(F("The AP list is empty. Scan APs first with "));
|
||||
Serial.println(SCANAP_CMD);
|
||||
|
||||
this->startScanFromCLI(WIFI_SCAN_STATION, TFT_ORANGE, "Station scan");
|
||||
}*/
|
||||
// Beacon sniff
|
||||
else if (cmd_args.get(0) == SNIFF_BEACON_CMD) {
|
||||
this->startScanFromCLI(WIFI_SCAN_AP, TFT_MAGENTA, "Beacon sniff");
|
||||
/*Serial.println(STOPSCAN_CMD);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
#endif
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_AP, TFT_MAGENTA);*/
|
||||
}
|
||||
// SAE sniff
|
||||
else if (cmd_args.get(0) == SNIFF_SAE_CMD) {
|
||||
this->startScanFromCLI(WIFI_SCAN_SAE_COMMIT, TFT_MAGENTA, "Commit sniff");
|
||||
/*Serial.println(STOPSCAN_CMD);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
#endif
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_SAE_COMMIT, TFT_MAGENTA);*/
|
||||
}
|
||||
// Probe sniff
|
||||
else if (cmd_args.get(0) == SNIFF_PROBE_CMD) {
|
||||
this->startScanFromCLI(WIFI_SCAN_PROBE, TFT_MAGENTA, "Probe sniff");
|
||||
/*Serial.println(STOPSCAN_CMD);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
#endif
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_PROBE, TFT_MAGENTA);*/
|
||||
}
|
||||
// Deauth sniff
|
||||
else if (cmd_args.get(0) == SNIFF_DEAUTH_CMD) {
|
||||
this->startScanFromCLI(WIFI_SCAN_DEAUTH, TFT_RED, "Deauth sniff");
|
||||
/*Serial.println(STOPSCAN_CMD);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
#endif
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_DEAUTH, TFT_RED);*/
|
||||
}
|
||||
// Pwn sniff
|
||||
else if (cmd_args.get(0) == SNIFF_PWN_CMD) {
|
||||
this->startScanFromCLI(WIFI_SCAN_PWN, TFT_MAGENTA, "Pwnagotchi sniff");
|
||||
/*Serial.println(STOPSCAN_CMD);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
#endif
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_PWN, TFT_MAGENTA);*/
|
||||
}
|
||||
// PineScan sniff
|
||||
else if (cmd_args.get(0) == SNIFF_PINESCAN_CMD) {
|
||||
this->startScanFromCLI(WIFI_SCAN_PINESCAN, TFT_MAGENTA, "Pinescan sniff");
|
||||
/*Serial.println(STOPSCAN_CMD);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
#endif
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_PINESCAN, TFT_MAGENTA);*/
|
||||
}
|
||||
// MultiSSID sniff
|
||||
else if (cmd_args.get(0) == SNIFF_MULTISSID_CMD) {
|
||||
this->startScanFromCLI(WIFI_SCAN_MULTISSID, TFT_MAGENTA, "MultiSSID sniff");
|
||||
/*Serial.println(STOPSCAN_CMD);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
#endif
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_MULTISSID, TFT_MAGENTA);*/
|
||||
}
|
||||
// PMKID sniff
|
||||
else if (cmd_args.get(0) == SNIFF_PMKID_CMD) {
|
||||
@@ -1386,8 +1315,9 @@ void CommandLine::runCommand(String input) {
|
||||
AccessPoint access_point = access_points->get(x);
|
||||
Serial.println("[" + (String)x + "] " + access_point.essid + " " + (String)access_point.rssi + ":");
|
||||
for (int i = 0; i < access_point.stations->size(); i++) {
|
||||
wifi_scan_obj.getMAC(sta_mac, stations->get(access_point.stations->get(i)).mac, 0);
|
||||
if (stations->get(access_point.stations->get(i)).selected) {
|
||||
Station station = stations->get(access_point.stations->get(i));
|
||||
wifi_scan_obj.getMAC(sta_mac, station.mac, 0);
|
||||
if (station.selected) {
|
||||
Serial.print(" [" + (String)access_point.stations->get(i) + "] ");
|
||||
Serial.print(sta_mac);
|
||||
Serial.println(F(" (selected)"));
|
||||
@@ -1431,10 +1361,11 @@ void CommandLine::runCommand(String input) {
|
||||
if ((ap_sw != -1) && (pw_sw != -1)) {
|
||||
int index = cmd_args.get(ap_sw + 1).toInt();
|
||||
String password = cmd_args.get(pw_sw + 1);
|
||||
Serial.println("Using SSID: " + (String)access_points->get(index).essid + " Password: " + (String)password);
|
||||
AccessPoint access_point = access_points->get(index);
|
||||
Serial.println("Using SSID: " + (String)access_point.essid + " Password: " + (String)password);
|
||||
//wifi_scan_obj.currentScanMode = LV_JOIN_WIFI;
|
||||
//wifi_scan_obj.StartScan(LV_JOIN_WIFI, TFT_YELLOW);
|
||||
wifi_scan_obj.joinWiFi(access_points->get(index).essid, password, false);
|
||||
wifi_scan_obj.joinWiFi(access_point.essid, password, false);
|
||||
#ifdef HAS_SCREEN
|
||||
#ifdef HAS_MINI_KB
|
||||
menu_function_obj.changeMenu(menu_function_obj.current_menu);
|
||||
@@ -1507,21 +1438,22 @@ void CommandLine::runCommand(String input) {
|
||||
// Mark APs as selected
|
||||
for (int i = 0; i < ap_index.size(); i++) {
|
||||
int index = ap_index.get(i).toInt();
|
||||
AccessPoint access_point = access_points->get(index);
|
||||
if (!this->inRange(access_points->size(), index)) {
|
||||
Serial.print(F("Index not in range: "));
|
||||
Serial.println(index);
|
||||
continue;
|
||||
}
|
||||
if (access_points->get(index).selected) {
|
||||
if (access_point.selected) {
|
||||
// Unselect "selected" ap
|
||||
AccessPoint new_ap = access_points->get(index);
|
||||
AccessPoint new_ap = access_point;
|
||||
new_ap.selected = false;
|
||||
access_points->set(index, new_ap);
|
||||
count_unselected += 1;
|
||||
}
|
||||
else {
|
||||
// Select "unselected" ap
|
||||
AccessPoint new_ap = access_points->get(index);
|
||||
AccessPoint new_ap = access_point;
|
||||
new_ap.selected = true;
|
||||
access_points->set(index, new_ap);
|
||||
count_selected += 1;
|
||||
@@ -1537,16 +1469,17 @@ void CommandLine::runCommand(String input) {
|
||||
// Select all Stations
|
||||
if (cmd_args.get(cl_sw + 1) == "all") {
|
||||
for (int i = 0; i < stations->size(); i++) {
|
||||
if (stations->get(i).selected) {
|
||||
Station station = stations->get(i);
|
||||
if (station.selected) {
|
||||
// Unselect "selected" ap
|
||||
Station new_sta = stations->get(i);
|
||||
Station new_sta = station;
|
||||
new_sta.selected = false;
|
||||
stations->set(i, new_sta);
|
||||
count_unselected += 1;
|
||||
}
|
||||
else {
|
||||
// Select "unselected" ap
|
||||
Station new_sta = stations->get(i);
|
||||
Station new_sta = station;
|
||||
new_sta.selected = true;
|
||||
stations->set(i, new_sta);
|
||||
count_selected += 1;
|
||||
@@ -1559,21 +1492,22 @@ void CommandLine::runCommand(String input) {
|
||||
// Mark Stations as selected
|
||||
for (int i = 0; i < sta_index.size(); i++) {
|
||||
int index = sta_index.get(i).toInt();
|
||||
Station station = stations->get(index);
|
||||
if (!this->inRange(stations->size(), index)) {
|
||||
Serial.print(F("Index not in range: "));
|
||||
Serial.println(index);
|
||||
continue;
|
||||
}
|
||||
if (stations->get(index).selected) {
|
||||
if (station.selected) {
|
||||
// Unselect "selected" ap
|
||||
Station new_sta = stations->get(index);
|
||||
Station new_sta = station;
|
||||
new_sta.selected = false;
|
||||
stations->set(index, new_sta);
|
||||
count_unselected += 1;
|
||||
}
|
||||
else {
|
||||
// Select "unselected" ap
|
||||
Station new_sta = stations->get(index);
|
||||
Station new_sta = station;
|
||||
new_sta.selected = true;
|
||||
stations->set(index, new_sta);
|
||||
count_selected += 1;
|
||||
@@ -1688,9 +1622,10 @@ void CommandLine::runCommand(String input) {
|
||||
|
||||
// Duplicate check
|
||||
for (int i = 0; i < access_points->size(); i++) {
|
||||
AccessPoint access_point = access_points->get(i);
|
||||
bool match = true;
|
||||
for (int x = 0; x < 6; x++) {
|
||||
if (mac[x] != access_points->get(i).bssid[x]) {
|
||||
if (mac[x] != access_point.bssid[x]) {
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
@@ -1699,7 +1634,7 @@ void CommandLine::runCommand(String input) {
|
||||
Serial.print(F("AP already exists at ["));
|
||||
Serial.print(i);
|
||||
Serial.print(F("]: "));
|
||||
Serial.println(access_points->get(i).essid);
|
||||
Serial.println(access_point.essid);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,6 @@ const char PROGMEM KARMA_CMD[] = "karma";
|
||||
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";
|
||||
const char PROGMEM SNIFF_BEACON_CMD[] = "sniffbeacon";
|
||||
@@ -143,7 +142,6 @@ const char PROGMEM HELP_KARMA_CMD[] = "karma -p <index>";
|
||||
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";
|
||||
const char PROGMEM HELP_SNIFF_BEACON_CMD[] = "sniffbeacon";
|
||||
|
||||
@@ -263,8 +263,6 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_WAR_DRIVE) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EVIL_PORTAL) ||
|
||||
(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_PING_SCAN) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ARP_SCAN) ||
|
||||
@@ -368,8 +366,6 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
(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_PING_SCAN) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ARP_SCAN) ||
|
||||
@@ -1771,21 +1767,11 @@ void MenuFunctions::RunSetup()
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_MULTISSID, TFT_ORANGE);
|
||||
});
|
||||
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->addNodes(&wifiSnifferMenu, "Scan AP/STA", TFTLIME, NULL, BEACON_SNIFF, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_AP_STA, 0x97e0);
|
||||
});
|
||||
/*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);
|
||||
});*/
|
||||
this->addNodes(&wifiSnifferMenu, "Fox Hunt", TFTCYAN, NULL, PACKET_MONITOR, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
|
||||
@@ -2277,8 +2277,6 @@ void WiFiScan::StartScan(uint8_t scan_mode, uint16_t color) {
|
||||
RunRawScan(scan_mode, color);
|
||||
else if (scan_mode == WIFI_SCAN_RAW_CAPTURE)
|
||||
RunRawScan(scan_mode, color);
|
||||
else if (scan_mode == WIFI_SCAN_TARGET_AP)
|
||||
RunAPScan(scan_mode, color);
|
||||
else if (scan_mode == WIFI_SCAN_AP_STA)
|
||||
RunAPScan(scan_mode, color);
|
||||
else if (scan_mode == WIFI_SCAN_PWN)
|
||||
@@ -2438,6 +2436,37 @@ void WiFiScan::setLEDMode(int mode) {
|
||||
}
|
||||
}
|
||||
|
||||
void WiFiScan::displayTargetFilter() {
|
||||
#ifdef HAS_SCREEN
|
||||
if (this->filterActive()) {
|
||||
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||
#ifdef HAS_MINI_SCREEN
|
||||
display_obj.tft.setTextSize(1);
|
||||
#else
|
||||
display_obj.tft.setTextSize(2);
|
||||
#endif
|
||||
|
||||
display_obj.showCenterText("Target Networks", (STATUS_BAR_WIDTH * 3) + (CHAR_WIDTH));
|
||||
display_obj.tft.setTextSize(1);
|
||||
display_obj.tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
for (int i = 0; i < access_points->size(); i++) {
|
||||
AccessPoint access_point = access_points->get(i);
|
||||
if (access_point.selected)
|
||||
display_obj.showCenterText(access_point.essid, display_obj.tft.getCursorY());
|
||||
}
|
||||
} else {
|
||||
display_obj.tft.setTextColor(TFT_RED, TFT_BLACK);
|
||||
#ifdef HAS_MINI_SCREEN
|
||||
display_obj.tft.setTextSize(1);
|
||||
#else
|
||||
display_obj.tft.setTextSize(2);
|
||||
#endif
|
||||
|
||||
display_obj.showCenterText("No Networks Selected", (STATUS_BAR_WIDTH * 3) + (CHAR_WIDTH));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void WiFiScan::startWiFiAttacks(uint8_t scan_mode, uint16_t color, String title_string) {
|
||||
// Common wifi attack configurations
|
||||
#ifdef HAS_SCREEN
|
||||
@@ -2452,6 +2481,10 @@ void WiFiScan::startWiFiAttacks(uint8_t scan_mode, uint16_t color, String title_
|
||||
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||
#endif
|
||||
|
||||
if (scan_mode == WIFI_ATTACK_DEAUTH) {
|
||||
this->displayTargetFilter();
|
||||
}
|
||||
|
||||
//wifi_ap_config_t ap_config;
|
||||
//ap_config.ssid_hidden = 1;
|
||||
|
||||
@@ -2557,8 +2590,6 @@ void WiFiScan::StopScan(uint8_t scan_mode) {
|
||||
(currentScanMode == WIFI_SCAN_RAW_CAPTURE) ||
|
||||
(currentScanMode == WIFI_SCAN_STATION) ||
|
||||
(currentScanMode == WIFI_SCAN_SIG_STREN) ||
|
||||
(currentScanMode == WIFI_SCAN_TARGET_AP) ||
|
||||
(currentScanMode == WIFI_SCAN_TARGET_AP_FULL) ||
|
||||
(currentScanMode == WIFI_SCAN_AP_STA) ||
|
||||
(currentScanMode == WIFI_PING_SCAN) ||
|
||||
(currentScanMode == WIFI_ARP_SCAN) ||
|
||||
@@ -9982,7 +10013,6 @@ void WiFiScan::main(uint32_t currentTime)
|
||||
if ((currentScanMode == WIFI_SCAN_PROBE) ||
|
||||
(currentScanMode == WIFI_SCAN_AP) ||
|
||||
(currentScanMode == WIFI_SCAN_STATION) ||
|
||||
(currentScanMode == WIFI_SCAN_TARGET_AP) ||
|
||||
(currentScanMode == WIFI_SCAN_AP_STA) ||
|
||||
(currentScanMode == WIFI_SCAN_PWN) ||
|
||||
(currentScanMode == WIFI_SCAN_PINESCAN) ||
|
||||
@@ -10385,7 +10415,7 @@ void WiFiScan::main(uint32_t currentTime)
|
||||
}
|
||||
}
|
||||
|
||||
if (currentTime - initTime >= 1000) {
|
||||
/*if (currentTime - initTime >= 1000) {
|
||||
initTime = millis();
|
||||
|
||||
char displayString[64]; // adjust size as needed
|
||||
@@ -10406,7 +10436,7 @@ void WiFiScan::main(uint32_t currentTime)
|
||||
#endif
|
||||
|
||||
packets_sent = 0;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
else if (currentScanMode == WIFI_ATTACK_DEAUTH_MANUAL) {
|
||||
|
||||
@@ -575,6 +575,7 @@ class WiFiScan
|
||||
NimBLEAdvertisementData GetUniversalAdvertisementData(EBLEPayloadType type);
|
||||
#endif
|
||||
|
||||
void displayTargetFilter();
|
||||
void displayTransmitRate();
|
||||
void prepareScanStage(uint16_t color_1, uint16_t color_2);
|
||||
void setLEDMode(int mode);
|
||||
|
||||
Reference in New Issue
Block a user