From a7fc43d1acb43f7c2a8dd850257ca85cbc3610f9 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Mon, 26 Dec 2022 23:12:45 +0300 Subject: [PATCH] Update wifi marauder --- .../wifi_marauder_scene_console_output.c | 2 +- .../scenes/wifi_marauder_scene_start.c | 44 ++++++++-- .../scenes/wifi_marauder_scene_text_input.c | 88 ++++++++++++++++++- .../wifi_marauder_app.c | 2 + .../wifi_marauder_app_i.h | 7 +- .../wifi_marauder_custom_event.h | 2 + 6 files changed, 131 insertions(+), 14 deletions(-) diff --git a/applications/plugins/wifi_marauder_companion/scenes/wifi_marauder_scene_console_output.c b/applications/plugins/wifi_marauder_companion/scenes/wifi_marauder_scene_console_output.c index 25ea0abb0..8b9984dbf 100644 --- a/applications/plugins/wifi_marauder_companion/scenes/wifi_marauder_scene_console_output.c +++ b/applications/plugins/wifi_marauder_companion/scenes/wifi_marauder_scene_console_output.c @@ -34,7 +34,7 @@ void wifi_marauder_scene_console_output_on_enter(void* context) { app->text_box_store_strlen = 0; if(0 == strncmp("help", app->selected_tx_string, strlen("help"))) { const char* help_msg = - "Marauder companion v0.2.2\nFor app support/feedback,\nreach out to me:\n@cococode#6011 (discord)\n0xchocolate (github)\n"; + "Marauder companion v0.3.0\nFor app support/feedback,\nreach out to me:\n@cococode#6011 (discord)\n0xchocolate (github)\n"; furi_string_cat_str(app->text_box_store, help_msg); app->text_box_store_strlen += strlen(help_msg); } diff --git a/applications/plugins/wifi_marauder_companion/scenes/wifi_marauder_scene_start.c b/applications/plugins/wifi_marauder_companion/scenes/wifi_marauder_scene_start.c index 029614c5d..df759bd15 100644 --- a/applications/plugins/wifi_marauder_companion/scenes/wifi_marauder_scene_start.c +++ b/applications/plugins/wifi_marauder_companion/scenes/wifi_marauder_scene_start.c @@ -26,7 +26,13 @@ typedef struct { // NUM_MENU_ITEMS defined in wifi_marauder_app_i.h - if you add an entry here, increment it! const WifiMarauderItem items[NUM_MENU_ITEMS] = { {"View Log from", {"start", "end"}, 2, {"", ""}, NO_ARGS, FOCUS_CONSOLE_TOGGLE, NO_TIP}, - {"Scan AP", {""}, 1, {"scanap"}, NO_ARGS, FOCUS_CONSOLE_END, SHOW_STOPSCAN_TIP}, + {"Scan", + {"ap", "station"}, + 2, + {"scanap", "scansta"}, + NO_ARGS, + FOCUS_CONSOLE_END, + SHOW_STOPSCAN_TIP}, {"SSID", {"add rand", "add name", "remove"}, 3, @@ -34,12 +40,24 @@ const WifiMarauderItem items[NUM_MENU_ITEMS] = { INPUT_ARGS, FOCUS_CONSOLE_START, NO_TIP}, - {"List", {"ap", "ssid"}, 2, {"list -a", "list -s"}, NO_ARGS, FOCUS_CONSOLE_START, NO_TIP}, - {"Select", {"ap", "ssid"}, 2, {"select -a", "select -s"}, INPUT_ARGS, FOCUS_CONSOLE_END, NO_TIP}, + {"List", + {"ap", "ssid", "station"}, + 3, + {"list -a", "list -s", "list -c"}, + NO_ARGS, + FOCUS_CONSOLE_START, + NO_TIP}, + {"Select", + {"ap", "ssid", "station"}, + 3, + {"select -a", "select -s", "select -c"}, + INPUT_ARGS, + FOCUS_CONSOLE_END, + NO_TIP}, {"Clear List", - {"ap", "ssid"}, - 2, - {"clearlist -a", "clearlist -s"}, + {"ap", "ssid", "station"}, + 3, + {"clearlist -a", "clearlist -s", "clearlist -c"}, NO_ARGS, FOCUS_CONSOLE_END, NO_TIP}, @@ -50,6 +68,13 @@ const WifiMarauderItem items[NUM_MENU_ITEMS] = { NO_ARGS, FOCUS_CONSOLE_END, SHOW_STOPSCAN_TIP}, + {"Targeted Deauth", + {"station", "manual"}, + 2, + {"attack -t deauth -c", "attack -t deauth -s"}, + TOGGLE_ARGS, + FOCUS_CONSOLE_END, + SHOW_STOPSCAN_TIP}, {"Beacon Spam", {"ap list", "ssid list", "random"}, 3, @@ -87,18 +112,19 @@ const WifiMarauderItem items[NUM_MENU_ITEMS] = { FOCUS_CONSOLE_END, NO_TIP}, {"Settings", - {"display", "restore", "ForcePMKID", "ForceProbe", "SavePCAP", "other"}, - 6, + {"display", "restore", "ForcePMKID", "ForceProbe", "SavePCAP", "EnableLED", "other"}, + 7, {"settings", "settings -r", "settings -s ForcePMKID enable", "settings -s ForceProbe enable", "settings -s SavePCAP enable", + "settings -s EnableLED enable", "settings -s"}, TOGGLE_ARGS, FOCUS_CONSOLE_START, NO_TIP}, - {"Update", {""}, 1, {"update -w"}, NO_ARGS, FOCUS_CONSOLE_END, NO_TIP}, + {"Update", {"ota", "sd"}, 2, {"update -w", "update -s"}, NO_ARGS, FOCUS_CONSOLE_END, NO_TIP}, {"Reboot", {""}, 1, {"reboot"}, NO_ARGS, FOCUS_CONSOLE_END, NO_TIP}, {"Help", {""}, 1, {"help"}, NO_ARGS, FOCUS_CONSOLE_START, SHOW_STOPSCAN_TIP}, }; diff --git a/applications/plugins/wifi_marauder_companion/scenes/wifi_marauder_scene_text_input.c b/applications/plugins/wifi_marauder_companion/scenes/wifi_marauder_scene_text_input.c index 061e9c5fe..ac8b15a2d 100644 --- a/applications/plugins/wifi_marauder_companion/scenes/wifi_marauder_scene_text_input.c +++ b/applications/plugins/wifi_marauder_companion/scenes/wifi_marauder_scene_text_input.c @@ -3,13 +3,34 @@ void wifi_marauder_scene_text_input_callback(void* context) { WifiMarauderApp* app = context; - view_dispatcher_send_custom_event(app->view_dispatcher, WifiMarauderEventStartConsole); + switch(app->special_case_input_step) { + case 0: // most commands + view_dispatcher_send_custom_event(app->view_dispatcher, WifiMarauderEventStartConsole); + break; + case 1: // special case for deauth: save source MAC + view_dispatcher_send_custom_event(app->view_dispatcher, WifiMarauderEventSaveSourceMac); + break; + case 2: // special case for deauth: save destination MAC + view_dispatcher_send_custom_event( + app->view_dispatcher, WifiMarauderEventSaveDestinationMac); + break; + default: + break; + } } void wifi_marauder_scene_text_input_on_enter(void* context) { WifiMarauderApp* app = context; - if(false == app->is_custom_tx_string) { + if(0 == + strncmp("attack -t deauth -s", app->selected_tx_string, strlen("attack -t deauth -s"))) { + // Special case for manual deauth input + app->special_case_input_step = 1; + bzero(app->text_input_store, WIFI_MARAUDER_TEXT_INPUT_STORE_SIZE); + } else if(false == app->is_custom_tx_string) { + // Most commands + app->special_case_input_step = 0; + // Fill text input with selected string so that user can add to it size_t length = strlen(app->selected_tx_string); furi_assert(length < WIFI_MARAUDER_TEXT_INPUT_STORE_SIZE); @@ -25,7 +46,9 @@ void wifi_marauder_scene_text_input_on_enter(void* context) { // Setup view TextInput* text_input = app->text_input; // Add help message to header - if(0 == strncmp("ssid -a -g", app->selected_tx_string, strlen("ssid -a -g"))) { + if(app->special_case_input_step == 1) { + text_input_set_header_text(text_input, "Enter source MAC"); + } else if(0 == strncmp("ssid -a -g", app->selected_tx_string, strlen("ssid -a -g"))) { text_input_set_header_text(text_input, "Enter # SSIDs to generate"); } else if(0 == strncmp("ssid -a -n", app->selected_tx_string, strlen("ssid -a -n"))) { text_input_set_header_text(text_input, "Enter SSID name to add"); @@ -59,6 +82,65 @@ bool wifi_marauder_scene_text_input_on_event(void* context, SceneManagerEvent ev app->selected_tx_string = app->text_input_store; scene_manager_next_scene(app->scene_manager, WifiMarauderAppViewConsoleOutput); consumed = true; + } else if(event.event == WifiMarauderEventSaveSourceMac) { + if(12 != strlen(app->text_input_store)) { + text_input_set_header_text(app->text_input, "MAC must be 12 hex chars!"); + } else { + snprintf( + app->special_case_input_src_addr, + sizeof(app->special_case_input_src_addr), + "%c%c:%c%c:%c%c:%c%c:%c%c:%c%c", + app->text_input_store[0], + app->text_input_store[1], + app->text_input_store[2], + app->text_input_store[3], + app->text_input_store[4], + app->text_input_store[5], + app->text_input_store[6], + app->text_input_store[7], + app->text_input_store[8], + app->text_input_store[9], + app->text_input_store[10], + app->text_input_store[11]); + + // Advance scene to input destination MAC, clear text input + app->special_case_input_step = 2; + bzero(app->text_input_store, WIFI_MARAUDER_TEXT_INPUT_STORE_SIZE); + text_input_set_header_text(app->text_input, "Enter destination MAC"); + } + consumed = true; + } else if(event.event == WifiMarauderEventSaveDestinationMac) { + if(12 != strlen(app->text_input_store)) { + text_input_set_header_text(app->text_input, "MAC must be 12 hex chars!"); + } else { + snprintf( + app->special_case_input_dst_addr, + sizeof(app->special_case_input_dst_addr), + "%c%c:%c%c:%c%c:%c%c:%c%c:%c%c", + app->text_input_store[0], + app->text_input_store[1], + app->text_input_store[2], + app->text_input_store[3], + app->text_input_store[4], + app->text_input_store[5], + app->text_input_store[6], + app->text_input_store[7], + app->text_input_store[8], + app->text_input_store[9], + app->text_input_store[10], + app->text_input_store[11]); + + // Construct command with source and destination MACs + snprintf( + app->text_input_store, + WIFI_MARAUDER_TEXT_INPUT_STORE_SIZE, + "attack -t deauth -s %18s -d %18s", + app->special_case_input_src_addr, + app->special_case_input_dst_addr); + app->selected_tx_string = app->text_input_store; + scene_manager_next_scene(app->scene_manager, WifiMarauderAppViewConsoleOutput); + } + consumed = true; } } diff --git a/applications/plugins/wifi_marauder_companion/wifi_marauder_app.c b/applications/plugins/wifi_marauder_companion/wifi_marauder_app.c index 705473759..1deb4e6f2 100644 --- a/applications/plugins/wifi_marauder_companion/wifi_marauder_app.c +++ b/applications/plugins/wifi_marauder_companion/wifi_marauder_app.c @@ -50,6 +50,8 @@ WifiMarauderApp* wifi_marauder_app_alloc() { app->selected_option_index[i] = 0; } + app->special_case_input_step = 0; + app->text_box = text_box_alloc(); view_dispatcher_add_view( app->view_dispatcher, WifiMarauderAppViewConsoleOutput, text_box_get_view(app->text_box)); diff --git a/applications/plugins/wifi_marauder_companion/wifi_marauder_app_i.h b/applications/plugins/wifi_marauder_companion/wifi_marauder_app_i.h index f571a11a2..4df9e326b 100644 --- a/applications/plugins/wifi_marauder_companion/wifi_marauder_app_i.h +++ b/applications/plugins/wifi_marauder_companion/wifi_marauder_app_i.h @@ -14,7 +14,7 @@ #include #include -#define NUM_MENU_ITEMS (15) +#define NUM_MENU_ITEMS (16) #define WIFI_MARAUDER_TEXT_BOX_STORE_SIZE (4096) #define WIFI_MARAUDER_TEXT_INPUT_STORE_SIZE (512) @@ -41,6 +41,11 @@ struct WifiMarauderApp { bool is_custom_tx_string; bool focus_console_start; bool show_stopscan_tip; + + // For input source and destination MAC in targeted deauth attack + int special_case_input_step; + char special_case_input_src_addr[20]; + char special_case_input_dst_addr[20]; }; // Supported commands: diff --git a/applications/plugins/wifi_marauder_companion/wifi_marauder_custom_event.h b/applications/plugins/wifi_marauder_companion/wifi_marauder_custom_event.h index fe1bff6af..990b457f5 100644 --- a/applications/plugins/wifi_marauder_companion/wifi_marauder_custom_event.h +++ b/applications/plugins/wifi_marauder_companion/wifi_marauder_custom_event.h @@ -4,4 +4,6 @@ typedef enum { WifiMarauderEventRefreshConsoleOutput = 0, WifiMarauderEventStartConsole, WifiMarauderEventStartKeyboard, + WifiMarauderEventSaveSourceMac, + WifiMarauderEventSaveDestinationMac } WifiMarauderCustomEvent;