wifi_marauder_app_i.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. #include <assets_icons.h>
  27. #define NUM_MENU_ITEMS (22)
  28. #define WIFI_MARAUDER_TEXT_BOX_STORE_SIZE (4096)
  29. #define WIFI_MARAUDER_TEXT_INPUT_STORE_SIZE (512)
  30. #define MARAUDER_APP_FOLDER_USER "apps_data/marauder"
  31. #define MARAUDER_APP_FOLDER EXT_PATH(MARAUDER_APP_FOLDER_USER)
  32. #define MARAUDER_APP_FOLDER_HTML MARAUDER_APP_FOLDER "/html"
  33. #define MARAUDER_APP_FOLDER_PCAPS MARAUDER_APP_FOLDER "/pcaps"
  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. WifiMarauderUart* lp_uart;
  74. int selected_menu_index;
  75. int selected_option_index[NUM_MENU_ITEMS];
  76. const char* selected_tx_string;
  77. bool is_command;
  78. bool is_custom_tx_string;
  79. bool focus_console_start;
  80. bool show_stopscan_tip;
  81. bool is_writing_pcap;
  82. bool is_writing_log;
  83. // User input
  84. WifiMarauderUserInputType user_input_type;
  85. char** user_input_string_reference;
  86. int* user_input_number_reference;
  87. char* user_input_file_dir;
  88. char* user_input_file_extension;
  89. // Automation script
  90. WifiMarauderScript* script;
  91. WifiMarauderScriptWorker* script_worker;
  92. FuriString** script_list;
  93. int script_list_count;
  94. WifiMarauderScriptStage* script_edit_selected_stage;
  95. WifiMarauderScriptStageMenu* script_stage_menu;
  96. WifiMarauderScriptStageListItem* script_stage_edit_first_item;
  97. char*** script_stage_edit_strings_reference;
  98. int* script_stage_edit_string_count_reference;
  99. int** script_stage_edit_numbers_reference;
  100. int* script_stage_edit_number_count_reference;
  101. // For input source and destination MAC in targeted deauth attack
  102. int special_case_input_step;
  103. char special_case_input_src_addr[20];
  104. char special_case_input_dst_addr[20];
  105. };
  106. // Supported commands:
  107. // https://github.com/justcallmekoko/ESP32Marauder/wiki/cli
  108. // Scan
  109. // -> If list is empty, then start a new scanap. (Tap any button to stop.)
  110. // -> If there's a list, provide option to rescan and dump list of targets to select.
  111. // -> Press BACK to go back to top-level.
  112. // Attack
  113. // -> Beacon
  114. // -> Deauth
  115. // -> Probe
  116. // -> Rickroll
  117. // Sniff
  118. // -> Beacon
  119. // -> Deauth
  120. // -> ESP
  121. // -> PMKID
  122. // -> Pwnagotchi
  123. // Channel
  124. // Update
  125. // Reboot
  126. typedef enum {
  127. WifiMarauderAppViewVarItemList,
  128. WifiMarauderAppViewConsoleOutput,
  129. WifiMarauderAppViewTextInput,
  130. WifiMarauderAppViewWidget,
  131. WifiMarauderAppViewSubmenu,
  132. } WifiMarauderAppView;