diff --git a/README.md b/README.md index e0f2006..2c052d9 100644 --- a/README.md +++ b/README.md @@ -1,139 +1,169 @@ -# WiFiDuck +# WiFi Duck
- +
+* [About](#about) +* [Usage](#usage) +* [Support us](#support-us) +* [Buy Hardware](#buy-hardware) + + [Malduino W](#malduino-w) + + [DSTIKE WiFi Duck](#dstike-wifi-duck) +* [DIY Hardware](#diy-hardware) + + [Atmega32u4 Development Boards](#atmega32u4-development-boards) + + [ESP8266 Development Boards](#esp8266-development-boards) + + [Connections](#connections) + + [PCB](#pcb) +* [Flash Software](#flash-software) + + [Flash Atmega32u4](#flash-atmega32u4) + + [Flash ESP8266](#flash-esp8266) + + [Unbrick Atmega32u4](#unbrick-atmega32u4) +* [Scripting](#scripting) + + [Basics](#basics) + + [Functions](#functions) + + [Standard Keys](#standard-keys) + + [Modifier Keys](#modifier-keys) + + [Other Keys](#other-keys) + + [Examples](#examples) +* [CLI Commands](#cli-commands) + + [General](#general) + + [SPIFFS File Management](#spiffs-file-management) +* [How to Debug](#how-to-debug) +* [Development](#development) + + [Edit Web Files](#edit-web-files) + + [Translate Keyboard Layout](#translate-keyboard-layout) +* [Disclaimer](#disclaimer) +* [License](#license) +* [Credits](#credits) + +## About + +This open-source project aims to provide a user-friendly tool to learn about keystroke injection attacks and 'BadUSBs'. + +By emulating a USB keyboard, tools like this can gain full access to any computer with a USB port in a matter of seconds! +This is made possible by the fact that keyboards are trusted by computers. You can have full control over a computer with just a keyboard. +A BadUSB pretends to be a keyboard to the computer to send keystrokes. +But unlike a human, it can type hundreds of characters per second. +By using a simple scripting language, it's easy to make BadUSBs type whatever you want. + +With the WiFi Duck, you can simply connect via WiFi to manage all scripts +from within a web interface. This means that, unlike other BadUSBs, you don't need to install an app, log in, compile or copy scripts to an SD card. + +## Usage +
-Keystroke injection attack platform
-
-A worthy successor of the WiFi Ducky project
-
-
- đĻ Twitter
-| đē YouTube
-| đ spacehuhn.io
-
-
-
-
-
-
-
-
-
-
-Watch the full video
+
+
+
+ Watch the full video
+
+
+
+
+ Go to Maltronics.com
+
+
+
+
+
+ Watch the video tutorial
+
+
+ +
+ ++ +
Design Files: * Pro Micro + Wemos d1 mini: https://easyeda.com/Spacehuhn/wifi-duck @@ -182,50 +224,15 @@ You can also order them on OSHPark: * Pro Micro + Wemos d1 mini: https://oshpark.com/shared_projects/ARCED9je * Pro Micro + NodeMCU: https://oshpark.com/shared_projects/XUuUH1HB -You'll have to solder a Pro Micro board on one side and a Wemos d1 mini -or NodeMCU board (depending on the PCB) on the other side. -That's it. -You don't even have to solder all pins, -just the ones mentioned in [Connections](#connections), excluding the LED. - -![Preview of Pro Micro + Wemos d1 mini PCB](img/pcbs.jpg) -![Soldered PCB](img/pcbs_soldered.jpg) - -### DSTIKE WiFi Duck - -If you like to support this project, -Travis Lin sells a custom designed development board which comes preflashed with this software! - - - -You can purchase one here: -- [tindie](https://www.tindie.com/products/lspoplove/dstike-wifi-duck/) -- [DSTIKE](https://dstike.com/products/dstike-wifi-duck) -- [AliExpress](https://www.aliexpress.com/item/4000256143274.html) - -You can update the ESP8266 over the air and flash the Atmega32u4 via Arduino, -all while enclosed in its neat little case. - -[Update Tutorial Video](https://youtu.be/e3-nsOjclsY) - -If you wish to develop your own software or help improve this one, -the 8-bit DIP-switch makes it easy for you to access the Atmega32u4 or ESP8266 independently. - -To flash it see [Flash Software](#flash-software). -Or select `Arduino Leonardo` for the Atmega32u4 -and `NodeMCU 1.0 (ESP-12E Module)` for the ESP8266. - -| Mode | Atmega32u4 | ESP8266 | DIP-switch | Image | -| --- | --- | --- | --- | --- | -| Default Operating Mode | USB | On | 10101101 | | -| Atmega32u4 Flash Mode | USB | Off |10101010 | | -| ESP8266 Flash Mode | Off | USB | 01011101 | | - ## Flash Software -[Video Tutorial](https://youtu.be/VQAzxBefLZo) - -### Preparations + 1. Download and install the [Arduino IDE](https://www.arduino.cc/en/main/software). 2. Start the Arduino IDE, go to `File` > `Preferences`. @@ -235,8 +242,8 @@ and `NodeMCU 1.0 (ESP-12E Module)` for the ESP8266. If you can't find the COM port of ESP8266 board, then you're probably missing the right drivers. Here are links to drivers of the 2 most used UART chips on ESP8266 development boards: -- đž [CP2102](https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers) -- đž [CH340](https://sparks.gogo.co.nz/ch340.html) +- :floppy_disk: [CP2102](https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers) +- :floppy_disk: [CH340](https://sparks.gogo.co.nz/ch340.html) ### Flash Atmega32u4 @@ -244,7 +251,7 @@ Here are links to drivers of the 2 most used UART chips on ESP8266 development b 2. Under `Tools` > `Board` in the `WiFi Duck AVR` section, select your board; for example, `Sparkfun Pro Micro`. 3. Connect the Atmega32u4 board via USB and select its port under `Tools` > `Port`. -4. [Optional] Under `Tools` you can enable the LED and set its pin. +4. Optional: Under `Tools` you can enable the LED and set its pin. You can also change the USB ID to make it appear as a certain type of keyboard. 5. Press Upload. @@ -258,13 +265,11 @@ For example `NodeMCU 1.0 (ESP-12E Module)`. **Pro Tip:** If the ESP8266 is already running this software and you just want to update it, you don't have to connect it via USB. -You can update it over the air! Simply connect to the Wi-Fi network its hosting -(default SSID and password is `wifiduck`). -In Arduino under `Tools` > `Port` you should now see a network port. +You can update it over the air! Simply connect to the `wifiduck` network (default password is `wifiduck`). +Then in Arduino at `Tools` > `Port` you should now see a network port. Select it and press `Upload`. -**Note:** It can take a minute until the device is ready. -After the initial flashing, the ESP8266 has to format its memory. +**Note:** After the initial flashing, the ESP8266 has to format its memory, so it might take a minute until it's fully ready. If you connected the RGB LED: * Blue LED = Connection working @@ -272,7 +277,7 @@ If you connected the RGB LED: ### Unbrick Atmega32u4 -If you flashed your Atmega32u4 board with the wrong bootloader, +If you flashed your Atmega32u4 board with the wrong bootloader, it will no longer appear in the port selection after you connect it. To solve this, you need to: @@ -285,22 +290,14 @@ Preferably with a jumper wires, because you need to be able to disconnect it qui Now it should flash the sketch and the correct bootloader. -## Usage +## Scripting -1. Plug it in. -2. Connect to the WiFi network `wifiduck` with the password `wifiduck`. -3. Open a browser and visit `192.168.4.1`. -4. Click on `Settings` in the top right corner. -5. Change the SSID and password. -6. Go back to write, save and run your first Ducky Script! - -### Ducky Script - -#### Basics +### Basics Keys are separated by a single space. -Everything written in a single line gets pressed and released at the same time. +Everything written in a single line gets pressed and released at the same time. To write text, use the STRING function. +It's compatible to Ducky Script, which was developed by the wonderful people at [Hak5](https://www.hak5.org/). | Example | Explanation | | ------- | ----------- | @@ -308,7 +305,7 @@ To write text, use the STRING function. | WINDOWS r | Press the Windows key and the r key simultaneously | | STRING WINDOWS r | Write WINDOWS r | -#### Functions +### Functions | Command | Example | Description | | ------- | ------- | ----------- | @@ -321,7 +318,7 @@ To write text, use the STRING function. | `KEYCODE` | `KEYCODE 0x02 0x04` | Types a specific key code (modifier, key1[, ..., key6]) in decimal or hexadecimal | | `LED` | `LED 40 20 10` |Changes the color of the LED in decimal RGB values (0-255) | -#### Standard Keys +### Standard Keys | Key | | --- | @@ -330,7 +327,7 @@ To write text, use the STRING function. | `0` - `9` | | `F1` - `F12` | -#### Modifier Keys +### Modifier Keys | Key | | --- | @@ -339,7 +336,7 @@ To write text, use the STRING function. | `ALT` | | `WINDOWS` or `GUI` | -#### Other Keys +### Other Keys | Key | | --- | @@ -364,7 +361,7 @@ To write text, use the STRING function. | `PRINTSCREEN` | | `SCROLLLOCK` | -#### Examples +### Examples ``` REM Hello World for Windows PCs @@ -375,11 +372,11 @@ ENTER STRING Hello World! ``` -### CLI +## CLI Commands The command line interface or CLI is accessible using a serial connection to the ESP8266 (115200 baud, Newline ending) or via the web interface at `192.168.4.1/terminal.html`. -#### General +### General | Command | Description | Example | | ------- | ----------- | ------- | @@ -393,7 +390,7 @@ The command line interface or CLI is accessible using a serial connection to the | run <...> | Starts executing a Ducky script | `run example.txt` | | stop <...> | Stops executing a Ducky script | `stop example.txt` | -#### SPIFFS File Management +### SPIFFS File Management | Command | Description | Example | | ------- | ----------- | ------- | @@ -411,7 +408,7 @@ The command line interface or CLI is accessible using a serial connection to the If a stream is open, everything you type (except messages containing exactly `close` or `read`) will be written to the file until you type `close`! -### Debug +## How to Debug To properly debug, you need to have both the Atmega32u4 and the ESP8266 connected via USB to your computer. @@ -424,18 +421,6 @@ Now open 2 instances of Arduino (so they run as separate processes!), select the COM port and open the serial monitor for each device. You might need to reset the Atmega32u4 to see serial output. If that causes problems with the i2c connection, try to reset the ESP8266 too. - -### FAQ - -If you have a question, you can check out the [issue section](https://github.com/spacehuhn/WiFiDuck/issues). -Use the search function to look up similar questions, be sure to check both open and closed issues! -Also watch this [video](https://www.youtube.com/watch?v=53zkBvL4ZB4) by LiveOverflow on "How (not) to ask a technical question". - -#### I forgot the password - -Flash the ESP8266 again, but make sure that you select `Erase Flash: Sketch + WiFi Settings` -under Tools in the Arduino IDE. - ## Development ### Edit Web Files @@ -454,16 +439,16 @@ Now you just need to [flash](#flash-software) the ESP8266 again. ### Translate Keyboard Layout Currently supported keyboard layouts: -- [DE](https://github.com/spacehuhn/WiFiDuck/blob/master/atmega_duck/locale_de.h) -- [GB](https://github.com/spacehuhn/WiFiDuck/blob/master/atmega_duck/locale_gb.h) -- [US](https://github.com/spacehuhn/WiFiDuck/blob/master/atmega_duck/locale_us.h) -- [ES](https://github.com/spacehuhn/WiFiDuck/blob/master/atmega_duck/locale_es.h) -- [DK](https://github.com/spacehuhn/WiFiDuck/blob/master/atmega_duck/locale_dk.h) -- [RU](https://github.com/spacehuhn/WiFiDuck/blob/master/atmega_duck/locale_ru.h) -- [FR](https://github.com/spacehuhn/WiFiDuck/blob/master/atmega_duck/locale_fr.h) -- [BE (ASCII only)](https://github.com/spacehuhn/WiFiDuck/blob/master/atmega_duck/locale_be.h) -- [PT (ASCII only)](https://github.com/spacehuhn/WiFiDuck/blob/master/atmega_duck/locale_pt.h) -- [IT](https://github.com/spacehuhn/WiFiDuck/blob/master/atmega_duck/locale_it.h) +- [:de: DE](https://github.com/spacehuhn/WiFiDuck/blob/master/atmega_duck/locale_de.h) +- [:gb: GB](https://github.com/spacehuhn/WiFiDuck/blob/master/atmega_duck/locale_gb.h) +- [:us: US](https://github.com/spacehuhn/WiFiDuck/blob/master/atmega_duck/locale_us.h) +- [:es: ES](https://github.com/spacehuhn/WiFiDuck/blob/master/atmega_duck/locale_es.h) +- [:denmark: DK](https://github.com/spacehuhn/WiFiDuck/blob/master/atmega_duck/locale_dk.h) +- [:ru: RU](https://github.com/spacehuhn/WiFiDuck/blob/master/atmega_duck/locale_ru.h) +- [:fr: FR](https://github.com/spacehuhn/WiFiDuck/blob/master/atmega_duck/locale_fr.h) +- [:belgium: BE (ASCII only)](https://github.com/spacehuhn/WiFiDuck/blob/master/atmega_duck/locale_be.h) +- [:portugal: PT (ASCII only)](https://github.com/spacehuhn/WiFiDuck/blob/master/atmega_duck/locale_pt.h) +- [:it: IT](https://github.com/spacehuhn/WiFiDuck/blob/master/atmega_duck/locale_it.h) All standard keys are defined in [usb_hid_keys.h](https://github.com/spacehuhn/WiFiDuck/blob/master/atmega_duck/usb_hid_keys.h). To translate a keyboard layout, you have to match each character on @@ -535,6 +520,13 @@ ENTER 10. Add a link to your layout to [README](README.md), to [web/index.html](web/index.html) and please feel free to improve this tutorial to help future translators! 11. [Create a Pull Request](https://help.github.com/en/articles/creating-a-pull-request) +## Disclaimer + +This tool is intended to be used for testing, training, and educational purposes only. +Never use it to do harm or create damage! + +The continuation of this project counts on you! + ## License This software is licensed under the MIT License. @@ -542,7 +534,7 @@ See the [license file](LICENSE) for details. ## Credits -Other software used for this project: +Software libraries used in this project: - [Arduino](https://www.arduino.cc) - [Neopixel Library](https://github.com/adafruit/Adafruit_NeoPixel) - [Dotstar Library](https://github.com/adafruit/Adafruit_DotStar) diff --git a/atmega_duck/config.h b/atmega_duck/config.h index c0a0f3f..50b41ea 100644 --- a/atmega_duck/config.h +++ b/atmega_duck/config.h @@ -5,7 +5,7 @@ #pragma once -#define VERSION "1.0.4" +#define VERSION "1.1.0" /* ===== Serial Bridge ===== */ // #define BRIDGE_ENABLE @@ -48,8 +48,8 @@ // #define LED_G 6 // #define LED_B 9 -//*! ===== Color Modes ===== */ -#define COLOR_ESP_UNFLASHED 0,0,255 +// *! ===== Color Modes ===== */ +#define COLOR_ESP_UNFLASHED 0, 0, 255 /*! ===== Parser Settings ===== */ #define CASE_SENSETIVE false diff --git a/esp_duck/config.h b/esp_duck/config.h index c041750..2c88cb0 100644 --- a/esp_duck/config.h +++ b/esp_duck/config.h @@ -5,7 +5,7 @@ #pragma once -#define VERSION "1.0.4" +#define VERSION "1.1.0" /*! ===== DEBUG Settings ===== */ // #define ENABLE_DEBUG diff --git a/img/malw.jpg b/img/malw.jpg new file mode 100644 index 0000000..a96fccf Binary files /dev/null and b/img/malw.jpg differ diff --git a/img/thumbnail.jpg b/img/thumbnail.jpg new file mode 100644 index 0000000..a51ad98 Binary files /dev/null and b/img/thumbnail.jpg differ diff --git a/img/usage.png b/img/usage.png deleted file mode 100644 index 2695535..0000000 Binary files a/img/usage.png and /dev/null differ