Skip to content

Commit 6cfb0cf

Browse files
authored
Merge pull request #25 from eried/next
Update
2 parents 12d73a3 + 546aa06 commit 6cfb0cf

28 files changed

+2108
-1621
lines changed
1.5 KB
Binary file not shown.
17.5 KB
Binary file not shown.

docs/webinstaller/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ <h1>Mayhem for Flipper Zero -installer</h1>
6161

6262
<div class="changelog-box">
6363
Changelog<br><br>
64+
v0.13.5 2023-12-04<br>
65+
* Updated Marauder to latest version<br>
66+
* Updated Marauder companion to v0.6.5<br>
67+
<br>
6468
v0.13.4 2023-11-19<br>
6569
* Updated Marauder to latest version<br>
6670
<br>

esp32cam_marauder/CommandLine.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ const char PROGMEM SSID_CMD[] = "ssid";
8282
const char PROGMEM BT_SNIFF_CMD[] = "sniffbt";
8383
const char PROGMEM BT_SOUR_APPLE_CMD[] = "sourapple";
8484
const char PROGMEM BT_SWIFTPAIR_SPAM_CMD[] = "swiftpair";
85+
const char PROGMEM BT_SAMSUNG_SPAM_CMD[] = "samsungblespam";
8586
const char PROGMEM BT_SPAM_ALL_CMD[] = "btspamall";
8687
const char PROGMEM BT_WARDRIVE_CMD[] = "btwardrive";
8788
const char PROGMEM BT_SKIM_CMD[] = "sniffskim";
@@ -130,6 +131,7 @@ const char PROGMEM HELP_SSID_CMD_B[] = "ssid -r <index>";
130131
const char PROGMEM HELP_BT_SNIFF_CMD[] = "sniffbt";
131132
const char PROGMEM HELP_BT_SOUR_APPLE_CMD[] = "sourapple";
132133
const char PROGMEM HELP_BT_SWIFTPAIR_SPAM_CMD[] = "swiftpair";
134+
const char PROGMEM HELP_BT_SAMSUNG_SPAM_CMD[] = "samsungblespam";
133135
const char PROGMEM HELP_BT_SPAM_ALL_CMD[] = "btspamall";
134136
const char PROGMEM HELP_BT_WARDRIVE_CMD[] = "btwardrive [-c]";
135137
const char PROGMEM HELP_BT_SKIM_CMD[] = "sniffskim";

esp32cam_marauder/CommandLine.ino

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ void CommandLine::runCommand(String input) {
404404
Serial.println(HELP_BT_SNIFF_CMD);
405405
Serial.println(HELP_BT_SOUR_APPLE_CMD);
406406
Serial.println(HELP_BT_SWIFTPAIR_SPAM_CMD);
407+
Serial.println(HELP_BT_SAMSUNG_SPAM_CMD);
407408
Serial.println(HELP_BT_SPAM_ALL_CMD);
408409
#ifdef HAS_GPS
409410
Serial.println(HELP_BT_WARDRIVE_CMD);
@@ -677,6 +678,7 @@ void CommandLine::runCommand(String input) {
677678
if (html_sw != -1) {
678679
String target_html_name = cmd_args.get(html_sw + 1);
679680
evil_portal_obj.target_html_name = target_html_name;
681+
evil_portal_obj.using_serial_html = false;
680682
Serial.println("Set html file as " + evil_portal_obj.target_html_name);
681683
}
682684
//else {
@@ -693,8 +695,12 @@ void CommandLine::runCommand(String input) {
693695
else if (et_command == "sethtml") {
694696
String target_html_name = cmd_args.get(cmd_sw + 2);
695697
evil_portal_obj.target_html_name = target_html_name;
698+
evil_portal_obj.using_serial_html = false;
696699
Serial.println("Set html file as " + evil_portal_obj.target_html_name);
697700
}
701+
else if (et_command == "sethtmlstr") {
702+
evil_portal_obj.setHtmlFromSerial();
703+
}
698704
else if (et_command == "setap") {
699705

700706
}
@@ -989,6 +995,18 @@ void CommandLine::runCommand(String input) {
989995
Serial.println("Bluetooth not supported");
990996
#endif
991997
}
998+
else if (cmd_args.get(0) == BT_SAMSUNG_SPAM_CMD) {
999+
#ifdef HAS_BT
1000+
Serial.println("Starting Samsung Spam attack. Stop with " + (String)STOPSCAN_CMD);
1001+
#ifdef HAS_SCREEN
1002+
display_obj.clearScreen();
1003+
menu_function_obj.drawStatusBar();
1004+
#endif
1005+
wifi_scan_obj.StartScan(BT_ATTACK_SAMSUNG_SPAM, TFT_CYAN);
1006+
#else
1007+
Serial.println("Bluetooth not supported");
1008+
#endif
1009+
}
9921010
else if (cmd_args.get(0) == BT_SPAM_ALL_CMD) {
9931011
#ifdef HAS_BT
9941012
Serial.println("Starting BT Spam All attack. Stop with " + (String)STOPSCAN_CMD);

esp32cam_marauder/EvilPortal.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,26 @@
33
AsyncWebServer server(80);
44

55
EvilPortal::EvilPortal() {
6+
}
7+
8+
void EvilPortal::setup() {
69
this->runServer = false;
710
this->name_received = false;
811
this->password_received = false;
912
this->has_html = false;
1013
this->has_ap = false;
14+
15+
html_files = new LinkedList<String>();
16+
17+
html_files->add("Back");
18+
19+
#ifdef HAS_SD
20+
if (sd_obj.supported) {
21+
sd_obj.listDirToLinkedList(html_files, "/", "html");
22+
23+
Serial.println("Evil Portal Found " + (String)html_files->size() + " HTML files");
24+
}
25+
#endif
1126
}
1227

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

80+
void EvilPortal::setHtmlFromSerial() {
81+
Serial.println("Setting HTML from serial...");
82+
const char *htmlStr = Serial.readString().c_str();
83+
strncpy(index_html, htmlStr, strlen(htmlStr));
84+
this->has_html = true;
85+
this->using_serial_html = true;
86+
Serial.println("html set");
87+
}
88+
6589
bool EvilPortal::setHtml() {
90+
if (this->using_serial_html) {
91+
Serial.println("html previously set");
92+
return true;
93+
}
6694
Serial.println("Setting HTML...");
6795
#ifndef WRITE_PACKETS_SERIAL
6896
File html_file = sd_obj.getFile("/" + this->target_html_name);

esp32cam_marauder/EvilPortal.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,19 @@ class EvilPortal {
100100
EvilPortal();
101101

102102
String target_html_name = "index.html";
103+
uint8_t selected_html_index = 0;
104+
105+
bool using_serial_html;
106+
107+
LinkedList<String>* html_files;
103108

104109
String get_user_name();
105110
String get_password();
111+
void setup();
106112
void addLog(String log, int len);
107113
bool begin(LinkedList<ssid>* ssids, LinkedList<AccessPoint>* access_points);
108114
void main(uint8_t scan_mode);
115+
void setHtmlFromSerial();
109116

110117
};
111118

esp32cam_marauder/MenuFunctions.cpp

Lines changed: 162 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,86 @@ MenuFunctions::MenuFunctions()
222222
}
223223
}
224224
}
225+
226+
// GFX Function to build a list showing all EP HTML Files
227+
void MenuFunctions::selectEPHTMLGFX() {
228+
extern EvilPortal evil_portal_obj;
229+
230+
lv_obj_t * list1 = lv_list_create(lv_scr_act(), NULL);
231+
lv_obj_set_size(list1, 160, 200);
232+
lv_obj_set_width(list1, LV_HOR_RES);
233+
lv_obj_align(list1, NULL, LV_ALIGN_CENTER, 0, 0);
234+
235+
lv_obj_t * list_btn;
236+
237+
lv_obj_t * label;
238+
239+
list_btn = lv_list_add_btn(list1, LV_SYMBOL_CLOSE, text09);
240+
lv_obj_set_event_cb(list_btn, html_list_cb);
241+
242+
for (int i = 1; i < evil_portal_obj.html_files->size(); i++) {
243+
char buf[evil_portal_obj.html_files->get(i).length() + 1] = {};
244+
evil_portal_obj.html_files->get(i).toCharArray(buf, evil_portal_obj.html_files->get(i).length() + 1);
245+
246+
list_btn = lv_list_add_btn(list1, LV_SYMBOL_FILE, buf);
247+
lv_btn_set_checkable(list_btn, true);
248+
lv_obj_set_event_cb(list_btn, html_list_cb);
249+
250+
if (i == evil_portal_obj.selected_html_index)
251+
lv_btn_toggle(list_btn);
252+
}
253+
}
254+
255+
void html_list_cb(lv_obj_t * btn, lv_event_t event) {
256+
extern EvilPortal evil_portal_obj;
257+
extern MenuFunctions menu_function_obj;
258+
259+
String btn_text = lv_list_get_btn_text(btn);
260+
String display_string = "";
261+
262+
if (event == LV_EVENT_CLICKED) {
263+
if (btn_text != text09) {
264+
}
265+
else {
266+
Serial.println("Exiting...");
267+
lv_obj_del_async(lv_obj_get_parent(lv_obj_get_parent(btn)));
268+
269+
for (int i = 1; i < evil_portal_obj.html_files->size(); i++) {
270+
if (i == evil_portal_obj.selected_html_index) {
271+
Serial.println("Selected: " + (String)evil_portal_obj.html_files->get(i));
272+
}
273+
}
274+
275+
printf("LV_EVENT_CANCEL\n");
276+
menu_function_obj.deinitLVGL();
277+
wifi_scan_obj.StartScan(WIFI_SCAN_OFF);
278+
display_obj.exit_draw = true; // set everything back to normal
279+
}
280+
}
281+
282+
if (event == LV_EVENT_VALUE_CHANGED) {
283+
if (lv_btn_get_state(btn) == LV_BTN_STATE_CHECKED_RELEASED) {
284+
for (int i = 1; i < evil_portal_obj.html_files->size(); i++) {
285+
if (evil_portal_obj.html_files->get(i) == btn_text) {
286+
Serial.println("Setting HTML: " + (String)evil_portal_obj.html_files->get(i));
287+
evil_portal_obj.selected_html_index = i;
288+
evil_portal_obj.target_html_name = (String)evil_portal_obj.html_files->get(i);
289+
}
290+
}
291+
292+
// Deselect buttons that were previously selected
293+
lv_obj_t * list = lv_obj_get_parent(btn);
294+
295+
lv_obj_t * next_btn = lv_obj_get_child(list, NULL);
296+
while (next_btn != NULL) {
297+
if (next_btn != btn) {
298+
lv_btn_set_state(next_btn, LV_BTN_STATE_RELEASED);
299+
}
300+
next_btn = lv_obj_get_child(list, next_btn);
301+
}
302+
}
303+
}
304+
}
225305

226306
// GFX Function to build a list showing all APs scanned
227307
void MenuFunctions::addAPGFX(){
@@ -508,6 +588,7 @@ void MenuFunctions::main(uint32_t currentTime)
508588
(wifi_scan_obj.currentScanMode == BT_ATTACK_SOUR_APPLE) ||
509589
(wifi_scan_obj.currentScanMode == BT_ATTACK_SWIFTPAIR_SPAM) ||
510590
(wifi_scan_obj.currentScanMode == BT_ATTACK_SPAM_ALL) ||
591+
(wifi_scan_obj.currentScanMode == BT_ATTACK_SAMSUNG_SPAM) ||
511592
(wifi_scan_obj.currentScanMode == BT_SCAN_WAR_DRIVE) ||
512593
(wifi_scan_obj.currentScanMode == BT_SCAN_WAR_DRIVE_CONT) ||
513594
(wifi_scan_obj.currentScanMode == BT_SCAN_SKIMMERS))
@@ -567,6 +648,7 @@ void MenuFunctions::main(uint32_t currentTime)
567648
(wifi_scan_obj.currentScanMode == BT_ATTACK_SOUR_APPLE) ||
568649
(wifi_scan_obj.currentScanMode == BT_ATTACK_SWIFTPAIR_SPAM) ||
569650
(wifi_scan_obj.currentScanMode == BT_ATTACK_SPAM_ALL) ||
651+
(wifi_scan_obj.currentScanMode == BT_ATTACK_SAMSUNG_SPAM) ||
570652
(wifi_scan_obj.currentScanMode == BT_SCAN_WAR_DRIVE) ||
571653
(wifi_scan_obj.currentScanMode == BT_SCAN_WAR_DRIVE_CONT) ||
572654
(wifi_scan_obj.currentScanMode == BT_SCAN_SKIMMERS) ||
@@ -1083,7 +1165,6 @@ void MenuFunctions::displaySetting(String key, Menu* menu, int index) {
10831165

10841166
}
10851167

1086-
10871168
// Function to build the menus
10881169
void MenuFunctions::RunSetup()
10891170
{
@@ -1122,6 +1203,9 @@ void MenuFunctions::RunSetup()
11221203
wifiGeneralMenu.list = new LinkedList<MenuNode>();
11231204
wifiAPMenu.list = new LinkedList<MenuNode>();
11241205

1206+
// WiFi HTML menu stuff
1207+
htmlMenu.list = new LinkedList<MenuNode>();
1208+
11251209
// Bluetooth menu stuff
11261210
bluetoothSnifferMenu.list = new LinkedList<MenuNode>();
11271211
bluetoothAttackMenu.list = new LinkedList<MenuNode>();
@@ -1155,6 +1239,7 @@ void MenuFunctions::RunSetup()
11551239
#ifdef HAS_GPS
11561240
gpsInfoMenu.name = "GPS Data";
11571241
#endif
1242+
htmlMenu.name = "EP HTML List";
11581243

11591244
// Build Main Menu
11601245
mainMenu.parentMenu = NULL;
@@ -1361,7 +1446,72 @@ void MenuFunctions::RunSetup()
13611446
wifi_scan_obj.StartScan(LV_ADD_SSID, TFT_RED);
13621447
addStationGFX();
13631448
});
1449+
this->addNodes(&wifiGeneralMenu, "Select EP HTML File", TFT_CYAN, NULL, KEYBOARD_ICO, [this](){
1450+
display_obj.clearScreen();
1451+
wifi_scan_obj.currentScanMode = LV_ADD_SSID;
1452+
wifi_scan_obj.StartScan(LV_ADD_SSID, TFT_RED);
1453+
selectEPHTMLGFX();
1454+
});
13641455
#else
1456+
this->addNodes(&wifiGeneralMenu, "Select EP HTML File", TFT_CYAN, NULL, KEYBOARD_ICO, [this](){
1457+
this->changeMenu(&htmlMenu);
1458+
#ifdef HAS_BUTTONS
1459+
#if !(defined(MARAUDER_V6) || defined(MARAUDER_V6_1))
1460+
while(true) {
1461+
if (d_btn.justPressed()) {
1462+
if (evil_portal_obj.selected_html_index > 0)
1463+
evil_portal_obj.selected_html_index--;
1464+
else
1465+
evil_portal_obj.selected_html_index = evil_portal_obj.html_files->size() - 1;
1466+
1467+
//Serial.println("Setting button text as " + evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index));
1468+
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});
1469+
this->buildButtons(&htmlMenu);
1470+
this->displayCurrentMenu();
1471+
}
1472+
#ifndef MARAUDER_M5STICKC
1473+
if (u_btn.justPressed()) {
1474+
if (evil_portal_obj.selected_html_index < evil_portal_obj.html_files->size() - 1)
1475+
evil_portal_obj.selected_html_index++;
1476+
else
1477+
evil_portal_obj.selected_html_index = 0;
1478+
1479+
//Serial.println("Setting button text as " + evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index));
1480+
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});
1481+
this->buildButtons(&htmlMenu, 0, evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index));
1482+
this->displayCurrentMenu();
1483+
}
1484+
#endif
1485+
if (c_btn.justPressed()) {
1486+
if (evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index) != "Back") {
1487+
evil_portal_obj.target_html_name = evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index);
1488+
Serial.println("Set Evil Portal HTML as " + evil_portal_obj.target_html_name);
1489+
evil_portal_obj.using_serial_html = false;
1490+
}
1491+
this->changeMenu(htmlMenu.parentMenu);
1492+
break;
1493+
}
1494+
}
1495+
#endif
1496+
#endif
1497+
});
1498+
1499+
htmlMenu.parentMenu = &wifiGeneralMenu;
1500+
this->addNodes(&htmlMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
1501+
this->changeMenu(htmlMenu.parentMenu);
1502+
});
1503+
1504+
/*int loopLimit = min(evil_portal_obj.html_files->size(), BUTTON_ARRAY_LEN);
1505+
1506+
for (int i = 0; i < loopLimit - 1; i++) {
1507+
this->addNodes(&htmlMenu, evil_portal_obj.html_files->get(i), TFT_CYAN, NULL, 0, [this, i]() {
1508+
evil_portal_obj.target_html_name = (String)evil_portal_obj.html_files->get(i);
1509+
Serial.println("Set Evil Portal HTML as " + evil_portal_obj.target_html_name);
1510+
evil_portal_obj.using_serial_html = false;
1511+
this->changeMenu(htmlMenu.parentMenu);
1512+
});
1513+
}*/
1514+
13651515
// Select APs on Mini
13661516
this->addNodes(&wifiGeneralMenu, text_table1[56], TFT_NAVY, NULL, KEYBOARD_ICO, [this](){
13671517
wifiAPMenu.list->clear();
@@ -1475,6 +1625,11 @@ void MenuFunctions::RunSetup()
14751625
this->drawStatusBar();
14761626
wifi_scan_obj.StartScan(BT_ATTACK_SWIFTPAIR_SPAM, TFT_CYAN);
14771627
});
1628+
this->addNodes(&bluetoothAttackMenu, "Samsung BLE Spam", TFT_RED, NULL, GENERAL_APPS, [this]() {
1629+
display_obj.clearScreen();
1630+
this->drawStatusBar();
1631+
wifi_scan_obj.StartScan(BT_ATTACK_SAMSUNG_SPAM, TFT_RED);
1632+
});
14781633
this->addNodes(&bluetoothAttackMenu, "BLE Spam All", TFT_MAGENTA, NULL, DEAUTH_SNIFF, [this]() {
14791634
display_obj.clearScreen();
14801635
this->drawStatusBar();
@@ -1629,9 +1784,10 @@ void MenuFunctions::addNodes(Menu * menu, String name, uint16_t color, Menu * ch
16291784
{
16301785
TFT_eSPI_Button new_button;
16311786
menu->list->add(MenuNode{name, false, color, place, &new_button, selected, callable});
1787+
//menu->list->add(MenuNode{name, false, color, place, selected, callable});
16321788
}
16331789

1634-
void MenuFunctions::buildButtons(Menu * menu, int starting_index)
1790+
void MenuFunctions::buildButtons(Menu * menu, int starting_index, String button_name)
16351791
{
16361792
if (menu->list != NULL)
16371793
{
@@ -1640,7 +1796,10 @@ void MenuFunctions::buildButtons(Menu * menu, int starting_index)
16401796
{
16411797
TFT_eSPI_Button new_button;
16421798
char buf[menu->list->get(starting_index + i).name.length() + 1] = {};
1643-
menu->list->get(starting_index + i).name.toCharArray(buf, menu->list->get(starting_index + i).name.length() + 1);
1799+
if (button_name != "")
1800+
menu->list->get(starting_index + i).name.toCharArray(buf, menu->list->get(starting_index + i).name.length() + 1);
1801+
else
1802+
button_name.toCharArray(buf, button_name.length() + 1);
16441803
display_obj.key[i].initButton(&display_obj.tft,
16451804
KEY_X + 0 * (KEY_W + KEY_SPACING_X),
16461805
KEY_Y + i * (KEY_H + KEY_SPACING_Y), // x, y, w, h, outline, fill, text

0 commit comments

Comments
 (0)