Pārlūkot izejas kodu

Merge pull request #48 from o7-machinehum/dev

Flipper Blackhat App
WillyJL 9 mēneši atpakaļ
vecāks
revīzija
6f9be32223

+ 10 - 0
flipper_blackhat/.clang-format

@@ -0,0 +1,10 @@
+BasedOnStyle: Google
+IndentWidth: 4
+TabWidth: 4
+UseTab: Never
+BreakBeforeBraces: Linux
+ColumnLimit: 80
+AlignAfterOpenBracket: BlockIndent
+BracedInitializerIndentWidth: 4
+BinPackParameters: false
+BinPackArguments: false

+ 3 - 0
flipper_blackhat/.gitignore

@@ -0,0 +1,3 @@
+dist/
+cscope.out
+.vscode

+ 1 - 0
flipper_blackhat/.gitsubtree

@@ -0,0 +1 @@
+https://github.com/o7-machinehum/flipper-blackhat-app master /

+ 14 - 0
flipper_blackhat/application.fam

@@ -0,0 +1,14 @@
+App(
+    appid="blackhat",
+    name="[A33] Flipper Blackhat",
+    apptype=FlipperAppType.EXTERNAL,
+    entry_point="blackhat_app",
+    cdefines=["APP_BLACKHAT"],
+    requires=["gui"],
+    stack_size=1 * 1024,
+    order=90,
+    fap_author="machinehum",
+    fap_description="Control of the flipper blackhat device",
+    fap_icon="icons/blackhat_10px.png",
+    fap_category="GPIO",
+)

+ 154 - 0
flipper_blackhat/blackhat_app.c

@@ -0,0 +1,154 @@
+#include <expansion/expansion.h>
+#include <furi.h>
+#include <furi_hal.h>
+
+#include "blackhat_app_i.h"
+
+static bool blackhat_app_custom_event_callback(void* context, uint32_t event)
+{
+    furi_assert(context);
+    BlackhatApp* app = context;
+    return scene_manager_handle_custom_event(app->scene_manager, event);
+}
+
+static bool blackhat_app_back_event_callback(void* context)
+{
+    furi_assert(context);
+    BlackhatApp* app = context;
+    return scene_manager_handle_back_event(app->scene_manager);
+}
+
+static void blackhat_app_tick_event_callback(void* context)
+{
+    furi_assert(context);
+    BlackhatApp* app = context;
+    scene_manager_handle_tick_event(app->scene_manager);
+}
+
+BlackhatApp* blackhat_app_alloc()
+{
+    BlackhatApp* app = malloc(sizeof(BlackhatApp));
+
+    app->dialogs = furi_record_open(RECORD_DIALOGS);
+
+    app->gui = furi_record_open(RECORD_GUI);
+
+    app->view_dispatcher = view_dispatcher_alloc();
+
+    app->scene_manager = scene_manager_alloc(&blackhat_scene_handlers, app);
+
+    view_dispatcher_set_event_callback_context(app->view_dispatcher, app);
+
+    view_dispatcher_set_custom_event_callback(
+        app->view_dispatcher, blackhat_app_custom_event_callback
+    );
+    view_dispatcher_set_navigation_event_callback(
+        app->view_dispatcher, blackhat_app_back_event_callback
+    );
+    view_dispatcher_set_tick_event_callback(
+        app->view_dispatcher, blackhat_app_tick_event_callback, 100
+    );
+
+    view_dispatcher_attach_to_gui(
+        app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen
+    );
+
+    app->var_item_list = variable_item_list_alloc();
+    view_dispatcher_add_view(
+        app->view_dispatcher,
+        BlackhatAppViewVarItemList,
+        variable_item_list_get_view(app->var_item_list)
+    );
+
+    app->text_input = text_input_alloc();
+    view_dispatcher_add_view(
+        app->view_dispatcher,
+        BlackhatAppViewTextInput,
+        text_input_get_view(app->text_input)
+    );
+
+    for (int i = 0; i < NUM_MENU_ITEMS; ++i) {
+        app->selected_option_index[i] = 0;
+    }
+
+    app->text_box = text_box_alloc();
+    view_dispatcher_add_view(
+        app->view_dispatcher,
+        BlackhatAppViewConsoleOutput,
+        text_box_get_view(app->text_box)
+    );
+    app->text_box_store = furi_string_alloc();
+    furi_string_reserve(app->text_box_store, BLACKHAT_TEXT_BOX_STORE_SIZE);
+
+    scene_manager_next_scene(app->scene_manager, BlackhatSceneStart);
+
+    return app;
+}
+
+void blackhat_app_free(BlackhatApp* app)
+{
+    furi_assert(app);
+
+    // Views
+    view_dispatcher_remove_view(
+        app->view_dispatcher, BlackhatAppViewVarItemList
+    );
+    variable_item_list_free(app->var_item_list);
+    view_dispatcher_remove_view(app->view_dispatcher, BlackhatAppViewTextInput);
+    text_input_free(app->text_input);
+    view_dispatcher_remove_view(
+        app->view_dispatcher, BlackhatAppViewConsoleOutput
+    );
+    text_box_free(app->text_box);
+    furi_string_free(app->text_box_store);
+
+    // View dispatcher
+    view_dispatcher_free(app->view_dispatcher);
+    scene_manager_free(app->scene_manager);
+
+    blackhat_uart_free(app->uart);
+
+    // Close records
+    furi_record_close(RECORD_GUI);
+
+    furi_record_close(RECORD_DIALOGS);
+
+    free(app);
+}
+
+int32_t blackhat_app(void* p)
+{
+    UNUSED(p);
+
+    // Disable expansion protocol to avoid interference with UART Handle
+    Expansion* expansion = furi_record_open(RECORD_EXPANSION);
+    expansion_disable(expansion);
+
+    BlackhatApp* blackhat_app = blackhat_app_alloc();
+
+    bool otg_was_enabled = furi_hal_power_is_otg_enabled();
+    // turn off 5v, so it gets reset on startup
+    if (otg_was_enabled) {
+        furi_hal_power_disable_otg();
+    }
+    uint8_t attempts = 0;
+    while (!furi_hal_power_is_otg_enabled() && attempts++ < 5) {
+        furi_hal_power_enable_otg();
+        furi_delay_ms(10);
+    }
+    furi_delay_ms(200);
+
+    blackhat_app->uart = blackhat_uart_init(blackhat_app);
+    view_dispatcher_run(blackhat_app->view_dispatcher);
+    blackhat_app_free(blackhat_app);
+
+    if (furi_hal_power_is_otg_enabled() && !otg_was_enabled) {
+        furi_hal_power_disable_otg();
+    }
+
+    // Return previous state of expansion
+    expansion_enable(expansion);
+    furi_record_close(RECORD_EXPANSION);
+
+    return 0;
+}

+ 11 - 0
flipper_blackhat/blackhat_app.h

@@ -0,0 +1,11 @@
+#pragma once
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct BlackhatApp BlackhatApp;
+
+#ifdef __cplusplus
+}
+#endif

+ 89 - 0
flipper_blackhat/blackhat_app_i.h

@@ -0,0 +1,89 @@
+#pragma once
+
+#include <dialogs/dialogs.h>
+#include <gui/gui.h>
+#include <gui/modules/loading.h>
+#include <gui/modules/text_box.h>
+#include <gui/modules/text_input.h>
+#include <gui/modules/variable_item_list.h>
+#include <gui/scene_manager.h>
+#include <gui/view_dispatcher.h>
+#include <gui/view_stack.h>
+
+#include "blackhat_app.h"
+#include "blackhat_custom_event.h"
+#include "blackhat_uart.h"
+#include "scenes/blackhat_scene.h"
+
+#define NUM_MENU_ITEMS (16)
+
+#define BLACKHAT_TEXT_BOX_STORE_SIZE (4096)
+#define UART_CH FuriHalSerialIdUsart
+
+#define SHELL_CMD "whoami"
+#define WIFI_CON_CMD "bh wifi connect"
+#define SET_INET_SSID_CMD "bh set SSID"
+#define SET_INET_PWD_CMD "bh set PASS"
+#define SET_AP_SSID_CMD "bh set AP_SSID"
+#define LIST_AP_CMD "bh wifi list"
+#define DEV_CMD "bh wifi dev"
+#define START_AP_CMD "bh wifi ap"
+#define START_KISMET_CMD "bh kismet"
+#define GET_IP_CMD "bh wifi ip"
+#define START_SSH_CMD "bh ssh"
+#define ST_EVIL_TWIN_CMD "bh evil_twin"
+#define ST_EVIL_PORT_CMD "bh evil_portal"
+#define ST_RAT_CMD "bh rat_driver"
+#define GET_CMD "bh get"
+#define REBOOT_CMD "reboot"
+#define HELP_CMD "cat /mnt/help.txt"
+
+typedef enum { NO_ARGS = 0, INPUT_ARGS, TOGGLE_ARGS } InputArgs;
+
+typedef enum {
+    FOCUS_CONSOLE_END = 0,
+    FOCUS_CONSOLE_START,
+    FOCUS_CONSOLE_TOGGLE
+} FocusConsole;
+
+#define MAX_OPTIONS (9)
+typedef struct {
+    const char* item_string;
+    char* options_menu[MAX_OPTIONS];
+    int num_options_menu;
+    char* selected_option;
+    char* actual_command;
+    bool text_input_req;
+} BlackhatItem;
+
+#define ENTER_NAME_LENGTH 25
+
+struct BlackhatApp {
+    Gui* gui;
+    ViewDispatcher* view_dispatcher;
+    SceneManager* scene_manager;
+
+    FuriString* text_box_store;
+    size_t text_box_store_strlen;
+    TextBox* text_box;
+
+    VariableItemList* var_item_list;
+    BlackhatUart* uart;
+    TextInput* text_input;
+    DialogsApp* dialogs;
+
+    int selected_menu_index;
+    int selected_option_index[NUM_MENU_ITEMS];
+    char* selected_tx_string;
+    const char* selected_option_item_text;
+    char text_store[128];
+    char text_input_ch[ENTER_NAME_LENGTH];
+    bool text_input_req;
+};
+
+typedef enum {
+    BlackhatAppViewVarItemList,
+    BlackhatAppViewConsoleOutput,
+    BlackhatAppViewStartPortal,
+    BlackhatAppViewTextInput,
+} BlackhatAppView;

+ 9 - 0
flipper_blackhat/blackhat_custom_event.h

@@ -0,0 +1,9 @@
+#pragma once
+
+typedef enum {
+    BlackhatEventRefreshConsoleOutput = 0,
+    BlackhatEventStartConsole,
+    BlackhatEventStartKeyboard,
+    BlackhatEventStartPortal,
+    BlackhatEventTextInput,
+} BlackhatCustomEvent;

+ 116 - 0
flipper_blackhat/blackhat_uart.c

@@ -0,0 +1,116 @@
+#include "blackhat_app_i.h"
+#include "blackhat_uart.h"
+
+struct BlackhatUart {
+    BlackhatApp* app;
+    FuriThread* rx_thread;
+    FuriStreamBuffer* rx_stream;
+    uint8_t rx_buf[RX_BUF_SIZE + 1];
+    void (*handle_rx_data_cb)(uint8_t* buf, size_t len, void* context);
+    FuriHalSerialHandle* serial_handle;
+};
+
+typedef enum {
+    WorkerEvtStop = (1 << 0),
+    WorkerEvtRxDone = (1 << 1),
+} WorkerEvtFlags;
+
+void blackhat_uart_set_handle_rx_data_cb(
+    BlackhatUart* uart,
+    void (*handle_rx_data_cb)(uint8_t* buf, size_t len, void* context)
+)
+{
+    furi_assert(uart);
+    uart->handle_rx_data_cb = handle_rx_data_cb;
+}
+
+#define WORKER_ALL_RX_EVENTS (WorkerEvtStop | WorkerEvtRxDone)
+
+void blackhat_uart_on_irq_cb(
+    FuriHalSerialHandle* handle, FuriHalSerialRxEvent event, void* context
+)
+{
+    BlackhatUart* uart = (BlackhatUart*)context;
+
+    if (event == FuriHalSerialRxEventData) {
+        uint8_t data = furi_hal_serial_async_rx(handle);
+        furi_stream_buffer_send(uart->rx_stream, &data, 1, 0);
+        furi_thread_flags_set(
+            furi_thread_get_id(uart->rx_thread), WorkerEvtRxDone
+        );
+    }
+}
+
+static int32_t uart_worker(void* context)
+{
+    BlackhatUart* uart = (void*)context;
+
+    while (1) {
+        uint32_t events = furi_thread_flags_wait(
+            WORKER_ALL_RX_EVENTS, FuriFlagWaitAny, FuriWaitForever
+        );
+        furi_check((events & FuriFlagError) == 0);
+        if (events & WorkerEvtStop) break;
+        if (events & WorkerEvtRxDone) {
+            size_t len = furi_stream_buffer_receive(
+                uart->rx_stream, uart->rx_buf, RX_BUF_SIZE, 0
+            );
+
+            if (len > 0) {
+                if (uart->handle_rx_data_cb) {
+                    uart->handle_rx_data_cb(uart->rx_buf, len, uart->app);
+                } else {
+                    uart->rx_buf[len] = '\0';
+                }
+            }
+        }
+    }
+
+    furi_stream_buffer_free(uart->rx_stream);
+
+    return 0;
+}
+
+void blackhat_uart_tx(BlackhatUart* uart, char* data, size_t len)
+{
+    furi_hal_serial_tx(uart->serial_handle, (uint8_t*)data, len);
+}
+
+BlackhatUart* blackhat_uart_init(BlackhatApp* app)
+{
+    BlackhatUart* uart = malloc(sizeof(BlackhatUart));
+    uart->app = app;
+    // Init all rx stream and thread early to avoid crashes
+    uart->rx_stream = furi_stream_buffer_alloc(RX_BUF_SIZE, 1);
+    uart->rx_thread = furi_thread_alloc();
+    furi_thread_set_name(uart->rx_thread, "BlackhatUartRxThread");
+    furi_thread_set_stack_size(uart->rx_thread, 1024);
+    furi_thread_set_context(uart->rx_thread, uart);
+    furi_thread_set_callback(uart->rx_thread, uart_worker);
+
+    furi_thread_start(uart->rx_thread);
+
+    uart->serial_handle = furi_hal_serial_control_acquire(UART_CH);
+    furi_check(uart->serial_handle);
+    furi_hal_serial_init(uart->serial_handle, 115200);
+    furi_hal_serial_async_rx_start(
+        uart->serial_handle, blackhat_uart_on_irq_cb, uart, false
+    );
+
+    return uart;
+}
+
+void blackhat_uart_free(BlackhatUart* uart)
+{
+    furi_assert(uart);
+
+    furi_hal_serial_async_rx_stop(uart->serial_handle);
+    furi_hal_serial_deinit(uart->serial_handle);
+    furi_hal_serial_control_release(uart->serial_handle);
+
+    furi_thread_flags_set(furi_thread_get_id(uart->rx_thread), WorkerEvtStop);
+    furi_thread_join(uart->rx_thread);
+    furi_thread_free(uart->rx_thread);
+
+    free(uart);
+}

+ 15 - 0
flipper_blackhat/blackhat_uart.h

@@ -0,0 +1,15 @@
+#pragma once
+
+#include "furi_hal.h"
+
+#define RX_BUF_SIZE (320)
+
+typedef struct BlackhatUart BlackhatUart;
+
+void blackhat_uart_set_handle_rx_data_cb(
+    BlackhatUart* uart,
+    void (*handle_rx_data_cb)(uint8_t* buf, size_t len, void* context)
+);
+void blackhat_uart_tx(BlackhatUart* uart, char* data, size_t len);
+BlackhatUart* blackhat_uart_init(BlackhatApp* app);
+void blackhat_uart_free(BlackhatUart* uart);

BIN
flipper_blackhat/icons/blackhat_10px.png


+ 2 - 0
flipper_blackhat/readme.md

@@ -0,0 +1,2 @@
+# Blackhat App
+The Flipper Backhat app is used to control the blackhat. The Blackhat will have three initial features: Evil Portal, Evil Twin, and RAT driving. 

+ 32 - 0
flipper_blackhat/scenes/blackhat_scene.c

@@ -0,0 +1,32 @@
+#include "blackhat_scene.h"
+
+// Generate scene on_enter handlers array
+#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_enter,
+void (*const blackhat_scene_on_enter_handlers[])(void*) = {
+#include "blackhat_scene_config.h"
+};
+#undef ADD_SCENE
+
+// Generate scene on_event handlers array
+#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_event,
+bool (*const blackhat_scene_on_event_handlers[])(
+    void* context, SceneManagerEvent event
+) = {
+#include "blackhat_scene_config.h"
+};
+#undef ADD_SCENE
+
+// Generate scene on_exit handlers array
+#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_exit,
+void (*const blackhat_scene_on_exit_handlers[])(void* context) = {
+#include "blackhat_scene_config.h"
+};
+#undef ADD_SCENE
+
+// Initialize scene handlers configuration structure
+const SceneManagerHandlers blackhat_scene_handlers = {
+    .on_enter_handlers = blackhat_scene_on_enter_handlers,
+    .on_event_handlers = blackhat_scene_on_event_handlers,
+    .on_exit_handlers = blackhat_scene_on_exit_handlers,
+    .scene_num = BlackhatSceneNum,
+};

+ 33 - 0
flipper_blackhat/scenes/blackhat_scene.h

@@ -0,0 +1,33 @@
+#pragma once
+
+#include <gui/scene_manager.h>
+
+// Generate scene id and total number
+#define ADD_SCENE(prefix, name, id) BlackhatScene##id,
+typedef enum {
+#include "blackhat_scene_config.h"
+    BlackhatSceneNum,
+} BlackhatScene;
+#undef ADD_SCENE
+
+extern const SceneManagerHandlers blackhat_scene_handlers;
+
+// Generate scene on_enter handlers declaration
+#define ADD_SCENE(prefix, name, id) \
+    void prefix##_scene_##name##_on_enter(void*);
+#include "blackhat_scene_config.h"
+#undef ADD_SCENE
+
+// Generate scene on_event handlers declaration
+#define ADD_SCENE(prefix, name, id)            \
+    bool prefix##_scene_##name##_on_event(     \
+        void* context, SceneManagerEvent event \
+    );
+#include "blackhat_scene_config.h"
+#undef ADD_SCENE
+
+// Generate scene on_exit handlers declaration
+#define ADD_SCENE(prefix, name, id) \
+    void prefix##_scene_##name##_on_exit(void* context);
+#include "blackhat_scene_config.h"
+#undef ADD_SCENE

+ 3 - 0
flipper_blackhat/scenes/blackhat_scene_config.h

@@ -0,0 +1,3 @@
+ADD_SCENE(blackhat, start, Start)
+ADD_SCENE(blackhat, console_output, ConsoleOutput)
+ADD_SCENE(blackhat, rename, Rename)

+ 90 - 0
flipper_blackhat/scenes/blackhat_scene_console_output.c

@@ -0,0 +1,90 @@
+#include "../blackhat_app_i.h"
+
+void blackhat_console_output_handle_rx_data_cb(
+    uint8_t* buf, size_t len, void* context
+)
+{
+    furi_assert(context);
+    BlackhatApp* app = context;
+
+    // If text box store gets too big, then truncate it
+    app->text_box_store_strlen += len;
+    if (app->text_box_store_strlen >= BLACKHAT_TEXT_BOX_STORE_SIZE - 1) {
+        furi_string_right(app->text_box_store, app->text_box_store_strlen / 2);
+        app->text_box_store_strlen =
+            furi_string_size(app->text_box_store) + len;
+    }
+
+    // Null-terminate buf and append to text box store
+    buf[len] = '\0';
+    furi_string_cat_printf(app->text_box_store, "%s", buf);
+
+    text_box_set_text(app->text_box, furi_string_get_cstr(app->text_box_store));
+}
+
+void blackhat_scene_console_output_on_enter(void* context)
+{
+    BlackhatApp* app = context;
+
+    TextBox* text_box = app->text_box;
+    text_box_reset(app->text_box);
+    text_box_set_font(text_box, TextBoxFontText);
+
+    text_box_set_focus(text_box, TextBoxFocusEnd);
+
+    furi_string_reset(app->text_box_store);
+    app->text_box_store_strlen = 0;
+
+    if (app->text_input_req) {
+        scene_manager_next_scene(app->scene_manager, BlackhatSceneRename);
+        return;
+    }
+
+    snprintf(
+        app->text_store,
+        sizeof(app->text_store),
+        "%s %s\n",
+        app->selected_tx_string,
+        app->selected_option_item_text
+    );
+
+    FURI_LOG_I("tag/app name", "%s", app->text_store);
+
+    text_box_set_text(app->text_box, furi_string_get_cstr(app->text_box_store));
+    scene_manager_set_scene_state(
+        app->scene_manager, BlackhatSceneConsoleOutput, 0
+    );
+    view_dispatcher_switch_to_view(
+        app->view_dispatcher, BlackhatAppViewConsoleOutput
+    );
+
+    // Register callback to receive data
+    blackhat_uart_set_handle_rx_data_cb(
+        app->uart, blackhat_console_output_handle_rx_data_cb
+    );
+
+    blackhat_uart_tx(app->uart, app->text_store, strlen(app->text_store));
+}
+
+bool blackhat_scene_console_output_on_event(
+    void* context, SceneManagerEvent event
+)
+{
+    UNUSED(context);
+
+    bool consumed = false;
+
+    if (event.type == SceneManagerEventTypeTick) {
+        consumed = true;
+    }
+
+    return consumed;
+}
+
+void blackhat_scene_console_output_on_exit(void* context)
+{
+    BlackhatApp* app = context;
+
+    // Unregister rx callback
+    blackhat_uart_set_handle_rx_data_cb(app->uart, NULL);
+}

+ 59 - 0
flipper_blackhat/scenes/blackhat_scene_rename.c

@@ -0,0 +1,59 @@
+#include "../blackhat_app_i.h"
+
+void blackhat_text_input_callback(void* context)
+{
+    furi_assert(context);
+    BlackhatApp* app = context;
+    view_dispatcher_send_custom_event(
+        app->view_dispatcher, BlackhatEventTextInput
+    );
+}
+
+void blackhat_scene_rename_on_enter(void* context)
+{
+    BlackhatApp* app = context;
+    TextInput* text_input = app->text_input;
+
+    text_input_set_result_callback(
+        text_input,
+        blackhat_text_input_callback,
+        context,
+        app->text_input_ch,
+        ENTER_NAME_LENGTH,
+        false
+    );
+
+    view_dispatcher_switch_to_view(
+        app->view_dispatcher, BlackhatAppViewTextInput
+    );
+}
+
+bool blackhat_scene_rename_on_event(void* context, SceneManagerEvent event)
+{
+    BlackhatApp* app = context;
+    bool consumed = false;
+    if (event.type == SceneManagerEventTypeCustom) {
+        snprintf(
+            app->text_store,
+            sizeof(app->text_store),
+            "%s '%s'\n",
+            app->selected_tx_string,
+            app->text_input_ch
+        );
+
+        blackhat_uart_tx(app->uart, app->text_store, strlen(app->text_store));
+
+        scene_manager_search_and_switch_to_previous_scene(
+            app->scene_manager, BlackhatSceneStart
+        );
+
+        consumed = true;
+    }
+    return consumed;
+}
+
+void blackhat_scene_rename_on_exit(void* context)
+{
+    BlackhatApp* app = context;
+    variable_item_list_reset(app->var_item_list);
+}

+ 165 - 0
flipper_blackhat/scenes/blackhat_scene_start.c

@@ -0,0 +1,165 @@
+#include "../blackhat_app_i.h"
+
+BlackhatItem items[] = {
+    {"Shell", {""}, 1, NULL, SHELL_CMD, false},
+    {"Connect WiFi",
+     {"wlan0", "wlan1", "wlan2"},
+     3,
+     NULL,
+     WIFI_CON_CMD,
+     FOCUS_CONSOLE_END},
+    {"Set inet SSID", {""}, 1, NULL, SET_INET_SSID_CMD, true},
+    {"Set inet Password", {""}, 1, NULL, SET_INET_PWD_CMD, true},
+    {"Set AP SSID", {""}, 1, NULL, SET_AP_SSID_CMD, true},
+    {"List Networks",
+     {"wlan0", "wlan1", "wlan2"},
+     3,
+     NULL,
+     LIST_AP_CMD,
+     FOCUS_CONSOLE_END},
+    {"Wifi Device Info", {""}, 1, NULL, DEV_CMD, false},
+    {"Enable AP",
+     {"wlan0", "wlan1", "wlan2"},
+     3,
+     NULL,
+     START_AP_CMD,
+     FOCUS_CONSOLE_END},
+    {"Start Kismet",
+     {"wlan0", "wlan1", "wlan2"},
+     3,
+     NULL,
+     START_KISMET_CMD,
+     FOCUS_CONSOLE_END},
+    {"Get IP", {""}, 1, NULL, GET_IP_CMD, false},
+    {"Enable SSH", {""}, 1, NULL, START_SSH_CMD, false},
+    {"Start Evil Twin", {""}, 1, NULL, ST_EVIL_TWIN_CMD, false},
+    {"Start Evil Portal", {""}, 1, NULL, ST_EVIL_PORT_CMD, false},
+    {"Start RAT Driver", {""}, 1, NULL, ST_RAT_CMD, false},
+    {"Get Params", {""}, 1, NULL, GET_CMD, false},
+    {"Reboot", {""}, 1, NULL, REBOOT_CMD, false},
+    {"Help", {""}, 1, NULL, HELP_CMD, false},
+};
+
+static void blackhat_scene_start_var_list_enter_callback(
+    void* context, uint32_t index
+)
+{
+    furi_assert(context);
+    BlackhatApp* app = context;
+
+    furi_assert(index < NUM_MENU_ITEMS);
+    const BlackhatItem* item = &items[index];
+
+    const int selected_option_index = app->selected_option_index[index];
+    furi_assert(selected_option_index < item->num_options_menu);
+    app->selected_tx_string = item->actual_command;
+    app->text_input_req = item->text_input_req;
+    app->selected_menu_index = index;
+
+    app->selected_option_item_text = item->selected_option;
+    view_dispatcher_send_custom_event(
+        app->view_dispatcher, BlackhatEventStartConsole
+    );
+}
+
+static void blackhat_scene_start_var_list_change_callback(VariableItem* item)
+{
+    furi_assert(item);
+
+    BlackhatApp* app = variable_item_get_context(item);
+    furi_assert(app);
+
+    const BlackhatItem* menu_item = &items[app->selected_menu_index];
+
+    uint8_t item_index = variable_item_get_current_value_index(item);
+    furi_assert(item_index < menu_item->num_options_menu);
+
+    variable_item_set_current_value_text(
+        item, menu_item->options_menu[item_index]
+    );
+    items[app->selected_menu_index].selected_option =
+        menu_item->options_menu[item_index];
+
+    app->selected_option_index[app->selected_menu_index] = item_index;
+}
+
+void blackhat_scene_start_on_enter(void* context)
+{
+    BlackhatApp* app = context;
+    VariableItemList* var_item_list = app->var_item_list;
+
+    variable_item_list_set_enter_callback(
+        var_item_list, blackhat_scene_start_var_list_enter_callback, app
+    );
+
+    VariableItem* item;
+    for (int i = 0; i < NUM_MENU_ITEMS; ++i) {
+        item = variable_item_list_add(
+            var_item_list,
+            items[i].item_string,
+            items[i].num_options_menu,
+            blackhat_scene_start_var_list_change_callback,
+            app
+        );
+
+        items[i].selected_option = items[i].options_menu[0];
+
+        variable_item_set_current_value_index(
+            item, app->selected_option_index[i]
+        );
+        variable_item_set_current_value_text(
+            item, items[i].options_menu[app->selected_option_index[i]]
+        );
+    }
+
+    variable_item_list_set_selected_item(
+        var_item_list,
+        scene_manager_get_scene_state(app->scene_manager, BlackhatSceneStart)
+    );
+
+    view_dispatcher_switch_to_view(
+        app->view_dispatcher, BlackhatAppViewVarItemList
+    );
+}
+
+bool blackhat_scene_start_on_event(void* context, SceneManagerEvent event)
+{
+    UNUSED(context);
+    BlackhatApp* app = context;
+    bool consumed = false;
+
+    if (event.type == SceneManagerEventTypeCustom) {
+        if (event.event == BlackhatEventStartPortal) {
+            scene_manager_set_scene_state(
+                app->scene_manager, BlackhatSceneStart, app->selected_menu_index
+            );
+            scene_manager_next_scene(
+                app->scene_manager, BlackhatAppViewStartPortal
+            );
+        } else if (event.event == BlackhatEventStartKeyboard) {
+            scene_manager_set_scene_state(
+                app->scene_manager, BlackhatSceneStart, app->selected_menu_index
+            );
+        } else if (event.event == BlackhatEventStartConsole) {
+            scene_manager_set_scene_state(
+                app->scene_manager, BlackhatSceneStart, app->selected_menu_index
+            );
+            scene_manager_next_scene(
+                app->scene_manager, BlackhatAppViewConsoleOutput
+            );
+        }
+        consumed = true;
+    } else if (event.type == SceneManagerEventTypeTick) {
+        app->selected_menu_index =
+            variable_item_list_get_selected_item_index(app->var_item_list);
+        consumed = true;
+    }
+
+    return consumed;
+}
+
+void blackhat_scene_start_on_exit(void* context)
+{
+    BlackhatApp* app = context;
+    variable_item_list_reset(app->var_item_list);
+}