wifi_marauder_app_i.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. //** Includes sniffbt and sniffskim for compatible ESP32-WROOM hardware.
  2. // wifi_marauder_scene_start.c also changed **//
  3. #pragma once
  4. #include "wifi_marauder_app.h"
  5. #include "scenes/wifi_marauder_scene.h"
  6. #include "wifi_marauder_custom_event.h"
  7. #include "wifi_marauder_uart.h"
  8. #include "wifi_marauder_ep.h"
  9. #include "file/sequential_file.h"
  10. #include "script/wifi_marauder_script.h"
  11. #include "script/wifi_marauder_script_worker.h"
  12. #include "script/wifi_marauder_script_executor.h"
  13. #include "script/menu/wifi_marauder_script_stage_menu.h"
  14. #include <gui/gui.h>
  15. #include <gui/view_dispatcher.h>
  16. #include <gui/scene_manager.h>
  17. #include <gui/modules/text_box.h>
  18. #include <gui/modules/submenu.h>
  19. #include <gui/modules/variable_item_list.h>
  20. #include <gui/modules/widget.h>
  21. #include <gui/modules/text_input.h>
  22. #include <mayhem_marauder_icons.h>
  23. #include <storage/storage.h>
  24. #include <lib/toolbox/path.h>
  25. #include <dialogs/dialogs.h>
  26. #define NUM_MENU_ITEMS (24)
  27. #define WIFI_MARAUDER_TEXT_BOX_STORE_SIZE (4096)
  28. #define WIFI_MARAUDER_TEXT_INPUT_STORE_SIZE (512)
  29. #define MARAUDER_APP_FOLDER_USER "apps_data/marauder"
  30. #define MARAUDER_APP_FOLDER EXT_PATH(MARAUDER_APP_FOLDER_USER)
  31. #define MARAUDER_APP_FOLDER_HTML MARAUDER_APP_FOLDER "/html"
  32. #define MARAUDER_APP_FOLDER_PCAPS MARAUDER_APP_FOLDER "/pcaps"
  33. #define MARAUDER_APP_FOLDER_DUMPS MARAUDER_APP_FOLDER "/dumps"
  34. #define MARAUDER_APP_FOLDER_LOGS MARAUDER_APP_FOLDER "/logs"
  35. #define MARAUDER_APP_FOLDER_USER_PCAPS MARAUDER_APP_FOLDER_USER "/pcaps"
  36. #define MARAUDER_APP_FOLDER_USER_LOGS MARAUDER_APP_FOLDER_USER "/logs"
  37. #define MARAUDER_APP_FOLDER_SCRIPTS MARAUDER_APP_FOLDER "/scripts"
  38. #define MARAUDER_APP_SCRIPT_PATH(file_name) MARAUDER_APP_FOLDER_SCRIPTS "/" file_name ".json"
  39. #define SAVE_PCAP_SETTING_FILEPATH MARAUDER_APP_FOLDER "/save_pcaps_here.setting"
  40. #define SAVE_LOGS_SETTING_FILEPATH MARAUDER_APP_FOLDER "/save_logs_here.setting"
  41. typedef enum WifiMarauderUserInputType {
  42. WifiMarauderUserInputTypeString,
  43. WifiMarauderUserInputTypeNumber,
  44. WifiMarauderUserInputTypeFileName
  45. } WifiMarauderUserInputType;
  46. struct WifiMarauderApp {
  47. Gui* gui;
  48. ViewDispatcher* view_dispatcher;
  49. SceneManager* scene_manager;
  50. char text_input_store[WIFI_MARAUDER_TEXT_INPUT_STORE_SIZE + 1];
  51. FuriString* text_box_store;
  52. size_t text_box_store_strlen;
  53. TextBox* text_box;
  54. TextInput* text_input;
  55. Storage* storage;
  56. File* capture_file;
  57. File* log_file;
  58. char log_file_path[100];
  59. File* save_pcap_setting_file;
  60. File* save_logs_setting_file;
  61. bool need_to_prompt_settings_init;
  62. int which_prompt;
  63. bool ok_to_save_pcaps;
  64. bool ok_to_save_logs;
  65. bool has_saved_logs_this_session;
  66. DialogsApp* dialogs;
  67. VariableItemList* var_item_list;
  68. Widget* widget;
  69. Submenu* submenu;
  70. int open_log_file_page;
  71. int open_log_file_num_pages;
  72. WifiMarauderUart* uart;
  73. int selected_menu_index;
  74. int selected_option_index[NUM_MENU_ITEMS];
  75. const char* selected_tx_string;
  76. bool is_command;
  77. bool is_custom_tx_string;
  78. bool focus_console_start;
  79. bool show_stopscan_tip;
  80. bool is_writing_pcap;
  81. bool is_writing_log;
  82. // User input
  83. WifiMarauderUserInputType user_input_type;
  84. char** user_input_string_reference;
  85. int* user_input_number_reference;
  86. char* user_input_file_dir;
  87. char* user_input_file_extension;
  88. // Automation script
  89. WifiMarauderScript* script;
  90. WifiMarauderScriptWorker* script_worker;
  91. FuriString** script_list;
  92. int script_list_count;
  93. WifiMarauderScriptStage* script_edit_selected_stage;
  94. WifiMarauderScriptStageMenu* script_stage_menu;
  95. WifiMarauderScriptStageListItem* script_stage_edit_first_item;
  96. char*** script_stage_edit_strings_reference;
  97. int* script_stage_edit_string_count_reference;
  98. int** script_stage_edit_numbers_reference;
  99. int* script_stage_edit_number_count_reference;
  100. // For input source and destination MAC in targeted deauth attack
  101. int special_case_input_step;
  102. char special_case_input_src_addr[20];
  103. char special_case_input_dst_addr[20];
  104. };
  105. // Supported commands:
  106. // https://github.com/justcallmekoko/ESP32Marauder/wiki/cli
  107. // Scan
  108. // -> If list is empty, then start a new scanap. (Tap any button to stop.)
  109. // -> If there's a list, provide option to rescan and dump list of targets to select.
  110. // -> Press BACK to go back to top-level.
  111. // Attack
  112. // -> Beacon
  113. // -> Deauth
  114. // -> Probe
  115. // -> Rickroll
  116. // Sniff
  117. // -> Beacon
  118. // -> Deauth
  119. // -> ESP
  120. // -> PMKID
  121. // -> Pwnagotchi
  122. // Channel
  123. // Update
  124. // Reboot
  125. typedef enum {
  126. WifiMarauderAppViewVarItemList,
  127. WifiMarauderAppViewConsoleOutput,
  128. WifiMarauderAppViewTextInput,
  129. WifiMarauderAppViewWidget,
  130. WifiMarauderAppViewSubmenu,
  131. } WifiMarauderAppView;