ESP32 Marauder

repository·master·Indexed 11 days ago

https://github.com/justcallmekoko/esp32marauder

A suite of WiFi and Bluetooth offensive and defensive security tools designed for ESP32 hardware. Includes documentation on flashing V4 firmware via esptool.exe, managing the installer manifest and build targets, and a specialized fork of ESP Async WebServer for asynchronous HTTP and WebSocket communication on ESP32.

Tokens
8.5K
Snippets
27
Records
39
Agent score
95%

What's inside ESP32 Marauder

  1. Overview of ESP Async WebServer

    master

    ESP Async WebServer is an asynchronous HTTP and WebSocket server library for the ESP32. It provides support for several advanced features including:

    • WebSockets and Server-Sent Events (SSE)
    • Authentication
    • Arduino Json 7 (with backward compatibility for version 6)
    • File uploads and static file serving
    • URL rewriting and redirection

    This specific fork is optimized for concurrency and is compatible with Arduino 3 (ESP-IDF 5.1). It depends on mathieucarbou/AsyncTCP @ ^3.1.4.

  2. ESP32 Marauder Capabilities

    master

    ESP32 Marauder is a suite of WiFi and Bluetooth offensive and defensive tools for the ESP32.

    WiFi Capabilities:

    • Network Management: Join WiFi networks, shutdown the WiFi interface to save RAM, and manage SSID lists (Generate 20 random SSIDs, Add custom SSIDs via on-screen keyboard, or Clear list).
    • Sniffing: Sniff WiFi probe request frames and beacon frames.
    • Spamming: Beacon Spam (using a list of SSIDs or random frames) and 'Rick Roll' Beacon (broadcasting Rick Roll lyrics as APs).
    • Monitoring & Analysis: Packet Monitor (time bar graph of packet density per channel), EAPOL/PMKID scanning, and Deauth Sniffing (detecting deauthentication packets).
    • Detection: Detect Pwnagotchis, Espressif devices, and Bluetooth-enabled credit card skimmers.
    • Data Management: Save PCAP files to an SD card.

    Bluetooth Capabilities:

    • Sniffing: Bluetooth Sniffer for devices in range.
    • Shutdown: Shutdown BLE interface to save RAM.

    Note: Due to the ESP32-IDF, the ESP32 is incapable of transmitting deauthentication frames.

  3. How to send optimized WebSocket messages

    master

    This fork provides two ways to handle WebSocket message buffers. While it maintains compatibility with the original me-no-dev API using makeBuffer(), it is strongly recommended to use the optimized API based on std::shared_ptr<std::vector<uint8_t>>. The optimized API is more efficient and better supports concurrent use cases.

    To ensure cross-fork compatibility, you can use preprocessor macros to detect if you are using the mathieucarbou fork.

    void send(JsonDocument& doc) {
      const size_t len = measureJson(doc);
    
    #if defined(ASYNCWEBSERVER_FORK_mathieucarbou)
    
      // Optimized API: uses shared_ptr for better concurrency support
      auto buffer = std::make_shared<std::vector<uint8_t>>(len);
      assert(buffer);
      serializeJson(doc, buffer->data(), len);
      _ws->textAll(std::move(buffer));
    
    #else
    
      // Original me-no-dev API
      AsyncWebSocketMessageBuffer* buffer = _ws->makeBuffer(len);
      assert(buffer);
      serializeJson(doc, buffer->get(), len);
      _ws->textAll(buffer);
    
    #endif
    }
  4. Understand the ESP32 Marauder Installer Manifest

    master

    The installer uses targets.json as a canonical registry for 22 stable firmware build targets. This registry maps build flags to stable target IDs, aliases, release asset suffixes, browser-facing chip families, and esptool chip names.

    When a build is processed, the installer generates two distinct types of plans:

    • Update plan: Contains only the application image and is designed to preserve existing user data.
    • Factory plan: Contains every emitted flash segment and requires a full erase of the device.

    All installer binaries are namespaced with esp32_marauder_installer_ to prevent filename collisions with standard release binaries.

  5. How to use AsyncWebSocketMessageBuffer and makeBuffer()

    master

    This fork maintains compatibility with the original me-no-dev WebSocket API by resurrecting AsyncWebSocketMessageBuffer and makeBuffer(), but it also supports a more efficient, optimized API based on std::shared_ptr<std::vector<uint8_t>>.

    Developers can choose between the original API or the optimized API. It is strongly recommended to use the optimized API for better performance in concurrent use cases.

    // Optimized API usage (Recommended)
    void send(JsonDocument& doc) {
      const size_t len = measureJson(doc);
    
    #if defined(ASYNCWEBSERVER_FORK_mathieucarbou)
      // Uses shared pointer API for better concurrency support
      auto buffer = std::make_shared<std::vector<uint8_t>>(len);
      assert(buffer);
      serializeJson(doc, buffer->data(), len);
      _ws->textAll(std::move(buffer));
    #else
      // Original me-no-dev API
      AsyncWebSocketMessageBuffer* buffer = _ws->makeBuffer(len);
      assert(buffer);
      serializeJson(doc, buffer->get(), len);
      _ws->textAll(buffer);
    #endif
    }
  6. Assemble the ESP32 Marauder Enclosure

    master

    If you are building your own hardware or replacing an existing enclosure, you can use the 3D printed STL files available in the repository's 3Dfiles directory or on Thingiverse.

    Components Required

    • ESP32 Marauder hardware
    • 4x M2.5x10 Hex screws
    • Enclosure face plate
    • Enclosure body

    Assembly Steps

    1. Print Parts: Print both the face plate and the enclosure body.
    2. Mount Face Plate: Place the face plate onto the Marauder screen. Align the pegs with the holes on the screen PCB.
    3. Insert Hardware: Lower the Marauder into the enclosure body. Ensure the battery is seated correctly within the center trench of the body.
    4. Secure: Fasten the face plate to the body using the 4 M2.5x10 hex screws. Ensure the tops of the screws are flush with the surface of the face plate.
  7. Update Firmware via Web Interface (OTA)

    master

    If you own an ESP32 Marauder (v0.4.0 or later), you can update the firmware over-the-air (OTA):

    1. Download the latest release .bin file.
    2. On the Marauder device, navigate to Device > Update Firmware > Web Update.
    3. Connect your computer to the MarauderOTA WiFi network (Password: justcallmekoko).
    4. Open a browser and go to http://192.168.4.1.
    5. Log in with:
      • Username: admin
      • Password: admin
    6. Click Browse, select your .bin file, and click Update.
    7. The device will automatically reboot once complete.
  8. Flash Marauder V4 firmware using esptool.exe

    master

    To flash the Marauder V4 firmware onto an ESP32 device, use the esptool.exe utility. Ensure you have the correct COM port and that the device is connected. The command specifies the chip type, baud rate, flash mode, and the specific memory offsets for the bootloader, application, and partition files.

    ..	e-spool.exe --chip esp32 --port COM4 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0xe000 boot_app0.bin 0x1000 esp32_marauder.ino.bootloader.bin 0x10000 esp32_marauder_v0_9_17_20221019_old_hardware.bin 0x8000 esp32_marauder.ino.partitions.bin
  9. Flash Firmware using Arduino IDE

    master

    Follow these steps to flash the ESP32 Marauder firmware using the Arduino IDE:

    1. Install Arduino IDE and add the ESP32 board URL to File > Preferences > Additional Boards Manager URLs: https://dl.espressif.com/dl/package_esp32_index.json.
    2. Install Boards: Go to Tools > Board > Boards Manager, search for esp32 and install esp32 by Espressif Systems.
    3. Install Libraries:
      • Install SimpleList by Spacehuhn (Download repo and use Sketch > Include Library > Add .ZIP Library...).
      • Install the TFT_eSPI fork by justcallmekoko (Download repo and use Add .ZIP Library...). Note: You must apply specific modifications to the TFT_eSPI library as described in this issue.
    4. Install Tools:
    5. Configure & Upload:
      • Clone/Download this repository and open esp32_marauder.ino.
      • (Optional) If using analog battery measurement, set #define BATTERY_ANALOG_ON to 1 in MenuFunctions.h.
      • Connect ESP32, select the correct COM port, and select LOLIN D32 under Tools > Boards.
      • Click ESP32 Sketch Data Upload to upload SPIFFS data.
      • Click the Upload button to flash the firmware.
  10. Get started with ESP32 Marauder

    master

    ESP32 Marauder is a suite of WiFi and Bluetooth offensive and defensive tools designed for the ESP32 platform. To begin using the project, download the latest firmware release from the official GitHub releases page.

    Download the latest release from: https://github.com/justcallmekoko/ESP32Marauder/releases/latest
  11. DIY Hardware Connections for ESP32 Marauder

    master

    To build a DIY ESP32 Marauder, connect a 2.8" TFT Touch Screen (with ili9341) to an ESP32 development board using the following pin mapping. Note that you may need to consult your specific ESP32 board's pinout.

    ComponentSignalESP32 GPIO
    TFT ScreenVCCVCC
    GNDGND
    CSGPIO17
    RESETGPIO5
    D/CGPIO16
    SD CardMOSIGPIO23
    SCKGPIO18
    MISOGPIO19
    CSGPIO12
    TFT TouchT_CLKGPIO18
    T_CSGPIO21
    T_DIGPIO23
    T_DOGPIO19
    OtherLEDGPIO32

    Battery Circuitry:

    • Analog Battery Measurement: Use a 4 to 1 voltage divider and an optional MOSFET. Connect BATTERY + to GPIO34 and MOSFET to GPIO13.
    • Charge Detection (Optional): Use a 1 to 2 voltage divider. Connect CHARGE + to GPIO27.
    | SD Card | 2.8" TFT | ESP32  |
    | ------- | -------- | ------ |
    |         | VCC      | VCC    |
    |         | GND      | GND    |
    |         | CS       | GPIO17 |
    |         | RESET    | GPIO5  |
    |         | D/C      | GPIO16 |
    | SD_MOSI | MOSI     | GPIO23 |
    | SD_SCK  | SCK      | GPIO18 |
    |         | LED      | GPIO32 |
    | SD_MISO | MISO     | GPIO19 |
    |         | T_CLK    | GPIO18 |
    |         | T_CS     | GPIO21 |
    |         | T_DI     | GPIO23 |
    |         | T_DO     | GPIO19 |
    |         | T_IRQ    |        |
    | SD_CS   |          | GPIO12 |