From 87ebbc990142a729a04b4baaa6f3b2f0454d0ae5 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Sat, 20 May 2023 09:52:00 +0300 Subject: [PATCH] Update wifi marauder --- .../scenes/wifi_marauder_scene_config.h | 1 + .../wifi_marauder_scene_sniffpmkid_options.c | 117 ++++++++++++++++++ .../scenes/wifi_marauder_scene_start.c | 19 +-- .../wifi_marauder_app.h | 2 +- .../wifi_marauder_app_i.h | 2 +- .../wifi_marauder_custom_event.h | 3 +- 6 files changed, 134 insertions(+), 10 deletions(-) create mode 100644 applications/external/wifi_marauder_companion/scenes/wifi_marauder_scene_sniffpmkid_options.c diff --git a/applications/external/wifi_marauder_companion/scenes/wifi_marauder_scene_config.h b/applications/external/wifi_marauder_companion/scenes/wifi_marauder_scene_config.h index ae976c6bf..d223af79a 100644 --- a/applications/external/wifi_marauder_companion/scenes/wifi_marauder_scene_config.h +++ b/applications/external/wifi_marauder_companion/scenes/wifi_marauder_scene_config.h @@ -12,3 +12,4 @@ ADD_SCENE(wifi_marauder, script_confirm_delete, ScriptConfirmDelete) ADD_SCENE(wifi_marauder, script_stage_edit, ScriptStageEdit) ADD_SCENE(wifi_marauder, script_stage_add, ScriptStageAdd) ADD_SCENE(wifi_marauder, script_stage_edit_list, ScriptStageEditList) +ADD_SCENE(wifi_marauder, sniffpmkid_options, SniffPmkidOptions) diff --git a/applications/external/wifi_marauder_companion/scenes/wifi_marauder_scene_sniffpmkid_options.c b/applications/external/wifi_marauder_companion/scenes/wifi_marauder_scene_sniffpmkid_options.c new file mode 100644 index 000000000..02869030e --- /dev/null +++ b/applications/external/wifi_marauder_companion/scenes/wifi_marauder_scene_sniffpmkid_options.c @@ -0,0 +1,117 @@ +#include "../wifi_marauder_app_i.h" + +enum SubmenuIndex { + SubmenuIndexPassive, + SubmenuIndexActive, + SubmenuIndexTargetedPassive, + SubmenuIndexTargetedActive, + SubmenuIndexChannelPassive, + SubmenuIndexChannelActive, +}; + +static void wifi_marauder_scene_sniffpmkid_options_callback(void* context, uint32_t index) { + WifiMarauderApp* app = context; + + app->is_custom_tx_string = false; // this will be set if needed by text input + switch(index) { + case SubmenuIndexPassive: + app->selected_tx_string = "sniffpmkid"; + scene_manager_set_scene_state( + app->scene_manager, WifiMarauderSceneSniffPmkidOptions, index); + scene_manager_next_scene(app->scene_manager, WifiMarauderSceneConsoleOutput); + break; + case SubmenuIndexActive: + app->selected_tx_string = "sniffpmkid -d"; + scene_manager_set_scene_state( + app->scene_manager, WifiMarauderSceneSniffPmkidOptions, index); + scene_manager_next_scene(app->scene_manager, WifiMarauderSceneConsoleOutput); + break; + case SubmenuIndexTargetedPassive: + app->selected_tx_string = "sniffpmkid -l"; + scene_manager_set_scene_state( + app->scene_manager, WifiMarauderSceneSniffPmkidOptions, index); + scene_manager_next_scene(app->scene_manager, WifiMarauderSceneConsoleOutput); + break; + case SubmenuIndexTargetedActive: + app->selected_tx_string = "sniffpmkid -d -l"; + scene_manager_set_scene_state( + app->scene_manager, WifiMarauderSceneSniffPmkidOptions, index); + scene_manager_next_scene(app->scene_manager, WifiMarauderSceneConsoleOutput); + break; + case SubmenuIndexChannelPassive: + app->selected_tx_string = "sniffpmkid -c"; + scene_manager_set_scene_state( + app->scene_manager, WifiMarauderSceneSniffPmkidOptions, index); + scene_manager_next_scene(app->scene_manager, WifiMarauderSceneTextInput); + break; + case SubmenuIndexChannelActive: + app->selected_tx_string = "sniffpmkid -d -c"; + scene_manager_set_scene_state( + app->scene_manager, WifiMarauderSceneSniffPmkidOptions, index); + scene_manager_next_scene(app->scene_manager, WifiMarauderSceneTextInput); + break; + } +} + +void wifi_marauder_scene_sniffpmkid_options_on_enter(void* context) { + WifiMarauderApp* app = context; + + Submenu* submenu = app->submenu; + + submenu_set_header(submenu, "Sniff PMKID"); + submenu_add_item( + submenu, + "Passive", + SubmenuIndexPassive, + wifi_marauder_scene_sniffpmkid_options_callback, + app); + submenu_add_item( + submenu, + "Active (Force Deauth)", + SubmenuIndexActive, + wifi_marauder_scene_sniffpmkid_options_callback, + app); + submenu_add_item( + submenu, + "Targeted Passive (List)", + SubmenuIndexTargetedPassive, + wifi_marauder_scene_sniffpmkid_options_callback, + app); + submenu_add_item( + submenu, + "Targeted Active (List)", + SubmenuIndexTargetedActive, + wifi_marauder_scene_sniffpmkid_options_callback, + app); + submenu_add_item( + submenu, + "On Channel # - Passive", + SubmenuIndexChannelPassive, + wifi_marauder_scene_sniffpmkid_options_callback, + app); + submenu_add_item( + submenu, + "On Channel # - Active", + SubmenuIndexChannelActive, + wifi_marauder_scene_sniffpmkid_options_callback, + app); + + submenu_set_selected_item( + submenu, + scene_manager_get_scene_state(app->scene_manager, WifiMarauderSceneSniffPmkidOptions)); + view_dispatcher_switch_to_view(app->view_dispatcher, WifiMarauderAppViewSubmenu); +} + +bool wifi_marauder_scene_sniffpmkid_options_on_event(void* context, SceneManagerEvent event) { + //WifiMarauderApp* app = context; + UNUSED(context); + UNUSED(event); + bool consumed = false; + + return consumed; +} + +void wifi_marauder_scene_sniffpmkid_options_on_exit(void* context) { + WifiMarauderApp* app = context; + submenu_reset(app->submenu); +} diff --git a/applications/external/wifi_marauder_companion/scenes/wifi_marauder_scene_start.c b/applications/external/wifi_marauder_companion/scenes/wifi_marauder_scene_start.c index 6f22d0adb..28a3ed2a9 100644 --- a/applications/external/wifi_marauder_companion/scenes/wifi_marauder_scene_start.c +++ b/applications/external/wifi_marauder_companion/scenes/wifi_marauder_scene_start.c @@ -97,13 +97,6 @@ const WifiMarauderItem items[NUM_MENU_ITEMS] = { NO_ARGS, FOCUS_CONSOLE_END, SHOW_STOPSCAN_TIP}, - {"Sniff PMKID", - {"ap", "channel"}, - 2, - {"sniffpmkid -d -l", "sniffpmkid -c"}, - TOGGLE_ARGS, - FOCUS_CONSOLE_END, - SHOW_STOPSCAN_TIP}, {"Channel", {"get", "set"}, 2, @@ -161,6 +154,14 @@ static void wifi_marauder_scene_start_var_list_enter_callback(void* context, uin return; } + if(app->selected_tx_string && + strncmp("sniffpmkid", app->selected_tx_string, strlen("sniffpmkid")) == 0) { + // sniffpmkid submenu + view_dispatcher_send_custom_event( + app->view_dispatcher, WifiMarauderEventStartSniffPmkidOptions); + return; + } + // Select automation script if(index == NUM_MENU_ITEMS - 2) { view_dispatcher_send_custom_event( @@ -254,6 +255,10 @@ bool wifi_marauder_scene_start_on_event(void* context, SceneManagerEvent event) scene_manager_set_scene_state( app->scene_manager, WifiMarauderSceneStart, app->selected_menu_index); scene_manager_next_scene(app->scene_manager, WifiMarauderSceneScriptSelect); + } else if(event.event == WifiMarauderEventStartSniffPmkidOptions) { + scene_manager_set_scene_state( + app->scene_manager, WifiMarauderSceneStart, app->selected_menu_index); + scene_manager_next_scene(app->scene_manager, WifiMarauderSceneSniffPmkidOptions); } consumed = true; } else if(event.type == SceneManagerEventTypeTick) { diff --git a/applications/external/wifi_marauder_companion/wifi_marauder_app.h b/applications/external/wifi_marauder_companion/wifi_marauder_app.h index 303fb59b4..7e3856059 100644 --- a/applications/external/wifi_marauder_companion/wifi_marauder_app.h +++ b/applications/external/wifi_marauder_companion/wifi_marauder_app.h @@ -4,7 +4,7 @@ extern "C" { #endif -#define WIFI_MARAUDER_APP_VERSION "v0.3.5" +#define WIFI_MARAUDER_APP_VERSION "v0.3.6" typedef struct WifiMarauderApp WifiMarauderApp; diff --git a/applications/external/wifi_marauder_companion/wifi_marauder_app_i.h b/applications/external/wifi_marauder_companion/wifi_marauder_app_i.h index 2a16522bb..45e1e5920 100644 --- a/applications/external/wifi_marauder_companion/wifi_marauder_app_i.h +++ b/applications/external/wifi_marauder_companion/wifi_marauder_app_i.h @@ -26,7 +26,7 @@ #include #include -#define NUM_MENU_ITEMS (18) +#define NUM_MENU_ITEMS (17) #define WIFI_MARAUDER_TEXT_BOX_STORE_SIZE (4096) #define WIFI_MARAUDER_TEXT_INPUT_STORE_SIZE (512) diff --git a/applications/external/wifi_marauder_companion/wifi_marauder_custom_event.h b/applications/external/wifi_marauder_companion/wifi_marauder_custom_event.h index 5acdfa38e..b6d9f8274 100644 --- a/applications/external/wifi_marauder_companion/wifi_marauder_custom_event.h +++ b/applications/external/wifi_marauder_companion/wifi_marauder_custom_event.h @@ -8,5 +8,6 @@ typedef enum { WifiMarauderEventSaveDestinationMac, WifiMarauderEventStartSettingsInit, WifiMarauderEventStartLogViewer, - WifiMarauderEventStartScriptSelect + WifiMarauderEventStartScriptSelect, + WifiMarauderEventStartSniffPmkidOptions } WifiMarauderCustomEvent;