wifi_marauder_app_i.h 4.6 KB

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