An USB Rubberducky example for ESP32-S2 module with SD Card 🦆

Overview

ESP32-S2 WUD-Ducky

This project is an attempt to add USB HID to the default example provided with @AprilBrother's WUD (*), however it also supports any ESP32-S2 equipped with a SD Card.

The default platformio POC coming with the WUD has been extended to support HID Composite (Keyboard+Mouse) and implements a payload parser. The payload syntax is heavily inspired by whid-injector and wifi_ducky.

Features

  • Dongle is detected as composite HID (Mouse and Keyboard) + USB Pendrive
  • Mounted MicroSD card allows editing files from the OS (**)
  • Starts WiFi in AP Mode
  • Runs a Webserver with the following endpoints:
    • /key send string sequence to the keyboard
    • /list list available files on the SD Card
    • /runpayload run ducky script from the SD Card
    • /delete delete a file on the SD Card (**)
    • /upload upload a file to the SD Card (**)
    • /* serves the file (e.g. index.html) from SPIFFS if it exists

(**) Changes on the SD Card made from the USB Pendrive aren't immediately accessible by the ESP32-S2's SD.read(), and vice-versa, so it is recommended to make a full power cycle after either changes are applied. This is due to the fact that USB Pendrive accesses the SD Partition using SD.rawRead and SD.rawWrite, and the lack of callable flushing methods with SD once the raw changes affect the file allocation table. Hopefully this will be fixed in the future, but it still wasn't at the time this readme file was written (2021:09:27).

WUD w00t?

WUD is the recursive acronym for WiFi USB Disk: it is an ESP32-S2 dongle made by @AprilBrother with a Micro SDCard slot hidden in the USB port.

See the wiki page for more info.

WUD Product image

Hardware/software Requirements:

Why Arduino?

  • Because platformio POC only works with older packages e.g. EspTinyUSB 1.2.0 / idf 4.2
  • Because I'm lazy

Roadmap

  • Improved payload parser
  • Improved web UI
  • Add RNDIS/CDC-ECM (network interface)

Credits:

Special thanks to @chegewara for helping me with this project and maintaining the awesome ESPTinyUSB library.

Issues
  • Theres nothing working properly!

    Theres nothing working properly!

    After trying flashing in 5 diferent SD cards, it was impossible for me to be able to make my WUD work. When I create or modify any file directly form Windows, the SD randomly crash and it can be used again till I flash the ino again. Also, I dont know hot to send commands via key or runpayload, it keeps saying FileNotFound or MISSING ARGS, no matter what I write in the endpoint. I think theres a litte bit of info measing, something like a setup and first use tutorial should be added to the redme, if not users with no such a big experience as me will be a bit lost and frustrated.

    opened by m00nbyt3 51
  • SD Card Mount Failed

    SD Card Mount Failed

    I'm trying to upload files to SD card. When I switch to sd card, I get mount failed error. I am using 32GB SanDisk card in FAT32 format and it works fine in card reader.

    What could be wrong?

    Here's relevant log from system log:

    [@00:00:01.952] SD Card Mount attempt: 0
    [@00:00:02.652] SD Card Mount attempt: 1
    [@00:00:03.352] SD Card Mount attempt: 2
    [@00:00:04.052] SD Card Mount attempt: 3
    [@00:00:04.752] SD Card Mount attempt: 4
    [@00:00:05.452] SD Card Mount attempt: 5
    [@00:00:06.152] SD Card Mount attempt: 6
    [@00:00:06.852] SD Card Mount attempt: 7
    [@00:00:07.552] SD Card Mount attempt: 8
    [@00:00:08.252] SD Card Mount attempt: 9
    [@00:00:08.952] SD Card Mount attempt: 10
    [@00:00:09.652] SD Card Mount attempt: 11
    [@00:00:09.752] SD Card Mount Failed
    [@00:00:09.752] Error, PenDrive disabled
    [@00:00:09.752] SD Card not present, spawning fake partition
    [@00:00:09.752] USB already started
    [@00:00:14.783] Pref defaulted: AP_SSID='WUD-01' (default='WUD-01')
    [@00:00:14.784] Pref defaulted: 
    
    opened by Ciph3rCat 3
  • Supports arduino-cli

    Supports arduino-cli

    I added supports for arduino-cli.

    How to compile with arduino-cli

    • Install arduino-cli
    • Install esp32 arduino core with command
    arduino-cli core update-index
    arduino-cli core install esp32:esp32
    
    • Compile code with command
    arduino-cli compile .
    
    • Upload firmware
    arduino-cli upload -p /dev/cu.usbmodem01
    

    See Makefile for more details

    opened by volca 2
  • Added CSS Directives

    Added CSS Directives

    Changes to index.h:

    CSS policies were added for a more intuitive and user-friendly web interface. Responsive CSS policies were also added to be able to use this from mobile phones, so you can carry your Payloads on the mobile phone and not worry if the SD was detected correctly on the Victim PC. Some tables have also been modified to make them visually look good.

    I have also created 2 test Payloads for Linux (tested on Kali Linux with KDE Plasma), In these Scripts it would be better to change console to ALT+F2, to run in the background. But the "Press" command doesn't seem to work, or I'm not typing the key codes right.

    opened by j1t077 1
  • #error

    #error "Invalid esp32-core version (expected 2.0.0)"

    it says i dont have esp32 2.0.0 but I do I just want this to work because obviously the default usb-wireless-disk doesnt have any uses whatsoever. Ive been stuck with this thing for weeks ... I really want to make it work. I was reading a thread of yours and you said you dont think a tutorial is needed. but dude I NEED ONE. or if you could help me. I'm new to this sort of thing and would really like it if you could help me SOS

    -thank you

    opened by Sewpee 4
  • SD Card Error

    SD Card Error

    [@00:26:21.510] Error, PenDrive disabled
    [@00:26:33.033] PenDrive already started
    [@00:26:38.510] SD Card Mount attempt: 0
    [@00:26:38.629] SD Card Mount attempt: 1
    [@00:26:38.745] SD Card Mount attempt: 2
    [@00:26:38.861] SD Card Mount attempt: 3
    [@00:26:38.977] SD Card Mount attempt: 4
    [@00:26:39.093] SD Card Mount attempt: 5
    [@00:26:39.209] SD Card Mount attempt: 6
    [@00:26:39.325] SD Card Mount attempt: 7
    [@00:26:39.442] SD Card Mount attempt: 8
    [@00:26:39.558] SD Card Mount attempt: 9
    [@00:26:39.674] SD Card Mount attempt: 10
    [@00:26:39.791] SD Card Mount attempt: 11
    [@00:26:39.890] SD Card Mount Failed
    [@00:26:39.891] Error, PenDrive disabled 
    [@00:28:22.527] LittleFS failed!
    

    I used the commands included in the menu to start both SD and LitleFS without success. I tried the commands after seeing in the info menu : image

    I am currently unable to upload files from WebUI and the volume : image Neither can I see my SD card

    opened by Compr0mzd 1
  • compilation error

    compilation error

    Hello, Let's see if anyone can help me, I'm stuck in the compilation. I'm a beginner and I can't solve it. I get this error when compiling;

    In file included from C:\Users\BMG\Documents\Arduino\libraries\WUD-Ducky-main/WebServer.h:30, from C:\Users\BMG\Documents\Arduino\libraries\WUD-Ducky-main/WebServer.h:30, from C:\Users\BMG\Documents\Arduino\libraries\WUD-Ducky-main/WebServer.h:30, from C:\Users\BMG\Documents\Arduino\libraries\WUD-Ducky-main\WUD-Ducky\WUD-Ducky.ino:39: C:\Users\BMG\Documents\Arduino\libraries\WUD-Ducky-main/WebServer.h:27:18: error: #include nested too deeply #include <WiFi.h> ^ C:\Users\BMG\Documents\Arduino\libraries\WUD-Ducky-main/WebServer.h:28:24: error: #include nested too deeply #include <WiFiClient.h> ^ C:\Users\BMG\Documents\Arduino\libraries\WUD-Ducky-main/WebServer.h:29:20: error: #include nested too deeply #include <WiFiAP.h> ^ C:\Users\BMG\Documents\Arduino\libraries\WUD-Ducky-main/WebServer.h:30:23: error: #include nested too deeply #include <WebServer.h> ^ C:\Users\BMG\Documents\Arduino\libraries\WUD-Ducky-main/WebServer.h:31:20: error: #include nested too deeply #include <SPIFFS.h> In file included from C:\Users\BMG\Documents\Arduino\libraries\WUD-Ducky-main/WebServer.h:30, from C:\Users\BMG\Documents\Arduino\libraries\WUD-Ducky-main/WebServer.h:30, from C:\Users\BMG\Documents\Arduino\libraries\WUD-Ducky-main/WebServer.h:30, from C:\Users\BMG\Documents\Arduino\libraries\WUD-Ducky-main/WebServer.h:30, from C:\Users\BMG\Documents\Arduino\libraries\WUD-Ducky-main\WUD-Ducky\WUD-Ducky.ino:39: C:\Users\BMG\Documents\Arduino\libraries\WUD-Ducky-main/WebServer.h:31:10: fatal error: SPIFFS.h: No such file or directory #include <SPIFFS.h> ^~~~~~~~~~ compilation terminated.

    opened by andonicio 0
  • HID Timed out when using mouse or keyboard when payload running

    HID Timed out when using mouse or keyboard when payload running

    Hello, finally I can run WUD-Ducky with ESP32 package 2.0.3-RC1. But I have big problem using mouse or keyboard when running payload. The server stuck at HID Timed out like forever. How can I fix this?

    opened by maytinh365 3
  • Uploading files to SD card

    Uploading files to SD card

    Although I'm having problem in mounting SD card which is explained in other ticket. The upload functionality works fine for internal storage. We can upload files from the device which is connected using wifi.

    My question is, how can we upload files from the system where this device is connected?

    Hopefully question is clear but let me know, if you want an example or more elaboration.

    opened by Ciph3rCat 7
Releases(v0.0.2)
Owner
tobozo
≡ᗤ- I'm the Bozo ෴ bit in your Bogon. DIY IoT/WoT tinkerer, JS/PHP freestack dev, C/C++ novice and tech lover
tobozo
ESP32 software USB host through general IO pins. We can connect up to 4 USB-LS HID (keyboard mouse joystick) devices simultaneously.

esp32_usb_soft_host esp32 USB-LS pure software host thru general IO pins. Up to 4 HID devices simultaneously. board ~$3 :https://www.aliexpress.com/pr

Samsonov Dima 263 Jun 30, 2022
An unofficial Realtek PCIe/USB-based SD card reader driver for macOS

Realtek Card Reader Driver for macOS Unleash the full potential of your SDXC UHS-I cards Introduction An unofficial macOS kernel extension for Realtek

FireWolf 126 Jun 15, 2022
Example-application - Example out-of-tree application that is also a module

Zephyr Example Application This repository contains a Zephyr example application. The main purpose of this repository is to serve as a reference on ho

Zephyr Project 64 Jun 22, 2022
ESP32-Skid-Steer - Bruder Catepillar Skid Steer model converted to RC, controlled by an ESP32 with 2 analog joysticks and a receiver that is an ESP32 on the model.

ESP32-Skid-Steer Bruder Catepillar Skid Steer model converted to RC, controlled by an ESP32 with 2 analog joysticks and a receiver that is an ESP32 on

null 5 Feb 4, 2022
ESP8266 software USB host through general IO pins. We can connect up to 2 USB-LS HID (keyboard mouse joystick) devices simultaneously.

esp8266_usb_soft_host Test for esp8266 usb host . Works with ESP-IDF v3.4 80MHz and 160MHz. WorkInProgress Test run with mouse & combined mouse & keyb

Samsonov Dima 25 Apr 21, 2022
Tiny and portable usb host and device stack for mcu with usb ip

Tiny and portable usb host and device stack for mcu with usb ip

sakumisu 364 Jun 28, 2022
USB-C_PCB_experiments - USB-C ports made from a flex PCB and an ATtiny84A

USB-C PCB Experiments This is part of an ongoing series of projects involving creative interpretations of the USB mechanical standards. You've probabl

Sam Ettinger 22 May 21, 2022
Anotter USB temperature logger that can record up to four channels with thermocouple or NTCs connected via CDC directly or SCPI to USB.

temperature-logger Anotter USB temperature logger that can record up to four channels with thermocouple or NTCs connected via CDC directly or SCPI to

Jana Marie Hemsing 47 Apr 6, 2022
esp32S2 USB HID host example.

Simple usb host HID example Since usb host support is still beta stage and include file is in private_include i copied component to this example. Code

null 14 Jun 11, 2022
USB to interfaces implementing MicroPython "machine" module functionalities on a computer.

u2if project u2if(USB to interfaces) is an attempt to implement some of the MicroPython "machine" module functionalities on a computer. The goal is to

null 90 Jun 23, 2022
An IOS module that fakes Wiimotes from the input of USB game controllers

fakemote An IOS module that fakes Wiimotes from the input of USB game controllers. Supported USB game controllers Device Name Vendor Name Vendor ID Pr

Sergi Granell 76 Jun 24, 2022
Müsli USB Pmod-compatible module

Müsli USB Pmod™ compatible module Overview Müsli is a 12-pin Pmod™ compatible module with a RP2040 MCU and a USB type A port. Müsli can be configured

Machdyne 6 Apr 14, 2022
ESP32 based USB C Programmable Power Supply

ESP32 USB-C Power Supply The idea for this ESP32 usb-c power supply project came to me when I discovered that components exist that communicate to par

Mike Rankin 124 Jun 23, 2022
ESP32 S2 USB host with examples.

This new USB host library based is based on changed and hopefully somehow final API from espressif. The idea is to make this library usable with esp-i

null 17 Jun 17, 2022
ESP32 + Arducam Mini 2MP Plus Edge Impulse Example

Minimal example code for running an Edge Impulse image classification network with the ESP32, ArduCAM, and PlatformIO

David Schwarz 6 Apr 23, 2022
ESP32, ESP8266 based MIDI Organ using the ML_SynthTools library (little example arduino project)

esp32_esp8266_organ ESP32, ESP8266 based MIDI Organ using the ML_SynthTools library (little example arduino project) link to the video The required li

Marcel 11 Jun 6, 2022
ESP32, ESP8266 based MIDI Organ using the ML_SynthTools library (little example arduino project)

ml_synth_organ_example MIDI Organ using the ML_SynthTools library (little example arduino project) link to the video This project is an example suppor

Marcel 11 Jun 6, 2022
Example code for collecting weather data from an ESP32 and then uploading this data to InfluxDB in order to create a dashboard using Grafana.

InfluxGrafanaTutorial Example code for collecting weather data from an ESP32 and then uploading this data to InfluxDB in order to create a dashboard u

Michael Klements 5 May 12, 2022
A laser cut Dreamcast Pop'n Music controller and integrated memory card using the Raspberry Pi Pico's Programmable IO

Dreamcast Pop'n Music Controller Using Raspbery Pi Pico (RP2040) Intro This is a homebrew controller for playing the Pop'n Music games on the Sega Dre

null 31 Jun 6, 2022