Skip to content

Commit

Permalink
Merge pull request #25 from eried/next
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
eried authored Dec 3, 2023
2 parents 12d73a3 + 546aa06 commit 6cfb0cf
Show file tree
Hide file tree
Showing 28 changed files with 2,108 additions and 1,621 deletions.
Binary file modified docs/webinstaller/build/esp32cam_marauder.ino.bin
Binary file not shown.
Binary file modified docs/webinstaller/build/esp32cam_marauder.ino.elf
Binary file not shown.
4 changes: 4 additions & 0 deletions docs/webinstaller/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ <h1>Mayhem for Flipper Zero -installer</h1>

<div class="changelog-box">
Changelog<br><br>
v0.13.5 2023-12-04<br>
* Updated Marauder to latest version<br>
* Updated Marauder companion to v0.6.5<br>
<br>
v0.13.4 2023-11-19<br>
* Updated Marauder to latest version<br>
<br>
Expand Down
2 changes: 2 additions & 0 deletions esp32cam_marauder/CommandLine.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const char PROGMEM SSID_CMD[] = "ssid";
const char PROGMEM BT_SNIFF_CMD[] = "sniffbt";
const char PROGMEM BT_SOUR_APPLE_CMD[] = "sourapple";
const char PROGMEM BT_SWIFTPAIR_SPAM_CMD[] = "swiftpair";
const char PROGMEM BT_SAMSUNG_SPAM_CMD[] = "samsungblespam";
const char PROGMEM BT_SPAM_ALL_CMD[] = "btspamall";
const char PROGMEM BT_WARDRIVE_CMD[] = "btwardrive";
const char PROGMEM BT_SKIM_CMD[] = "sniffskim";
Expand Down Expand Up @@ -130,6 +131,7 @@ const char PROGMEM HELP_SSID_CMD_B[] = "ssid -r <index>";
const char PROGMEM HELP_BT_SNIFF_CMD[] = "sniffbt";
const char PROGMEM HELP_BT_SOUR_APPLE_CMD[] = "sourapple";
const char PROGMEM HELP_BT_SWIFTPAIR_SPAM_CMD[] = "swiftpair";
const char PROGMEM HELP_BT_SAMSUNG_SPAM_CMD[] = "samsungblespam";
const char PROGMEM HELP_BT_SPAM_ALL_CMD[] = "btspamall";
const char PROGMEM HELP_BT_WARDRIVE_CMD[] = "btwardrive [-c]";
const char PROGMEM HELP_BT_SKIM_CMD[] = "sniffskim";
Expand Down
18 changes: 18 additions & 0 deletions esp32cam_marauder/CommandLine.ino
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ void CommandLine::runCommand(String input) {
Serial.println(HELP_BT_SNIFF_CMD);
Serial.println(HELP_BT_SOUR_APPLE_CMD);
Serial.println(HELP_BT_SWIFTPAIR_SPAM_CMD);
Serial.println(HELP_BT_SAMSUNG_SPAM_CMD);
Serial.println(HELP_BT_SPAM_ALL_CMD);
#ifdef HAS_GPS
Serial.println(HELP_BT_WARDRIVE_CMD);
Expand Down Expand Up @@ -677,6 +678,7 @@ void CommandLine::runCommand(String input) {
if (html_sw != -1) {
String target_html_name = cmd_args.get(html_sw + 1);
evil_portal_obj.target_html_name = target_html_name;
evil_portal_obj.using_serial_html = false;
Serial.println("Set html file as " + evil_portal_obj.target_html_name);
}
//else {
Expand All @@ -693,8 +695,12 @@ void CommandLine::runCommand(String input) {
else if (et_command == "sethtml") {
String target_html_name = cmd_args.get(cmd_sw + 2);
evil_portal_obj.target_html_name = target_html_name;
evil_portal_obj.using_serial_html = false;
Serial.println("Set html file as " + evil_portal_obj.target_html_name);
}
else if (et_command == "sethtmlstr") {
evil_portal_obj.setHtmlFromSerial();
}
else if (et_command == "setap") {

}
Expand Down Expand Up @@ -989,6 +995,18 @@ void CommandLine::runCommand(String input) {
Serial.println("Bluetooth not supported");
#endif
}
else if (cmd_args.get(0) == BT_SAMSUNG_SPAM_CMD) {
#ifdef HAS_BT
Serial.println("Starting Samsung Spam attack. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(BT_ATTACK_SAMSUNG_SPAM, TFT_CYAN);
#else
Serial.println("Bluetooth not supported");
#endif
}
else if (cmd_args.get(0) == BT_SPAM_ALL_CMD) {
#ifdef HAS_BT
Serial.println("Starting BT Spam All attack. Stop with " + (String)STOPSCAN_CMD);
Expand Down
28 changes: 28 additions & 0 deletions esp32cam_marauder/EvilPortal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,26 @@
AsyncWebServer server(80);

EvilPortal::EvilPortal() {
}

void EvilPortal::setup() {
this->runServer = false;
this->name_received = false;
this->password_received = false;
this->has_html = false;
this->has_ap = false;

html_files = new LinkedList<String>();

html_files->add("Back");

#ifdef HAS_SD
if (sd_obj.supported) {
sd_obj.listDirToLinkedList(html_files, "/", "html");

Serial.println("Evil Portal Found " + (String)html_files->size() + " HTML files");
}
#endif
}

bool EvilPortal::begin(LinkedList<ssid>* ssids, LinkedList<AccessPoint>* access_points) {
Expand Down Expand Up @@ -62,7 +77,20 @@ void EvilPortal::setupServer() {
Serial.println("web server up");
}

void EvilPortal::setHtmlFromSerial() {
Serial.println("Setting HTML from serial...");
const char *htmlStr = Serial.readString().c_str();
strncpy(index_html, htmlStr, strlen(htmlStr));
this->has_html = true;
this->using_serial_html = true;
Serial.println("html set");
}

bool EvilPortal::setHtml() {
if (this->using_serial_html) {
Serial.println("html previously set");
return true;
}
Serial.println("Setting HTML...");
#ifndef WRITE_PACKETS_SERIAL
File html_file = sd_obj.getFile("/" + this->target_html_name);
Expand Down
7 changes: 7 additions & 0 deletions esp32cam_marauder/EvilPortal.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,19 @@ class EvilPortal {
EvilPortal();

String target_html_name = "index.html";
uint8_t selected_html_index = 0;

bool using_serial_html;

LinkedList<String>* html_files;

String get_user_name();
String get_password();
void setup();
void addLog(String log, int len);
bool begin(LinkedList<ssid>* ssids, LinkedList<AccessPoint>* access_points);
void main(uint8_t scan_mode);
void setHtmlFromSerial();

};

Expand Down
165 changes: 162 additions & 3 deletions esp32cam_marauder/MenuFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,86 @@ MenuFunctions::MenuFunctions()
}
}
}

// GFX Function to build a list showing all EP HTML Files
void MenuFunctions::selectEPHTMLGFX() {
extern EvilPortal evil_portal_obj;

lv_obj_t * list1 = lv_list_create(lv_scr_act(), NULL);
lv_obj_set_size(list1, 160, 200);
lv_obj_set_width(list1, LV_HOR_RES);
lv_obj_align(list1, NULL, LV_ALIGN_CENTER, 0, 0);

lv_obj_t * list_btn;

lv_obj_t * label;

list_btn = lv_list_add_btn(list1, LV_SYMBOL_CLOSE, text09);
lv_obj_set_event_cb(list_btn, html_list_cb);

for (int i = 1; i < evil_portal_obj.html_files->size(); i++) {
char buf[evil_portal_obj.html_files->get(i).length() + 1] = {};
evil_portal_obj.html_files->get(i).toCharArray(buf, evil_portal_obj.html_files->get(i).length() + 1);

list_btn = lv_list_add_btn(list1, LV_SYMBOL_FILE, buf);
lv_btn_set_checkable(list_btn, true);
lv_obj_set_event_cb(list_btn, html_list_cb);

if (i == evil_portal_obj.selected_html_index)
lv_btn_toggle(list_btn);
}
}

void html_list_cb(lv_obj_t * btn, lv_event_t event) {
extern EvilPortal evil_portal_obj;
extern MenuFunctions menu_function_obj;

String btn_text = lv_list_get_btn_text(btn);
String display_string = "";

if (event == LV_EVENT_CLICKED) {
if (btn_text != text09) {
}
else {
Serial.println("Exiting...");
lv_obj_del_async(lv_obj_get_parent(lv_obj_get_parent(btn)));

for (int i = 1; i < evil_portal_obj.html_files->size(); i++) {
if (i == evil_portal_obj.selected_html_index) {
Serial.println("Selected: " + (String)evil_portal_obj.html_files->get(i));
}
}

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
}
}

if (event == LV_EVENT_VALUE_CHANGED) {
if (lv_btn_get_state(btn) == LV_BTN_STATE_CHECKED_RELEASED) {
for (int i = 1; i < evil_portal_obj.html_files->size(); i++) {
if (evil_portal_obj.html_files->get(i) == btn_text) {
Serial.println("Setting HTML: " + (String)evil_portal_obj.html_files->get(i));
evil_portal_obj.selected_html_index = i;
evil_portal_obj.target_html_name = (String)evil_portal_obj.html_files->get(i);
}
}

// Deselect buttons that were previously selected
lv_obj_t * list = lv_obj_get_parent(btn);

lv_obj_t * next_btn = lv_obj_get_child(list, NULL);
while (next_btn != NULL) {
if (next_btn != btn) {
lv_btn_set_state(next_btn, LV_BTN_STATE_RELEASED);
}
next_btn = lv_obj_get_child(list, next_btn);
}
}
}
}

// GFX Function to build a list showing all APs scanned
void MenuFunctions::addAPGFX(){
Expand Down Expand Up @@ -508,6 +588,7 @@ void MenuFunctions::main(uint32_t currentTime)
(wifi_scan_obj.currentScanMode == BT_ATTACK_SOUR_APPLE) ||
(wifi_scan_obj.currentScanMode == BT_ATTACK_SWIFTPAIR_SPAM) ||
(wifi_scan_obj.currentScanMode == BT_ATTACK_SPAM_ALL) ||
(wifi_scan_obj.currentScanMode == BT_ATTACK_SAMSUNG_SPAM) ||
(wifi_scan_obj.currentScanMode == BT_SCAN_WAR_DRIVE) ||
(wifi_scan_obj.currentScanMode == BT_SCAN_WAR_DRIVE_CONT) ||
(wifi_scan_obj.currentScanMode == BT_SCAN_SKIMMERS))
Expand Down Expand Up @@ -567,6 +648,7 @@ void MenuFunctions::main(uint32_t currentTime)
(wifi_scan_obj.currentScanMode == BT_ATTACK_SOUR_APPLE) ||
(wifi_scan_obj.currentScanMode == BT_ATTACK_SWIFTPAIR_SPAM) ||
(wifi_scan_obj.currentScanMode == BT_ATTACK_SPAM_ALL) ||
(wifi_scan_obj.currentScanMode == BT_ATTACK_SAMSUNG_SPAM) ||
(wifi_scan_obj.currentScanMode == BT_SCAN_WAR_DRIVE) ||
(wifi_scan_obj.currentScanMode == BT_SCAN_WAR_DRIVE_CONT) ||
(wifi_scan_obj.currentScanMode == BT_SCAN_SKIMMERS) ||
Expand Down Expand Up @@ -1083,7 +1165,6 @@ void MenuFunctions::displaySetting(String key, Menu* menu, int index) {

}


// Function to build the menus
void MenuFunctions::RunSetup()
{
Expand Down Expand Up @@ -1122,6 +1203,9 @@ void MenuFunctions::RunSetup()
wifiGeneralMenu.list = new LinkedList<MenuNode>();
wifiAPMenu.list = new LinkedList<MenuNode>();

// WiFi HTML menu stuff
htmlMenu.list = new LinkedList<MenuNode>();

// Bluetooth menu stuff
bluetoothSnifferMenu.list = new LinkedList<MenuNode>();
bluetoothAttackMenu.list = new LinkedList<MenuNode>();
Expand Down Expand Up @@ -1155,6 +1239,7 @@ void MenuFunctions::RunSetup()
#ifdef HAS_GPS
gpsInfoMenu.name = "GPS Data";
#endif
htmlMenu.name = "EP HTML List";

// Build Main Menu
mainMenu.parentMenu = NULL;
Expand Down Expand Up @@ -1361,7 +1446,72 @@ void MenuFunctions::RunSetup()
wifi_scan_obj.StartScan(LV_ADD_SSID, TFT_RED);
addStationGFX();
});
this->addNodes(&wifiGeneralMenu, "Select EP HTML File", TFT_CYAN, NULL, KEYBOARD_ICO, [this](){
display_obj.clearScreen();
wifi_scan_obj.currentScanMode = LV_ADD_SSID;
wifi_scan_obj.StartScan(LV_ADD_SSID, TFT_RED);
selectEPHTMLGFX();
});
#else
this->addNodes(&wifiGeneralMenu, "Select EP HTML File", TFT_CYAN, NULL, KEYBOARD_ICO, [this](){
this->changeMenu(&htmlMenu);
#ifdef HAS_BUTTONS
#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;

//Serial.println("Setting button text as " + evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index));
this->htmlMenu.list->set(0, MenuNode{evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index), false, TFT_CYAN, 0, NULL, true, NULL});
this->buildButtons(&htmlMenu);
this->displayCurrentMenu();
}
#ifndef MARAUDER_M5STICKC
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;

//Serial.println("Setting button text as " + evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index));
this->htmlMenu.list->set(0, MenuNode{evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index), false, TFT_CYAN, 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
});

htmlMenu.parentMenu = &wifiGeneralMenu;
this->addNodes(&htmlMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
this->changeMenu(htmlMenu.parentMenu);
});

/*int loopLimit = min(evil_portal_obj.html_files->size(), BUTTON_ARRAY_LEN);
for (int i = 0; i < loopLimit - 1; i++) {
this->addNodes(&htmlMenu, evil_portal_obj.html_files->get(i), TFT_CYAN, NULL, 0, [this, i]() {
evil_portal_obj.target_html_name = (String)evil_portal_obj.html_files->get(i);
Serial.println("Set Evil Portal HTML as " + evil_portal_obj.target_html_name);
evil_portal_obj.using_serial_html = false;
this->changeMenu(htmlMenu.parentMenu);
});
}*/

// Select APs on Mini
this->addNodes(&wifiGeneralMenu, text_table1[56], TFT_NAVY, NULL, KEYBOARD_ICO, [this](){
wifiAPMenu.list->clear();
Expand Down Expand Up @@ -1475,6 +1625,11 @@ void MenuFunctions::RunSetup()
this->drawStatusBar();
wifi_scan_obj.StartScan(BT_ATTACK_SWIFTPAIR_SPAM, TFT_CYAN);
});
this->addNodes(&bluetoothAttackMenu, "Samsung BLE Spam", TFT_RED, NULL, GENERAL_APPS, [this]() {
display_obj.clearScreen();
this->drawStatusBar();
wifi_scan_obj.StartScan(BT_ATTACK_SAMSUNG_SPAM, TFT_RED);
});
this->addNodes(&bluetoothAttackMenu, "BLE Spam All", TFT_MAGENTA, NULL, DEAUTH_SNIFF, [this]() {
display_obj.clearScreen();
this->drawStatusBar();
Expand Down Expand Up @@ -1629,9 +1784,10 @@ void MenuFunctions::addNodes(Menu * menu, String name, uint16_t color, Menu * ch
{
TFT_eSPI_Button new_button;
menu->list->add(MenuNode{name, false, color, place, &new_button, selected, callable});
//menu->list->add(MenuNode{name, false, color, place, selected, callable});
}

void MenuFunctions::buildButtons(Menu * menu, int starting_index)
void MenuFunctions::buildButtons(Menu * menu, int starting_index, String button_name)
{
if (menu->list != NULL)
{
Expand All @@ -1640,7 +1796,10 @@ void MenuFunctions::buildButtons(Menu * menu, int starting_index)
{
TFT_eSPI_Button new_button;
char buf[menu->list->get(starting_index + i).name.length() + 1] = {};
menu->list->get(starting_index + i).name.toCharArray(buf, menu->list->get(starting_index + i).name.length() + 1);
if (button_name != "")
menu->list->get(starting_index + i).name.toCharArray(buf, menu->list->get(starting_index + i).name.length() + 1);
else
button_name.toCharArray(buf, button_name.length() + 1);
display_obj.key[i].initButton(&display_obj.tft,
KEY_X + 0 * (KEY_W + KEY_SPACING_X),
KEY_Y + i * (KEY_H + KEY_SPACING_Y), // x, y, w, h, outline, fill, text
Expand Down
Loading

0 comments on commit 6cfb0cf

Please sign in to comment.