mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2026-07-31 08:00:34 -07:00
Merge pull request #908 from justcallmekoko/develop
Add new port scan presets and improve SD delete menu
This commit is contained in:
@@ -859,6 +859,11 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
(wifi_scan_obj.currentScanMode == WIFI_PORT_SCAN_ALL) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_SSH) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TELNET) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_DNS) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_SMTP) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_HTTP) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_HTTPS) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_RDP) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_PWN) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_PINESCAN) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_MULTISSID) ||
|
||||
@@ -947,6 +952,11 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
(wifi_scan_obj.currentScanMode == WIFI_PORT_SCAN_ALL) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_SSH) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TELNET) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_DNS) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_SMTP) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_HTTP) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_HTTPS) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_RDP) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_PWN) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_PINESCAN) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_MULTISSID) ||
|
||||
@@ -2150,6 +2160,31 @@ void MenuFunctions::RunSetup()
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_TELNET, TFT_CYAN);
|
||||
});
|
||||
this->addNodes(&wifiScannerMenu, "SMTP Scan", TFTWHITE, NULL, SCANNERS, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_SMTP, TFT_CYAN);
|
||||
});
|
||||
this->addNodes(&wifiScannerMenu, "DNS Scan", TFTLIME, NULL, SCANNERS, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_DNS, TFT_CYAN);
|
||||
});
|
||||
this->addNodes(&wifiScannerMenu, "HTTP Scan", TFTSKYBLUE, NULL, SCANNERS, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_HTTP, TFT_CYAN);
|
||||
});
|
||||
this->addNodes(&wifiScannerMenu, "HTTPS Scan", TFTYELLOW, NULL, SCANNERS, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_HTTPS, TFT_CYAN);
|
||||
});
|
||||
this->addNodes(&wifiScannerMenu, "RDP Scan", TFTPURPLE, NULL, SCANNERS, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_RDP, TFT_CYAN);
|
||||
});
|
||||
|
||||
// Build WiFi sniffer Menu
|
||||
wifiSnifferMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
|
||||
@@ -3108,7 +3143,7 @@ void MenuFunctions::RunSetup()
|
||||
|
||||
#ifdef HAS_SD
|
||||
if (sd_obj.supported) {
|
||||
this->addNodes(&deviceMenu, "Delete SD Files", TFTCYAN, NULL, SD_UPDATE, [this]() {
|
||||
/*this->addNodes(&deviceMenu, "Delete SD Files", TFTCYAN, NULL, SD_UPDATE, [this]() {
|
||||
#ifndef HAS_ILI9341
|
||||
#ifdef HAS_BUTTONS
|
||||
this->changeMenu(&sdDeleteMenu);
|
||||
@@ -3276,11 +3311,26 @@ void MenuFunctions::RunSetup()
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
});*/
|
||||
|
||||
sdDeleteMenu.parentMenu = &deviceMenu;
|
||||
|
||||
this->addNodes(&deviceMenu, "Delete SD Files", TFTCYAN, NULL, SD_UPDATE, [this]() {
|
||||
display_obj.clearScreen();
|
||||
display_obj.tft.setTextWrap(false);
|
||||
display_obj.tft.setCursor(0, SCREEN_HEIGHT / 3);
|
||||
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
|
||||
display_obj.tft.println("Loading...");
|
||||
|
||||
// Clear menu and lists
|
||||
this->buildSDFileMenu();
|
||||
|
||||
this->changeMenu(&sdDeleteMenu);
|
||||
});
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SD
|
||||
/*#ifdef HAS_SD
|
||||
//#ifndef HAS_ILI9341
|
||||
#ifdef HAS_BUTTONS
|
||||
sdDeleteMenu.parentMenu = &deviceMenu;
|
||||
@@ -3289,7 +3339,7 @@ void MenuFunctions::RunSetup()
|
||||
});
|
||||
#endif
|
||||
//#endif
|
||||
#endif
|
||||
#endif*/
|
||||
|
||||
// Save Files Menu
|
||||
saveFileMenu.parentMenu = &deviceMenu;
|
||||
@@ -3903,6 +3953,46 @@ void MenuFunctions::RunSetup()
|
||||
}
|
||||
//#endif
|
||||
|
||||
void MenuFunctions::setupSDFileList() {
|
||||
sd_obj.sd_files->clear();
|
||||
|
||||
delete sd_obj.sd_files;
|
||||
|
||||
sd_obj.sd_files = new LinkedList<String>();
|
||||
|
||||
sd_obj.listDirToLinkedList(sd_obj.sd_files);
|
||||
}
|
||||
|
||||
void MenuFunctions::buildSDFileMenu() {
|
||||
this->setupSDFileList();
|
||||
|
||||
sdDeleteMenu.list->clear();
|
||||
delete sdDeleteMenu.list;
|
||||
sdDeleteMenu.list = new LinkedList<MenuNode>();
|
||||
sdDeleteMenu.name = "SD Files";
|
||||
|
||||
this->addNodes(&sdDeleteMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
|
||||
this->changeMenu(sdDeleteMenu.parentMenu);
|
||||
});
|
||||
|
||||
for (int x = 0; x < sd_obj.sd_files->size(); x++) {
|
||||
this->addNodes(&sdDeleteMenu, sd_obj.sd_files->get(x), TFTCYAN, NULL, SD_UPDATE, [this, x]() {
|
||||
if (sd_obj.removeFile("/" + sd_obj.sd_files->get(x))) {
|
||||
Serial.println("Deleted /" + sd_obj.sd_files->get(x));
|
||||
display_obj.clearScreen();
|
||||
display_obj.tft.setTextWrap(false);
|
||||
display_obj.tft.setCursor(0, SCREEN_HEIGHT / 3);
|
||||
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
|
||||
display_obj.tft.println("Deleting /" + sd_obj.sd_files->get(x) + "...");
|
||||
//sd_obj.sd_files->remove(x);
|
||||
//sdDeleteMenu.list->remove(x + 1); // +1 for "Back"
|
||||
this->buildSDFileMenu();
|
||||
this->changeMenu(&sdDeleteMenu);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Function to show all MenuNodes in a Menu
|
||||
void MenuFunctions::showMenuList(Menu * menu, int layer)
|
||||
{
|
||||
|
||||
@@ -223,6 +223,8 @@ class MenuFunctions
|
||||
|
||||
// Menu icons
|
||||
|
||||
void setupSDFileList();
|
||||
void buildSDFileMenu();
|
||||
void displayMenuButtons();
|
||||
uint16_t getColor(uint16_t color);
|
||||
void drawAvgLine(int16_t value);
|
||||
|
||||
@@ -90,7 +90,7 @@ bool SDInterface::initSD() {
|
||||
|
||||
this->sd_files = new LinkedList<String>();
|
||||
|
||||
this->sd_files->add("Back");
|
||||
//this->sd_files->add("Back");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1016,6 +1016,16 @@ void WiFiScan::StartScan(uint8_t scan_mode, uint16_t color)
|
||||
RunPortScanAll(scan_mode, color);
|
||||
else if (scan_mode == WIFI_SCAN_TELNET)
|
||||
RunPortScanAll(scan_mode, color);
|
||||
else if (scan_mode == WIFI_SCAN_SMTP)
|
||||
RunPortScanAll(scan_mode, color);
|
||||
else if (scan_mode == WIFI_SCAN_DNS)
|
||||
RunPortScanAll(scan_mode, color);
|
||||
else if (scan_mode == WIFI_SCAN_HTTP)
|
||||
RunPortScanAll(scan_mode, color);
|
||||
else if (scan_mode == WIFI_SCAN_HTTPS)
|
||||
RunPortScanAll(scan_mode, color);
|
||||
else if (scan_mode == WIFI_SCAN_RDP)
|
||||
RunPortScanAll(scan_mode, color);
|
||||
|
||||
this->currentScanMode = scan_mode;
|
||||
}
|
||||
@@ -1189,6 +1199,11 @@ void WiFiScan::StopScan(uint8_t scan_mode)
|
||||
(currentScanMode == WIFI_PORT_SCAN_ALL) ||
|
||||
(currentScanMode == WIFI_SCAN_SSH) ||
|
||||
(currentScanMode == WIFI_SCAN_TELNET) ||
|
||||
(currentScanMode == WIFI_SCAN_SMTP) ||
|
||||
(currentScanMode == WIFI_SCAN_DNS) ||
|
||||
(currentScanMode == WIFI_SCAN_HTTP) ||
|
||||
(currentScanMode == WIFI_SCAN_HTTPS) ||
|
||||
(currentScanMode == WIFI_SCAN_RDP) ||
|
||||
(currentScanMode == WIFI_SCAN_PWN) ||
|
||||
(currentScanMode == WIFI_SCAN_PINESCAN) ||
|
||||
(currentScanMode == WIFI_SCAN_MULTISSID) ||
|
||||
@@ -1573,6 +1588,16 @@ void WiFiScan::RunPortScanAll(uint8_t scan_mode, uint16_t color)
|
||||
startLog("sshscan");
|
||||
else if (scan_mode == WIFI_SCAN_TELNET)
|
||||
startLog("telnetscan");
|
||||
else if (scan_mode == WIFI_SCAN_SMTP)
|
||||
startLog("smtp");
|
||||
else if (scan_mode == WIFI_SCAN_DNS)
|
||||
startLog("dns");
|
||||
else if (scan_mode == WIFI_SCAN_HTTP)
|
||||
startLog("http");
|
||||
else if (scan_mode == WIFI_SCAN_HTTPS)
|
||||
startLog("https");
|
||||
else if (scan_mode == WIFI_SCAN_RDP)
|
||||
startLog("rdp");
|
||||
else
|
||||
startLog("portscan");
|
||||
|
||||
@@ -1602,6 +1627,16 @@ void WiFiScan::RunPortScanAll(uint8_t scan_mode, uint16_t color)
|
||||
display_obj.tft.drawCentreString("SSH Scan",120,16,2);
|
||||
else if (scan_mode == WIFI_SCAN_TELNET)
|
||||
display_obj.tft.drawCentreString("Telnet Scan",120,16,2);
|
||||
else if (scan_mode == WIFI_SCAN_SMTP)
|
||||
display_obj.tft.drawCentreString("SMTP Scan",120,16,2);
|
||||
else if (scan_mode == WIFI_SCAN_DNS)
|
||||
display_obj.tft.drawCentreString("DNS Scan",120,16,2);
|
||||
else if (scan_mode == WIFI_SCAN_HTTP)
|
||||
display_obj.tft.drawCentreString("HTTP Scan",120,16,2);
|
||||
else if (scan_mode == WIFI_SCAN_HTTPS)
|
||||
display_obj.tft.drawCentreString("HTTPS Scan",120,16,2);
|
||||
else if (scan_mode == WIFI_SCAN_RDP)
|
||||
display_obj.tft.drawCentreString("RDP Scan",120,16,2);
|
||||
#endif
|
||||
#ifdef HAS_ILI9341
|
||||
display_obj.touchToExit();
|
||||
@@ -1612,7 +1647,12 @@ void WiFiScan::RunPortScanAll(uint8_t scan_mode, uint16_t color)
|
||||
|
||||
this->current_scan_port = 0;
|
||||
if ((scan_mode == WIFI_SCAN_SSH) ||
|
||||
(scan_mode == WIFI_SCAN_TELNET))
|
||||
(scan_mode == WIFI_SCAN_TELNET) ||
|
||||
(scan_mode == WIFI_SCAN_SMTP) ||
|
||||
(scan_mode == WIFI_SCAN_DNS) ||
|
||||
(scan_mode == WIFI_SCAN_HTTP) ||
|
||||
(scan_mode == WIFI_SCAN_HTTPS) ||
|
||||
(scan_mode == WIFI_SCAN_RDP))
|
||||
this->current_scan_ip = this->gateway;
|
||||
|
||||
Serial.println("Starting Port Scan with...");
|
||||
@@ -8141,8 +8181,45 @@ void WiFiScan::pingScan(uint8_t scan_mode) {
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
int targ_port = 0;
|
||||
if (scan_mode == WIFI_SCAN_SSH)
|
||||
targ_port = 22;
|
||||
else if (scan_mode == WIFI_SCAN_TELNET)
|
||||
targ_port = 23;
|
||||
else if (scan_mode == WIFI_SCAN_SMTP)
|
||||
targ_port = 25;
|
||||
else if (scan_mode == WIFI_SCAN_DNS)
|
||||
targ_port = 53;
|
||||
else if (scan_mode == WIFI_SCAN_HTTP)
|
||||
targ_port = 80;
|
||||
else if (scan_mode == WIFI_SCAN_HTTPS)
|
||||
targ_port = 443;
|
||||
else if (scan_mode == WIFI_SCAN_RDP)
|
||||
targ_port = 3389;
|
||||
|
||||
else if (scan_mode == WIFI_SCAN_SSH) {
|
||||
if (this->current_scan_ip != IPAddress(0, 0, 0, 0)) {
|
||||
this->current_scan_ip = getNextIP(this->current_scan_ip, this->subnet);
|
||||
#ifndef HAS_DUAL_BAND
|
||||
if (this->singleARP(this->current_scan_ip)) {
|
||||
#else
|
||||
if (this->isHostAlive(this->current_scan_ip)) {
|
||||
#endif
|
||||
Serial.println(this->current_scan_ip);
|
||||
this->portScan(scan_mode, targ_port);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!this->scan_complete) {
|
||||
this->scan_complete = true;
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.display_buffer->add("Scan complete");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*else if (scan_mode == WIFI_SCAN_SSH) {
|
||||
if (this->current_scan_ip != IPAddress(0, 0, 0, 0)) {
|
||||
this->current_scan_ip = getNextIP(this->current_scan_ip, this->subnet);
|
||||
#ifndef HAS_DUAL_BAND
|
||||
@@ -8184,7 +8261,7 @@ void WiFiScan::pingScan(uint8_t scan_mode) {
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
void WiFiScan::portScan(uint8_t scan_mode, uint16_t targ_port) {
|
||||
@@ -8279,6 +8356,21 @@ void WiFiScan::main(uint32_t currentTime)
|
||||
else if (currentScanMode == WIFI_SCAN_TELNET) {
|
||||
this->pingScan(WIFI_SCAN_TELNET);
|
||||
}
|
||||
else if (currentScanMode == WIFI_SCAN_SMTP) {
|
||||
this->pingScan(WIFI_SCAN_SMTP);
|
||||
}
|
||||
else if (currentScanMode == WIFI_SCAN_DNS) {
|
||||
this->pingScan(WIFI_SCAN_DNS);
|
||||
}
|
||||
else if (currentScanMode == WIFI_SCAN_HTTP) {
|
||||
this->pingScan(WIFI_SCAN_HTTP);
|
||||
}
|
||||
else if (currentScanMode == WIFI_SCAN_HTTPS) {
|
||||
this->pingScan(WIFI_SCAN_HTTPS);
|
||||
}
|
||||
else if (currentScanMode == WIFI_SCAN_RDP) {
|
||||
this->pingScan(WIFI_SCAN_RDP);
|
||||
}
|
||||
else if (currentScanMode == WIFI_SCAN_SIG_STREN) {
|
||||
#ifdef HAS_ILI9341
|
||||
this->signalAnalyzerLoop(currentTime);
|
||||
|
||||
@@ -130,6 +130,11 @@
|
||||
#define WIFI_ATTACK_SLEEP 61
|
||||
#define WIFI_ATTACK_SLEEP_TARGETED 62
|
||||
#define GPS_POI 63
|
||||
#define WIFI_SCAN_DNS 64
|
||||
#define WIFI_SCAN_HTTP 65
|
||||
#define WIFI_SCAN_HTTPS 66
|
||||
#define WIFI_SCAN_SMTP 67
|
||||
#define WIFI_SCAN_RDP 68
|
||||
|
||||
#define BASE_MULTIPLIER 4
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
//#define MARAUDER_CARDPUTER
|
||||
//// END BOARD TARGETS
|
||||
|
||||
#define MARAUDER_VERSION "v1.8.5"
|
||||
#define MARAUDER_VERSION "v1.8.6"
|
||||
|
||||
#define GRAPH_REFRESH 100
|
||||
|
||||
|
||||
Reference in New Issue
Block a user