MX 2 лет назад
Родитель
Сommit
c7e2dc5dd3

+ 113 - 56
non_catalog_apps/esp32_gravity/README.md

@@ -1,55 +1,129 @@
-# Gravity Companion for Flipper Zero
+# Gravity for Flipper Zero
+## The Unseen Force
 
 This Flipper Zero application (FAP) is a companion application to ESP32-Gravity.
 
-ESP32-Gravity is a wireless exploration framework written for the ESP32-C6. It
+ESP32-Gravity is a wireless exploration framework written for the ESP32. It
 supports a variety of wireless exploration, offensive and defensive features.
 
 ESP32-Gravity can be used without a Flipper, but Flipper-Gravity can't be used
-without ESP32-Gravity. You can download it from:
-(https://github.com/chris-bc/esp32c6-gravity|https://github.com/chris-bc/esp32c6-gravity)
+without ESP32-Gravity. You can download it from the [esp32-gravity GitHub repo](https://github.com/chris-bc/esp32-gravity).
+
+## Download Flipper-Gravity
+
+### 1. From Source
+
+1. Clone the RogueMaster repository using a command such as
+    * You may prefer to `checkout` - or even download - a release version of the code. You do you :)
+```c
+gh repo clone RogueMaster/flipperzero-firmware-wPlugins
+```
+2. Change to the RogueMaster directory: `cd flipperzero-firmware-wPlugins`
+3. Install the Flipper compilation toolchain: `./fbt`
+4. Configure your environment variables: `` . `./fbt -s env` `` (note the leading 'dot space')
+5. Change to the applications_user directory: `cd applications_user`
+6. Clone this repository using a command such as 
+```c
+gh repo clone chris-bc/Flipper-Gravity
+```
+7. Change back to the firmware root directory: `cd ..`
+
+Unless you've already flashed the firmware being used you'll need to upgrade the firmware on your Flipper so that it uses the same version as the FAP.
+
+To build and flash the complete firmware bundle make sure your
+Flipper Zero is on the home screen (no applications or menus open),
+connect it to your computer, and run
+```c
+./fbt firmware_all flash_usb_full
+```
+
+However, if you want to install just the application, you have two main options:
+1. `./fbt launch_app APPSRC=esp32_gravity` will build, install and start the application;
+2. `./fbt flash_usb fap_esp32_gravity` will build the application and package it into a firmware update package;
+3. Copy the update directory, which will be reported towards the end of the above command and will be similar to `dist/f7-C/f7-update-RM420FAP`, to the Flipper Zero's SD card;
+4. Open Browser on the Flipper by pressing `Down`, then `Left` repeatedly until you reach a screen labelled **Browser**;
+5. Navigate to the update directory you copied;
+6. Push `OK` on `update.fuf`, then select *Run in App*;
+7. Once the firmware update completes Gravity will be installed under `Apps/GPIO/ESP32/[ESP32] Gravity`
+
+
+### 2. Binaries
+
+Simply download this `FAP` (Flipper Application Package) and copy it to your
+preferred applications folder on your Flipper Zero's SD card.
+
+Now you just need to flash and connect an ESP32 and you'll be ready to go!
+
+[![FAP Factory](https://flipc.org/api/v1/cool4uma/UART_Terminal/badge?firmware=unleashed)](https://flipc.org/chris-bc/Flipper-Gravity?firmware=roguemaster)
+
+
+## Reduced Support for ESP32-C6
+
+Good news for all the Flipper tinkerers who have a bucket of ESP32s but
+no ESP32-C6s - Espressif's development environment, even trying the
+bleeding edge from GitHub, doesn't yet have full Bluetooth support
+for the ESP32-C6.
+
+Gravity now targets the regular ESP32. I'm using a Wroom during development,
+and hope to verify it working on ESP32-Cam cam at some point, but I think
+this makes ESP32 the only Espressif microcontroller with full-stack Bluetooth
+support. For now, at least.
+
+For more information, including a thorough overview of all features,
+check out the [readme doc over at esp-32-gravity](https://github.com/chris-bc/esp32-gravity/blob/main/README.md)
+
+
+## Version Compatibility
+
+Since Gravity has been included with RogueMaster Firmware I thought I should
+make a couple of changes to make it easy for people other than me to know
+which esp32-Gravity is compatible with which Flipper-Gravity.
+
+* From here on out versions will be numbered `(major).(minor).(release)`;
+* For example `1.2.1`;
+* Different **release** versions (such as `1.2.1` and `1.2.9`) will always be compatible with each other, although the addition or significant modification of some features may result in a small number of features not working;
+* Changes in minor version, such as `1.2.1` and `1.3.1`, are unlikely to be compatible. A change in minor version represents a noteable change to the platform or a breaking change to the platform;
+* Changes in major verson, such as `1.4.9` to `2.0.0`, represent substantial changes to the application and how it runs. Different major versions *will not* be compatible with each other.
+
+
+## Gravity In Action
+
+![Gravity Main Menu](https://github.com/chris-bc/flipper-gravity/blob/main/flip-grav-mainmenu.png)
+
+![Gravity Mana Attack](https://github.com/chris-bc/flipper-gravity/blob/main/flip-grav-mana.jpg)
+
+![Gravity About Page](https://github.com/chris-bc/flipper-gravity/blob/main/flip-grav-about.png)
+
 
 ## TODO
 * Bug: Console scrolls to top mid-scroll when text is added to it
     * Replicate: Start scan, Run help and try to read it
+* Add space to keyboard
+* add channel, mode, count STA+AP on console header
+* Paging in homing mode where all targets can't be displayed at the same time
+    * like airline departures - one screen for 3s, another screen for 3s.
 
 ## Menu Structure
-* Beacon: RickRoll Random Infinite target-ssids (APs)
-* Probe: Any target-ssids
-* Sniff: On Off
-* target-ssids: add remove list
-* scan: on off
-* hop: on off default
-* view: sta ap sta+ap
-* select: sta ap
-* clear: sta ap
+* Beacon: target-ssids, APs, RickRoll, Random, Infinite
+* Probe: Any, target-ssids, APs
+* Sniff: On, Off
+* target-ssids: add, remove, list
+* scan: on, off
+* hop: on, off, sequential, random, default, set
+* view: sta, ap, sta+ap
+* select: sta, ap
+* selected: sta, ap, sta+ap
+* clear: sta, ap
 * get/set: <variables>
-* deauth: off, frame sta, device sta, spoof sta, frame broadcast, device broadcast, spoof broadcast
-* mana: on off clear
-* mana verbose: on off
-* mana loud: on off
-* help: commands help
-
-# UART Terminal for Flipper Zero
-[Flipper Zero](https://flipperzero.one/) app to control various devices via UART interface.
-## Download fap
-| **FW Official** | **FW Unleashed** |
-| - | - |
-| [![FAP Factory](https://flipc.org/api/v1/cool4uma/UART_Terminal/badge)](https://flipc.org/cool4uma/UART_Terminal) | [![FAP Factory](https://flipc.org/api/v1/cool4uma/UART_Terminal/badge?firmware=unleashed)](https://flipc.org/cool4uma/UART_Terminal?firmware=unleashed) |
-
-## Capabilities
-- Read log and command output by uart
-- Send commands by uart
-- Send AT commands
-- Set baud rate
-- Fast commands
-
-## Connecting
-| Flipper Zero pin | UART interface  |
-| ---------------- | --------------- |
-| 13 TX            | RX              |
-| 14 RX            | TX              |
-|8, 18 GND         | GND             |
+* deauth: off, frame STA, device STA, spoof STA, frame APs, device APs, spoof APs, frame broadcast, device broadcast, spoof broadcast
+* mana: on, off, clear
+* mana verbose: on, off
+* mana loud: on, off
+* DOS AP: on, off
+* DOS Clone: status, off, Open, WEP, WPA, Open+WEP, Open+WPA, WEP+WPA, Open+WEP+WPA
+* Homing: 802.11, any (more options coming soon)
+* help: commands help info
+
 
 Info: If possible, do not power your devices from 3V3 (pin 9) Flipper Zero. It does not support hot plugging.
 
@@ -60,12 +134,6 @@ To accommodate more characters on a small display, some characters are called up
 
 ![kbf](https://user-images.githubusercontent.com/122148894/212286637-7063f1ee-c6ff-46b9-8dc5-79a5f367fab1.png)
 
-## Supported send AT commands
-In the "Send AT command" mode, the keyboard settings are changed for the convenience of entering AT commands.
-
-![AT](https://user-images.githubusercontent.com/122148894/230785072-319fe5c9-deca-49f9-bfe4-5ace89d38d53.png)
-
-
 ## How to install
 Copy the contents of the repository to the applications_user/uart_terminal folder Flipper Zero firmware and build app with the command ./fbt fap_uart_terminal.
 
@@ -75,14 +143,3 @@ Download ready [fap](https://github.com/playmean/fap-list)
 
 ## How it works
 
-
-![1f](https://user-images.githubusercontent.com/122148894/211161450-6d177638-3bfa-42a8-9c73-0cf3af5e5ca7.jpg)
-
-
-![2f](https://user-images.githubusercontent.com/122148894/211161456-4d2be15b-4a05-4450-a62e-edcaab3772fd.jpg)
-
-
-
-## INFO:
-
-~60% of the source code is taken from the [Wifi Marauder](https://github.com/0xchocolate/flipperzero-firmware-with-wifi-marauder-companion) project. Many thanks to the developers of the Wifi Marauder project.

+ 4 - 0
non_catalog_apps/esp32_gravity/esp_flip_struct.h

@@ -16,6 +16,8 @@ enum AttackMode {
     ATTACK_SCAN,
     ATTACK_HANDSHAKE,
     ATTACK_RANDOMISE_MAC, // True
+    ATTACK_BT,
+    ATTACK_STALK,
     ATTACKS_COUNT
 };
 typedef enum AttackMode AttackMode;
@@ -42,6 +44,8 @@ enum GravityCommand {
     GRAVITY_HANDSHAKE,
     GRAVITY_COMMANDS,
     GRAVITY_INFO,
+    GRAVITY_GET_VERSION,
+    GRAVITY_BT,
     GRAVITY_NONE = 99
 };
 typedef enum GravityCommand GravityCommand;

+ 23 - 6
non_catalog_apps/esp32_gravity/scenes/uart_terminal_scene_console_output.c

@@ -1,5 +1,7 @@
 #include "../uart_terminal_app_i.h"
 
+#define MIN_VERSION_STRLEN 43
+
 void uart_terminal_console_output_handle_rx_data_cb(uint8_t* buf, size_t len, void* context) {
     furi_assert(context);
     UART_TerminalApp* app = context;
@@ -41,16 +43,25 @@ void uart_terminal_scene_console_output_on_enter(void* context) {
             /* Display detailed instructions on getting started */
             uart_text_input_set_header_text(app->text_input, "Getting Started");
             // TODO: See if the header works
-            char string[] = "             Flipper Gravity\nGETTING STARTED\nUnless you're doing a basic beacon spam or probe flood attack, or a Mana attack, the first thing to do is turn scanning on and let it run while you explore the menu. View found APs (you can leave scanning on or turn it off), select a few APs or STAs and run a DEAUTH attack against the selected APs or STAs. When an AP is specified for a DEAUTH attack Gravity will use all STAs it identifies as clients of the specified APs. Turn off scanning and deauth, and turn on MANA or LOUD MANA. This is still under development, but you can watch Wireshark to see if any devices send you an association request.\n";
+            const char string[] = "             Flipper Gravity\nGETTING STARTED\nUnless you're doing a basic beacon spam or probe flood attack, or a Mana attack, the first thing to do is turn scanning on and let it run while you explore the menu. View found APs (you can leave scanning on or turn it off), select a few APs or STAs and run a DEAUTH attack against the selected APs or STAs. When an AP is specified for a DEAUTH attack Gravity will use all STAs it identifies as clients of the specified APs. Turn off scanning and deauth, and turn on MANA or LOUD MANA. This is still under development, but you can watch Wireshark to see if any devices send you an association request.\n";
             furi_string_cat_str(app->text_box_store, string);
             app->text_box_store_strlen += strlen(string);
-        } else if (!strcmp(app->selected_tx_string, "ABOUT")) {
-            app->is_command = false;
+        } else if (!strcmp(app->selected_tx_string, "gravity-version")) {
+            /* Display Flipper-Gravity components of the About screen */
+            /* Not setting app->is_command = false;
+               We want this command to be passed through to esp32-Gravity, so we can also
+               display its version */
             /* Display a basic about screen */
             // TODO: See if the following works:
-            char aboutStr[] = "              Flipper Gravity\n                    v0.2.1\nBy Chris BC\n    https://github.com/chris-bc/flipper-gravity\n    https://github.com/esp32c6-gravity\n\n\nMost ideas and code stolen from ESP32 Marauder and UART Terminal.";
-            furi_string_cat_str(app->text_box_store, aboutStr);
-            app->text_box_store_strlen += strlen(aboutStr);
+            const char about1[] = "              Flipper Gravity\nBy Chris BC\n\nBe The Unseen Force.\n\nhttps://github.com/chris-bc/esp32-gravity\nhttps://github.com/chris-bc/Flipper-Gravity\n\nFlipper-Gravity : v";
+            furi_string_cat_str(app->text_box_store, about1);
+            app->text_box_store_strlen += strlen(about1);
+            furi_string_cat_str(app->text_box_store, GRAVITY_VERSION);
+            app->text_box_store_strlen += strlen(GRAVITY_VERSION);
+            furi_string_cat_str(app->text_box_store, "");
+            app->text_box_store_strlen += strlen("\n");
+            //furi_string_cat_printf(app->text_box_store, %s\n", GRAVITY_VERSION);
+            //app->text_box_store_strlen += 5 + strlen("              Flipper Gravity\nBy Chris BC\n\nBe The Unseen Force.\n\nhttps://github.com/chris-bc/esp32-gravity\nhttps://github.com/chris-bc/Flipper-Gravity\n\nFlipper-Gravity : v\n");
         }
 
         if(app->show_stopscan_tip) {
@@ -105,4 +116,10 @@ void uart_terminal_scene_console_output_on_exit(void* context) {
 
     // Unregister rx callback
     uart_terminal_uart_set_handle_rx_data_cb(app->uart, NULL);
+
+    /* Instruct ESP32 to halt any UIs that may be drawing */
+    if (!strcmp(app->selected_tx_string, "stalk on")) {
+        uart_terminal_uart_tx(
+                (uint8_t*)"stalk off\n", strlen("stalk off\n"));
+    }
 }

+ 14 - 7
non_catalog_apps/esp32_gravity/scenes/uart_terminal_scene_start.c

@@ -37,14 +37,14 @@ const UART_TerminalItem items[NUM_MENU_ITEMS] = {
     NO_TIP},
     {"Beacon",
     {"Status", "target-ssids", "APs", "RickRoll", "Random", "Infinite", "Off"},
-    6,
+    7,
     {"beacon", "beacon target-ssids", "beacon aps", "beacon rickroll", "beacon random ", "beacon infinite", "beacon off"},
     TOGGLE_ARGS,
     FOCUS_CONSOLE_END,
     NO_TIP},
     {"Probe",
     {"Status", "Any", "target-ssids", "APs", "Off"},
-    4,
+    5,
     {"probe", "probe any", "probe target-ssids", "probe aps", "probe off"},
     NO_ARGS,
     FOCUS_CONSOLE_END,
@@ -121,7 +121,7 @@ const UART_TerminalItem items[NUM_MENU_ITEMS] = {
     NO_TIP},
     {"Set",
     {"pkt expiry", "SSID rnd chars", "Attack millis", "SSID min len", "SSID max len", "default SSID count", "Channel", "MAC", "MAC Randomisation"},
-    8,
+    9,
     {"set expiry ", "set scramble_words ", "set attack_millis ", "set ssid_len_min ", "set ssid_len_max ", "set default_ssid_count ", "set channel ", "set mac ", "set mac_rand "},
     INPUT_ARGS,
     FOCUS_CONSOLE_END,
@@ -162,16 +162,23 @@ const UART_TerminalItem items[NUM_MENU_ITEMS] = {
     FOCUS_CONSOLE_END,
     NO_TIP},
     {"AP Clone Attack",
-    {"Status", "On", "Off"},
-    3,
-    {"ap-clone", "ap-clone on", "ap-clone off"},
+    {"Status", "Off", "OPN", "WEP", "WPA", "OPN+WEP", "OPN+WPA", "WEP+WPA", "OPN+WEP+WPA"},
+    9,
+    {"ap-clone", "ap-clone off", "ap-clone on open", "ap-clone on wep", "ap-clone on wpa", "ap-clone on open wep", "ap-clone on open wpa", "ap-clone on wep wpa", "ap-clone on open wep wpa"},
+    NO_ARGS,
+    FOCUS_CONSOLE_END,
+    NO_TIP},
+    {"Homing",
+    {"802.11", "ANY"},
+    2,
+    {"stalk on", "stalk on"},
     NO_ARGS,
     FOCUS_CONSOLE_END,
     NO_TIP},
     {"Help",
     {"Info <cmd>", "Get Started", "Commands", "About", "Help"},
     5,
-    {"info ", "GET_STARTED", "commands", "ABOUT", "help"},
+    {"info ", "GET_STARTED", "commands", "gravity-version", "help"},
     TOGGLE_ARGS,
     FOCUS_CONSOLE_START,
     NO_TIP},

+ 2 - 2
non_catalog_apps/esp32_gravity/scenes/uart_terminal_scene_text_input.c

@@ -1,7 +1,7 @@
 #include "../uart_terminal_app_i.h"
 
-/* GRAVITY: Import usage strings */
-#include "../esp_flip_const.h"
+/* GRAVITY: Import ESP32-Gravity usage strings */
+#include "../usage_const.h"
 
 void uart_terminal_scene_text_input_callback(void* context) {
     UART_TerminalApp* app = context;

+ 2 - 2
non_catalog_apps/esp32_gravity/uart_terminal_app_i.h

@@ -12,9 +12,9 @@
 #include <gui/modules/variable_item_list.h>
 #include "uart_text_input.h"
 
-#define GRAVITY_VERSION "0.2.1"
+#define GRAVITY_VERSION "0.3.4"
 
-#define NUM_MENU_ITEMS (22)
+#define NUM_MENU_ITEMS (23)
 
 #define UART_TERMINAL_TEXT_BOX_STORE_SIZE (1024)
 #define UART_TERMINAL_TEXT_INPUT_STORE_SIZE (512)

+ 53 - 0
non_catalog_apps/esp32_gravity/usage_const.h

@@ -0,0 +1,53 @@
+#ifndef ESP_FLIP_CONST_H
+#define ESP_FLIP_CONST_H
+
+/* Command usage string - SHORT_* is compressed help text for Flipper */
+const char USAGE_BT[] = "Bluetooth Test Module. bluetooth [ ON | OFF ]";
+const char USAGE_BEACON[] = "Beacon spam attack. Usage: beacon [ RICKROLL | RANDOM [ COUNT ] | INFINITE | TARGET-SSIDs | APs | OFF ] [ AUTH ( OPEN | WPA )+ ]";
+const char USAGE_TARGET_SSIDS[] = "Manage SSID targets. Usage: target-ssids [ ( ADD | REMOVE ) <ssid_name> ]";
+const char USAGE_PROBE[] = "Probe flood attack. Usage: probe [ ANY | TARGET-SSIDs | APs | OFF ]";
+const char USAGE_FUZZ[] = "Various invalid packets. Usage: fuzz OFF | ( ( BEACON | REQ | RESP )+ ( OVERFLOW | MALFORMED ) )";
+const char USAGE_SNIFF[] = "Display interesting packets. Usage: sniff [ ON | OFF ]";
+const char USAGE_DEAUTH[] = "Deauth attack. Usage: deauth [ <millis> ] [ FRAME | DEVICE | SPOOF ] [ STA | AP | BROADCAST | OFF ]";
+const char USAGE_MANA[] = "Mana attack. Usage: mana ( CLEAR | ( [ VERBOSE ] [ ON | OFF ] ) | ( AUTH [ NONE | WEP | WPA ] ) | ( LOUD [ ON | OFF ] ) )";
+const char USAGE_STALK[] = "Toggle target tracking/homing. Usage: stalk [ ON | OFF ]";
+const char USAGE_AP_DOS[] = "Denial-of-service attack on selectedAPs. Usage: ap-dos [ ON | OFF ]";
+const char USAGE_AP_CLONE[] = "Clone and attempt takeover of the specified AP. Usage: ap-clone [ ( ON | OFF ) ( OPEN | WEP | WPA )+ ]";
+const char USAGE_SCAN[] = "Scan for wireless devices. Usage: scan [ <ssid> | ON | OFF ]";
+const char USAGE_HOP[] = "Configure channel hopping. Usage: hop [ <millis> ] [ ON | OFF | DEFAULT | KILL ] [ SEQUENTIAL | RANDOM ]";
+const char USAGE_SET[] = "Set a variable. Usage: set <variable> <value>";
+const char USAGE_GET[] = "Get a variable. Usage: get <variable>";
+const char USAGE_VIEW[] = "List available targets. Usage: view ( ( AP [ selectedSTA ] ) | ( STA [ selectedAP ] ) | SORT ( AGE | RSSI | SSID ) )+";
+const char USAGE_SELECT[] = "Select an element. Usage: select ( AP | STA ) <elementId>+";
+const char USAGE_SELECTED[] = "Display selected elements. Usage: selected ( AP | STA )";
+const char USAGE_CLEAR[] = "Clear stored APs or STAs. Usage: clear ( AP | STA | ALL )";
+const char USAGE_HANDSHAKE[] = "Toggle monitoring for encryption material. Usage handshake [ ON | OFF ]";
+const char USAGE_COMMANDS[] = "Display a *brief* summary of Gravity commands";
+const char USAGE_INFO[] = "Provide help information for the specified command. Usage: info <cmd>";
+const char USAGE_VERSION[] = "Display esp32-Gravity version information. Usage: gravity-version";
+
+const char SHORT_BT[] = "bluetooth [ ON | OFF ]";
+const char SHORT_BEACON[] = "beacon [ RICKROLL | RANDOM [ COUNT ] | INFINITE | TARGET-SSIDs | APs | OFF] [ AUTH ( OPEN | WPA )+ ]";
+const char SHORT_TARGET_SSIDS[] = "(ADD | REMOVE) <apName>";
+const char SHORT_PROBE[] = "probe ANY | TARGET-SSIDs | APs | OFF";
+const char SHORT_FUZZ[] = "fuzz OFF | ( ( BEACON | REQ | RESP )+ ( OVERFLOW | MALFORMED ) )";
+const char SHORT_SNIFF[] = "sniff [ ON | OFF ]";
+const char SHORT_DEAUTH[] = "deauth <millis>";
+const char SHORT_MANA[] = "Mana attack";
+const char SHORT_STALK[] = "Track RSSI. stalk [ ON | OFF ]";
+const char SHORT_AP_DOS[] = "ap-dos [ ON | OFF ]";
+const char SHORT_AP_CLONE[] = "ap-clone [ ( ON | OFF ) ( OPEN | WEP | WPA )+ ]";
+const char SHORT_SCAN[] = "scan <SSID Name>";
+const char SHORT_HOP[] = "hop [ <millis> ] [ ON | OFF | DEFAULT | KILL ] [ SEQUENTIAL | RANDOM ]";
+const char SHORT_SET[] = "set <variable> <value>";
+const char SHORT_GET[] = "get <variable>";
+const char SHORT_VIEW[] = "VIEW ( ( AP [ selectedSTA ] ) | ( STA [ selectedAP ] ) | SORT ( AGE | RSSI | SSID ) )+";
+char SHORT_SELECT[] = "select ( AP | STA ) <id>+ sep. ~";
+const char SHORT_SELECTED[] = "selected ( AP | STA )";
+const char SHORT_CLEAR[] = "clear ( AP | STA | ALL )";
+const char SHORT_HANDSHAKE[] = "handshake [ ON | OFF ]";
+const char SHORT_COMMANDS[] = "Brief command summary";
+const char SHORT_INFO[] = "Command help. info <cmd>";
+const char SHORT_VERSION[] = "esp32-Gravity Version. gravity-version";
+
+#endif