ソースを参照

Merge wifi_marauder_companion from https://github.com/0xchocolate/flipperzero-wifi-marauder

Willy-JL 2 年 前
コミット
35837e144e

+ 13 - 0
wifi_marauder_companion/.github/FUNDING.yml

@@ -0,0 +1,13 @@
+# These are supported funding model platforms
+
+github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
+patreon: # Replace with a single Patreon username
+open_collective: # Replace with a single Open Collective username
+ko_fi: cococode
+tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
+community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
+liberapay: # Replace with a single Liberapay username
+issuehunt: # Replace with a single IssueHunt username
+otechie: # Replace with a single Otechie username
+lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
+custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

+ 5 - 2
wifi_marauder_companion/ReadMe.md

@@ -24,9 +24,12 @@ From a local clone of this repo, you can also build the app yourself using ufbt.
 
 For app feedback, bugs, and feature requests, please [create an issue here](https://github.com/0xchocolate/flipperzero-firmware-with-wifi-marauder-companion/issues).
 
-You can find me (0xchocolate) on discord as @cococode#6011.
+You can find me (0xchocolate) on discord as @cococode.
+
+If you'd like to donate to the app development effort:
+
+[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/O4O1R7X6K)
 
-If you'd like to donate to the app development effort:  
 **ETH**: `0xf32A1F0CD6122C97d8953183E53cB889cc087C9b`  
 **BTC**: `bc1qtw7s25cwdkuaups22yna8sttfxn0usm2f35wc3`
 

+ 1 - 1
wifi_marauder_companion/application.fam

@@ -1,7 +1,7 @@
 App(
     appid="esp32_wifi_marauder",
     name="[ESP32] WiFi Marauder",
-    fap_version=(6, 4),
+    fap_version=(6, 5),
     apptype=FlipperAppType.EXTERNAL,
     entry_point="wifi_marauder_app",
     requires=["gui"],

+ 16 - 0
wifi_marauder_companion/scenes/wifi_marauder_scene_console_output.c

@@ -146,11 +146,27 @@ void wifi_marauder_scene_console_output_on_enter(void* context) {
             }
         }
 
+        bool send_html = false;
+        uint8_t* the_html = NULL;
+        size_t html_size = 0;
+        if(app->selected_tx_string && strncmp(
+                                          "evilportal -c sethtmlstr",
+                                          app->selected_tx_string,
+                                          strlen("evilportal -c sethtmlstr")) == 0) {
+            send_html = wifi_marauder_ep_read_html_file(app, &the_html, &html_size);
+        }
+
         // Send command with newline '\n'
         if(app->selected_tx_string) {
             wifi_marauder_uart_tx(
                 (uint8_t*)(app->selected_tx_string), strlen(app->selected_tx_string));
             wifi_marauder_uart_tx((uint8_t*)("\n"), 1);
+            if(send_html && the_html) {
+                wifi_marauder_uart_tx(the_html, html_size);
+                wifi_marauder_uart_tx((uint8_t*)("\n"), 1);
+                free(the_html);
+                send_html = false;
+            }
         }
 
         // Run the script if the file with the script has been opened

+ 7 - 0
wifi_marauder_companion/scenes/wifi_marauder_scene_start.c

@@ -82,6 +82,13 @@ const WifiMarauderItem items[NUM_MENU_ITEMS] = {
      TOGGLE_ARGS,
      FOCUS_CONSOLE_END,
      SHOW_STOPSCAN_TIP},
+    {"Load Evil Portal HTML file",
+     {""},
+     1,
+     {"evilportal -c sethtmlstr"},
+     NO_ARGS,
+     FOCUS_CONSOLE_END,
+     NO_TIP},
     {"Targeted Deauth",
      {"station", "manual"},
      2,

+ 1 - 1
wifi_marauder_companion/wifi_marauder_app.h

@@ -4,7 +4,7 @@
 extern "C" {
 #endif
 
-#define WIFI_MARAUDER_APP_VERSION "v0.6.4"
+#define WIFI_MARAUDER_APP_VERSION "v0.6.5"
 
 typedef struct WifiMarauderApp WifiMarauderApp;
 

+ 3 - 1
wifi_marauder_companion/wifi_marauder_app_i.h

@@ -6,6 +6,7 @@
 #include "scenes/wifi_marauder_scene.h"
 #include "wifi_marauder_custom_event.h"
 #include "wifi_marauder_uart.h"
+#include "wifi_marauder_ep.h"
 #include "file/sequential_file.h"
 #include "script/wifi_marauder_script.h"
 #include "script/wifi_marauder_script_worker.h"
@@ -28,13 +29,14 @@
 
 #include <assets_icons.h>
 
-#define NUM_MENU_ITEMS (23)
+#define NUM_MENU_ITEMS (24)
 
 #define WIFI_MARAUDER_TEXT_BOX_STORE_SIZE (4096)
 #define WIFI_MARAUDER_TEXT_INPUT_STORE_SIZE (512)
 
 #define MARAUDER_APP_FOLDER_USER "apps_data/marauder"
 #define MARAUDER_APP_FOLDER EXT_PATH(MARAUDER_APP_FOLDER_USER)
+#define MARAUDER_APP_FOLDER_HTML MARAUDER_APP_FOLDER "/html"
 #define MARAUDER_APP_FOLDER_PCAPS MARAUDER_APP_FOLDER "/pcaps"
 #define MARAUDER_APP_FOLDER_LOGS MARAUDER_APP_FOLDER "/logs"
 #define MARAUDER_APP_FOLDER_USER_PCAPS MARAUDER_APP_FOLDER_USER "/pcaps"

+ 44 - 0
wifi_marauder_companion/wifi_marauder_ep.c

@@ -0,0 +1,44 @@
+#include "wifi_marauder_ep.h"
+
+// returns success (if true, then caller needs to free(the_html))
+bool wifi_marauder_ep_read_html_file(WifiMarauderApp* app, uint8_t** the_html, size_t* html_size) {
+    // browse for files
+    FuriString* predefined_filepath = furi_string_alloc_set_str(MARAUDER_APP_FOLDER_HTML);
+    FuriString* selected_filepath = furi_string_alloc();
+    DialogsFileBrowserOptions browser_options;
+    dialog_file_browser_set_basic_options(&browser_options, ".html", &I_Text_10x10);
+    if(!dialog_file_browser_show(
+           app->dialogs, selected_filepath, predefined_filepath, &browser_options)) {
+        return false;
+    }
+
+    File* index_html = storage_file_alloc(app->storage);
+    if(!storage_file_open(
+           index_html, furi_string_get_cstr(selected_filepath), FSAM_READ, FSOM_OPEN_EXISTING)) {
+        dialog_message_show_storage_error(app->dialogs, "Cannot open file");
+        return false;
+    }
+
+    uint64_t size = storage_file_size(index_html);
+
+    *the_html = malloc(size); // to be freed by caller
+    uint8_t* buf_ptr = *the_html;
+    size_t read = 0;
+    while(read < size) {
+        size_t to_read = size - read;
+        if(to_read > UINT16_MAX) to_read = UINT16_MAX;
+        uint16_t now_read = storage_file_read(index_html, buf_ptr, (uint16_t)to_read);
+        read += now_read;
+        buf_ptr += now_read;
+    }
+
+    *html_size = read;
+
+    storage_file_close(index_html);
+    storage_file_free(index_html);
+
+    furi_string_free(selected_filepath);
+    furi_string_free(predefined_filepath);
+
+    return true;
+}

+ 6 - 0
wifi_marauder_companion/wifi_marauder_ep.h

@@ -0,0 +1,6 @@
+// evil portal helper
+#pragma once
+
+#include "wifi_marauder_app_i.h"
+
+bool wifi_marauder_ep_read_html_file(WifiMarauderApp* app, uint8_t** the_html, size_t* html_size);