Code Monkey home page Code Monkey logo

wud-ducky's Introduction

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.

wud-ducky's People

Contributors

tobozo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wud-ducky's Issues

Help with build

Hello,

I'm trying to use the project, but none of the versions are working for me (arduino-esp32-2.0.2 / arduino-esp32-2.0.3-RC1), as soon as I access the web page and it tries to load the files, the hardware restarts , could you make an already compiled version available? Or help me? Thanks.

Hardware Requirements

Do you NEED to have a micro sd? I would love to try this out but I only have the esp32-wroom-32d.

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.

Keyboard not working in Chrome OS

Can send mouse commands to ducky plugged into chromebook/box but cant send any keyboard commands at all.

I am using the arduino-esp32-2.0.2 branch

payloads

image
how do i send multiple characters at once? it only lets me send one at once.
can i not use a sd card? and upload payloads to the internal storage?
image
but uploading does not work, it shows upload i select file, press upload, but nothing gets uploaded,
image
i upload but nothing new
image
unless its not used for that.
sorry for the dumb questions

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.

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.

#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

'USB_VID' was not declared in this scope

I am trying to flash from active branch, and getting this error, 'USB_VID' was not declared in this scope.

How can I fix this?

The main branch does flashes successfully and wifi becomes available but webpage is not accessible at 192.168.4.1.

Help needed - SD card, Bootloader mode & run payload

Hi, I don't know if it is an issue or just my limited understanding. But, as there is no other help available, I would like to ask for your support here.

I use Cactus WHID and inserted SD card. I use WUD-Ducky for esp32-3.0.2-RC1.

  1. SD Card
    Even though reading through all articles here, I don't find a way to get SD card working in visible in Windows Explorer as USB drive. What am I missing / doing wrong? Do I need to adapt the code even?
  2. Bootloader mode
    I put WHID in Bootloader mode using magnet for hall sensor and reset button. I manage to upload the sketch. However, whenever I put the USB stick in any PC, it starts in bootloader mode. I have to press reset button before it starts correctly. How could I change?
  3. Run Payload automatically
    I would like to simulate autostart functionality. What do I need to do to provide a payload that starts automatically?

Please apologize if the topics would be misplaced here. Happy to get in contact with you (i.e., anybody who could support me) otherwise.

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: 

Unable to upload on the WUD

Hello,
I just received the April Brothers WUD (ESP32-S2) and tried to flash this repo on it.
So far I downloaded all dependencies, select 'ESP32-S2 Dev Module' Board and was able to verify the 'WUD-Ducky.ino'.

However when I try to upload it on the WUD, I get this error message :

Sketch uses 953934 bytes (72%) of program storage space. Maximum is 1310720 bytes.
Global variables use 57208 bytes (17%) of dynamic memory, leaving 270472 bytes for local variables. Maximum is 327680 bytes.
esptool.py v3.1
Serial port /dev/cu.Bluetooth-Incoming-Port
Connecting........_____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to ESP32-S2: Timed out waiting for packet header
Failed uploading: uploading error: exit status 2 

I am not able to detect the WUD in DFU mode with dfu-util -l wether I'm pressing the RST button and applying a magnet on the ESP32-S2 module.

I'm running on a M1 Macbook Pro (Ventura 13.1).

Can you guys help me with what I'm doing wrong here ?

Thanks a lot and have a nice day !

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.