Giter Club home page Giter Club logo

wifiduck's Introduction

WiFi Duck

WiFi Duck Logo

👉 Visit wifiduck.com for an improved documentation.

Want to learn more about BadUSBs? Check out our online course: learnbadusb.com


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

WiFi Duck Video Thumbnail
Watch the full video

  1. Plug in your WiFi Duck
  2. Connect to the WiFi network wifiduck with the password wifiduck
  3. Open a browser and visit 192.168.4.1
  4. Write, save and run your first Ducky Script
  5. [Recommended] Open Settings (top right corner) and update SSID and password

Help I forgot the password: Flash the ESP8266, but make sure that you select Erase Flash: Sketch + WiFi Settings under Tools in the Arduino IDE.

If you have further questions, check out the issue section.

Support us

Hey, do you like this kind of project?
It took a huge amount of effort to create!

To make sure we can keep working on free and open-source projects like this,
please consider becoming a ❤️ Sponsor or support us via ☕ Ko-fi.

Visit spacehuhn.com to learn more about us. 🐔

Buy Me a Coffee at ko-fi.com

Buy Hardware

Malduino W

Malduino W
Go to Maltronics.com

A nicely encased, inconspicuous looking BadUSB by Maltronics.
Having USB-A and USB-C makes it compatible with all kind of devices.
It comes flashed with the WiFi Duck firmware and works plug and play.
ℹ️ Documentation can be found here

DSTIKE WiFi Duck

DSTIKE WiFi Duck
Got to DSTIKE.com

A custom designed development board which comes preflashed with this software by Travis Lin.

You can update the ESP8266 over the air and flash the Atmega32u4 via Arduino, all while enclosed in its neat little case.
📺 Watch the How to Update Tutorial here.

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. For more info see Flash Software.

Mode Atmega32u4 ESP8266 DIP-switch Image
Default Operating Mode USB On 10101101 dstike wifi duck work mode
Atmega32u4 Flash Mode USB Off 10101010 dstike wifi duck atmega mode
ESP8266 Flash Mode Off USB 01011101 dstike wifi duck esp8266 mode

DIY Hardware

WiFi Duck Hardware Tutorial Video Thumbnail
Watch the video tutorial

To build a WiFi Duck yourself, you need the following hardware:

  • An Atmega32u4 development board (see the list below)
  • An ESP8266 or ESP8285 development board (see the list below)
  • Optional: A single Neopixel (WS2812b) or Dotstar (APA102) LED

To flash the microcontrollers you need a computer and USB cable.

If you're a beginner, it's recommended you wire everything together on a breadboard first!
In this case, you'd also need a breadboard with a couple of jumper wires.

If you wish to solder everything together into a small gadget, you also need soldering equipment.

You can use any Atmega32u4 or ESP8266 based development board, but if you have no idea where to start, here's a list.
⚠️ Keep in mind that you will need both microcontrollers!
The Atmega32u4 to act as USB keyboard, and the ESP8266 for WiFi.

Atmega32u4 Development Boards

  • Arduino Leonardo
  • Arduino Micro
  • Sparkfun Pro Micro
  • CJMCU Beetle
  • SS Micro

‼️ DIGISPARK or other ATTINY85 based development boards, are NOT supported! ‼️

ESP8266 Development Boards

  • NodeMCU 1.0 (ESP-12E Module)
  • LOLIN(WEMOS) D1 Mini
  • LOLIN(WEMOS) D1 Mini Pro
  • LOLIN(WEMOS) D1 Mini Lite

Connections

A map of pins that need to be connected.

ESP8266 Atmega32u4
D1 alias GPIO 5 3 alias SCL
D2 alias GPIO 4 2 alias SDA
GND GND

Ideally, you want the Atmega32u4 to power the ESP8266, so it can run on one USB connection, instead of having to always plug in both.
To share power between both chips, you need a voltage regulator that takes 5V and turns it into 3.3V.
That's because USB runs on 5V, but the ESP8266 only takes 3.3V. Luckily most development boards have such a regulator on board.
DO NOT CONNECT ESP8266 VCC to the ATMEGA32u4 VCC, it will kill the ESP826. Instead look for the 5V or VIN pin on your dev board, as those will be connected to the regulator.

ESP8266 Dev Board Atmega32u4
5V or VIN RAW, 5V or VIN

To add a Neopixel (WS2812b) LED:

Atmega32u4 Neopixel LED
7* DI alias Data, In
5V alias VCC 5V alias VCC
GND GND

* The Data pin can be changed later on in the software, pin 7 is just an example.

Example of a DIY build using a Wemos d1 mini, a Pro Micro and a Neopixel LED

PCB

To make the DIY process easier, I designed a little PCB.

You 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, excluding the LED.

PCB Layout

Soldered PCBs

Design Files:

You can also order them on OSHPark:

Flash Software

WiFi Duck Hardware Tutorial Video Thumbnail
Watch the video tutorial

  1. Download and install the Arduino IDE.
  2. Start the Arduino IDE, go to File > Preferences.
  3. At Additional Board Manager ULRs enter https://raw.githubusercontent.com/SpacehuhnTech/arduino/main/package_spacehuhn_index.json. You can add multiple URLs, separating them with commas.
  4. Go to Tools > Board > Board Manager, search for wifi duck and install WiFi Duck AVR Boards and WiFi Duck ESP8266 Boards.
  5. Download and extract this repository or git clone it.

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:

Flash Atmega32u4

  1. Open atmegaduck/atmega_duck.ino with the Arduino IDE.
  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. You can also change the USB ID to make it appear as a certain type of keyboard.
  5. Press Upload.

Flash ESP8266

  1. Open esp_duck/esp_duck.ino with the Arduino IDE.
  2. Under Tools > Board in the WiFi Duck ESP8266 section, select your board. For example NodeMCU 1.0 (ESP-12E Module).
  3. Connect the ESP8266 board via USB and select its port under Tools > Port.
  4. Press Upload.

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 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: 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
  • Green LED = Device ready

Unbrick Atmega32u4

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:

  1. Connect the reset pin RST to ground GND. Preferably with a jumper wires, because you need to be able to disconnect it quickly.
  2. Open a sketch, atmegaduck/atmega_duck.ino or an empty sketch.
    Make sure to have the correct board selected under Tools > Board!
  3. Connect the board with the wire still connected.
  4. Press Upload and as soon as you see Compiling... turn to Uploading..., disconnect the wire.

Now it should flash the sketch and the correct bootloader.

Scripting

Basics

Keys are separated by a single space.
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.

Example Explanation
WINDOWS
r
Type the Windows key and then the r key
WINDOWS r Press the Windows key and the r key simultaneously
STRING WINDOWS r Write WINDOWS r

Functions

Command Example Description
REM REM Hello World! Comment
DEFAULTDELAY or DEFAULT_DELAY DEFAULTDELAY 200 Time in ms between every command
DELAY DELAY 1000 Delay in ms
STRING STRING Hello World! Types the following string
REPEAT or REPLAY REPEAT 3 Repeats the last command n times
LOCALE LOCALE DE Sets the keyboard layout. List
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

Key
a - z
A - Z
0 - 9
F1 - F12

Modifier Keys

Key
CTRL or CONTROL
SHIFT
ALT
WINDOWS or GUI

Other Keys

Key
ENTER
MENU or APP
DELETE
HOME
INSERT
PAGEUP
PAGEDOWN
UP or UPARROW
DOWN or DOWNARROW
LEFT or LEFTARROW
RIGHT or RIGHTARROW
TAB
END
ESC or ESCAPE
SPACE
PAUSE or BREAK
CAPSLOCK
NUMLOCK
PRINTSCREEN
SCROLLLOCK

Numpad Keys

Key
NUM_0 - NUM_9
NUM_ASTERIX
NUM_ENTER
NUM_MINUS
NUM_DOT
NUM_PLUS

Examples

REM Hello World for Windows PCs
DEFAULTDELAY 200
GUI r
STRING notepad
ENTER
STRING Hello World!

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

Command Description Example
help Returns all available commands help
ram Returns available memory in bytes ram
version Returns version number version
settings Returns list of settings settings
set -n/ame -v/alue Sets value of a specific setting set ssid "why fight duck"
reset Resets all settings to their default values reset
status Returns status of i2c connection with Atmega32u4 status
run <...> Starts executing a Ducky script run example.txt
stop <...> Stops executing a Ducky script stop example.txt

SPIFFS File Management

Command Description Example
mem Returns available, used and free memory of SPIFFS in bytes mem
format Formats SPIFFS format
ls <...> Returns list of files ls /
create <...> Creates file create example.duck
remove <...> Deletes file remove example.duck
cat <...> Returns content of file cat example.duck
rename -fileA,a -fileB,b Renames file rename example.duck example.txt
write -f/ile -c/ontent Writes (appends) data to file write example.txt "Hello World!"
stream <...> Opens file stream stream example.txt
close Closes file stream close
read Read and return the result from file stream read

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!

How to Debug

To properly debug, you need to have both the Atmega32u4 and the ESP8266 connected via USB to your computer.

That can be tricky when you only have a all in one board, so it might be useful you built one yourself. You don't need to solder it, for example you can use an Arduino Leonardo and a NodeMCU and connect them with jumper cables.

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.

Development

Edit Web Files

If you would like to modify the web interface, you can!
The web/ folder contains all .html, .css, .js files.
You can edit and test them locally as long as you're connected to the WiFi Duck network thanks to the websocket connection handled by JavaScript in the background.

To get the new files onto the ESP8266, run python3 webconverter.py in the repository folder.
It gzips all files inside web/, converts them into a hex array and saves it in esp_duck/webfiles.h.
Now you just need to flash the ESP8266 again.

Translate Keyboard Layout

Currently supported keyboard layouts:

All standard keys are defined in usb_hid_keys.h.
To translate a keyboard layout, you have to match each character on your keyboard to the one(s) of a US keyboard.
This stuff is hard to explain in writing and requires a lot of manual work and testing.

  1. Copy one of the existing layouts files, like locale_us.h.
    Preferably one that is close to your keyboard layout, it will save you time!
  2. Add #include "locale_xx.h" to the end of the locales.h file.
  3. Rename the file and its variables to your language code. For example:
    locale_xx.h -> locale_de.h,
    ascii_xx -> ascii_de,
    locale_xx -> locale_de,
    utf8_xx -> utf8_de.
    combinations_xx -> combinations_de,
  4. Modify the ASCII array.
    The ASCII array has a fixed size. Each row describes a key. First a modifier key like KEY_MOD_LSHIFT, then a character key. Some ASCII characters can't be typed or don't require a modifier, that's where you must place KEY_NONE. Check usb_hid_keys.h for the available keys.
    If multiple modifiers are required, you must use a bitwise OR to connect them: KEY_MOD_RALT | KEY_MOD_LSHIFT.
    For example, in locale_de.h Z is saved as KEY_MOD_LSHIFT, KEY_Y.
    This is because German keyboards use QWERTZ instead of the QWERTY layout and since the letter is uppercase, shift must be pressed as well.
    Thankfully you don't have to trial and error everything, the Hak5 Community translated a lot of layouts already here. It's just written in a different syntax. For example, ASCII_20 (20 in hexadecimal) is the 32th character in our ascii array.
  5. [deprecated] Modify or create the extended ASCII array.
    The extended ASCII array doesn't have a fixed size and is only as long as you make it. First the character code. For example, ä has the index 132, or 84 in hex. It doesn't use a modifier and sits where the apostrophe key is on a US keyboard: 0x84, KEY_NONE, KEY_APOSTROPHE, // ä.
  6. Modify or create the UTF-8 array.
    The UTF-8 array is variable in length, too.
    The first 4 bytes are the character code.
    For example, Ä has the hex code c384 or 0xc3 0x84. The other 2 bytes are not used so we set them to 0. Because the letter is uppercase, we need to press the shift key and like before, the letter is typed by pressing the same key as the apostrophe key of a US keyboard: 0xc3, 0x84, 0x00, 0x00, KEY_MOD_LSHIFT, KEY_APOSTROPHE, // Ä.
  7. Edit the hid_locale_t structure.
    If you renamed all variables accordingly, there's nothing left to do.
  8. Go to duckparser.cpp at // LOCALE (-> change keyboard layout) you can see a bunch of else if statements. You need to copy one for your layout.

Before adding GB layout:

if (compare(w->str, w->len, "US", CASE_SENSETIVE)) {
    keyboard::setLocale(&locale_us);
} else if (compare(w->str, w->len, "DE", CASE_SENSETIVE)) {
    keyboard::setLocale(&locale_de);
}

After adding GB layout:

if (compare(w->str, w->len, "US", CASE_SENSETIVE)) {
    keyboard::setLocale(&locale_us);
} else if (compare(w->str, w->len, "DE", CASE_SENSETIVE)) {
    keyboard::setLocale(&locale_de);
} else if (compare(w->str, w->len, "GB", CASE_SENSETIVE)) {
   keyboard::setLocale(&locale_gb);
}
  1. Test your layout with a Ducky Script that contains all characters of your keyboard. For example:
LOCALE DE
STRING !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefghijklmnopqrstuvwxyz{|}~²³äöüÄÖÜ߀°§`
ENTER
  1. Add a link to your layout to README, to web/index.html and please feel free to improve this tutorial to help future translators!
  2. Create 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. See the license file for details.

Credits

Software libraries used in this project:

wifiduck's People

Contributors

deantonious avatar jlynx avatar lander-parren avatar liju09 avatar nc-wbb avatar simijs avatar the-jamz avatar thoxy67 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  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

wifiduck's Issues

Internal connection problem [Help]

Capture

Anytime I attempt to run a script I am given this error and nothing is typed. I've tried multiple boards with no success. Am currently using Leonardo with D1 mini.

Can't run scripts using a Tipe-C Nano SAMD21

Error:
Hi, I've built a DIY Malduino W with a "USB Tipe-C Nano SAMD21 48MHZ Cortex M0 32 Bit Microcontroller" and "WeMos D1 Mini Pro V3.0 NodeMcu 4MB/16MB byte".
I followed a guide on youtube (by Seytonic) about it, sadly in the video they used a "Adafruit Trinket M0", but on the description it was said i could use the one I'm currently using.
Anyways I managed to solder the pins needed for it to work and I was able to connect to the Malduino W connection and to see the Script page.
Once there there is a issue Running scripts, I know that there are only some keyboards supported and I was using the US layout so i used "LOCALE US" in the script. To test it I also added a line of script that was going to open the "Run" program.
After I saved the script and ran it nothing happened, I tried others scripts, and also to restart the pc but nothing.

On screen i can see the website letting me know that the Script is running so I don't know what could be the problem.

Yes, I've made sure all the pins are on the right spot and well soldered.

  • Windows 10
  • Browser Chrome
  • Version 87.0.4280.88 (64 bit)
  • Hardware (DIY Malduino W):
    USB Tipe-C Nano SAMD21 48MHZ Cortex M0 32 Bit Microcontroller & WeMos D1 Mini Pro V3.0 NodeMcu 4MB/16MB byte

Now I'll try to see if the pins need some adjustments, but I doubt it.

I'm available for any question or suggestions.
Thank you very much

Generic ESP32 and Arduino Pro Micro - Internal Connection Problem (PT Brasil)

Link com vídeo do problema: https://photos.app.goo.gl/LaXWtYSDqBmR7ikp6

Estou usando a seguinte conexão: https://photos.app.goo.gl/Uw55MrXU4AacEBag6

Placa selecionada para o ESP8266: https://photos.app.goo.gl/Uw55MrXU4AacEBag6

Placa selecionada para o atmega: https://photos.app.goo.gl/99vVTME4REXJDH197

Foto adicional: https://photos.app.goo.gl/Nt5YKK93Em7dJTC38

A seguinte mensagem aparece quando tento executar um script pelo webserver: "Internal Connection Problem"

Alguém sabe no que estou errando?

Doesnt run long script

Describe the error
When ever i run the long script it run for a while then it showing me the internal error problem and the shorts script runs perfectly fine. I dont know why i encountered this problem. Please admin help me!

image

Using Serial communication issues

Not too long ago, I was able to download and install on the old wifi ducky library on a knock wifi usb:
https://www.amazon.com/gp/product/B07F8QJ7ZP/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1

It seems that this bad usb is wired using serial. Because of this, the old library work just fine. I have however had trouble installing this new library. It seems that whenever I upload all the new code, I always result in an Internal connection error. I believe this is something at fault with the arduino. Uncommenting the debug lines results in no serial output from the mega. Could someone please point me in the right direction in terms of what all the settings should be and how I can set it to use serial.

More info about bad USB:
Runs a MEGA32U4 and an ESP8266MOD
It is wired in a way where the old project runs just fine

Thank You for any help

webinterface dont interact [Help]

I buyed the preflashed wifiduck on tindie. So i puged it in and connected to the wifi. It seams to be fine the site comes up i can see the main page, terminal, settings. But anytime i click on the run or save button nothing happens. See in the screenshot there is no request send to the ducky. So i tried to add a file on the web-terminal. There i can see the output of the other commands but either not able to crate a new file.
Screenshot_20191107_063506
wifi_duck_error_report

Internal Connection Problem Yellow warning when trying to run any script on the WiFi Duck from DSTike

Just received a pre-built version of the WiFiDuck from Travis Lin. When connected, it seems to work and allows association to the wifiduck hotstop, nonetheless when trying to execute any script, pressing the run button or enabling the auto-run feature, a yellow warning appears saying "Internal Connection Problem". As I said, this is a pre-built model and not the separate boards featured on other topics with the same error message. I tried to import an existing ducky script as well, which works perfectly on the Rubber Ducky, and it does not work on the WiFiDuck either.

I also tried re-flashing both parts of the firmware, but I was able to do just one of them. The other (atmega) does not respond, according to the instructions on the videos. It is not even recognized in the Arduino IDE interface as a valid port, which is strange, since it works and as I said, allows association to the default WiFiDuck hotspot.

When issuing the command "status" on the terminal window of the tool, it generates the same error. Any help would be appreciated. Tried on Windows, Mac and Linux without results.

Is there a way to run any diagnostics to rule out a hardware failure?

Thanks for your help.

Connect to existing WiFi

In my use case i would prefer the WiFi duck connect to my home WiFi instead of creating a WiFi that devices connect to. I have setup the ESP8266 to connect to my WiFi to host a web page, but would not have the skill set to get the WiFi duck to do it.
Thoughts.

CLI debug

Hello, Bit of a shot in the dark

When creating a file in serial with debug enabled using the commands (create example.duck) then (write example.txt "STRING Hello World!") it creates the file perfectly and reports success!

When I then run that file form serial ie (run "example.txt") the first HID output is correct i get "Hello world" but the following run requests from serial output over HID as "STRING Hello World" until the esp is reset and it will run correctly once more until another reset!

I have come in to this issue after adding mqtt to cli and using mqtt to create/remove/run scripts - it works great the first time round the following runs always include the "STRING" prefix until the esp is reset again

I just wanted to know if this is something that's been designed as a feature as I am using it in debug mode and if so is there a way i can work around it.

if I create the file in the webui I can run it from serial just fine as many times as i want its just when running a file created in the serial console that only works without including the word STRING in the output once.

I did double check and found this is also true in the current build of wifi ducky! Im happy to share my mqtt version with you if any of this sounds interesting!

it uses wifi manager connects to a mqtt server and waits for a payload however can only be used once before a reboot :D

Error setting up the ESP8266 [Help]

When I upload the code "esp_duck.ino" from the Arduino IDE I get an error
I have installed all the libaries installed including the one for ESP8266 (Im using the NodeMCU)

I open de folder and left it as it was and tried to upload it but it gave me the error

Here is the copy of the error :
(some parts are in spanish but i think they are not very imprtant)

Arduino:1.8.10 (Windows 10), Tarjeta:"NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled, All SSL ciphers (most compatible), 4M (3M SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"

El Sketch usa 413040 bytes (39%) del espacio de almacenamiento de programa. El máximo es 1044464 bytes.
Las variables Globales usan 32104 bytes (39%) de la memoria dinámica, dejando 49816 bytes para las variables locales. El máximo es 81920 bytes.
esptool.py v2.6
2.6
esptool.py v2.6
Serial port COM6
Connecting........_____....._____....._____....._____....._____....._____.....____Traceback (most recent call last):
  File "C:\Users\j_mor\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/upload.py", line 25, in <module>
    esptool.main(fakeargs)
  File "C:/Users/j_mor/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/tools/esptool\esptool.py", line 2653, in main
    esp.connect(args.before)
  File "C:/Users/j_mor/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/tools/esptool\esptool.py", line 468, in connect
    raise FatalError('Failed to connect to %s: %s' % (self.CHIP_NAME, last_error))
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header

I m using the Arduino IDE

i2c connection problem

It gives an i2c connection problem when I run a script with this line

STRING msedge https://youtube.com

When that error came I can't run scripts until I replug the board.

What device do I connect to victim's pc??

I am very impressed by the DIY Wi-Fi Duck project, but I am not able to know whether to insert the ESP8266 board of the Arduino Pro Micro board to the victim's PC?

Also, can you please tell on how to control the victim's pc after connecting either the ESP board or the other one.

How long should I keep it connected to the victim's pc and how to control it remotely?

It would be really helpful if you answered mu questin and cleared my doubts.

Best regards,
A Wifi Rubber Ducky

Repeat function not working

I don't know if the issue is on my end, but when I add the repeat function to my scripts, it doesn't repeat the script, instead it displays the "running /(script name)" message until the script get's manually stopped.

Where is the info about vendors (USB ID)?

Please search for existing (open and closed) issues to avoid duplicates.
Hi,

I remember setting the ATmega32u4 board to mimic some Logitech keyboard.

But searching the source code for the word logitech doesn't return anything, so where is the struct and data containing information about vendor ID and stuff like that?

I am curious because in my fork, I'd like to implement more vendors and mice also.

Thanks.

help error running script!

I am running wifiduck on a Debkit NodeMcu v3 and I have an error, the error is from the attached image.

the version i am using for wifi duck is 1.0.0

Screenshot_2020-06-13-00-37-13

It's giving me an error while compiling.

The error is

invalid conversion from 'const char*' to 'uint8_t {aka unsigned char}' [-fpermissive]

This is the log

sketch\cli.cpp: In lambda function:

sketch\cli.cpp:112:29: warning: passing NULL to non-pointer argument 1 of 'String::String(int, unsigned char)' [-Wconversion-null]

             String s { NULL };

                             ^

sketch\spiffs.cpp: In function 'void spiffs::write(String, const char*)':

spiffs.cpp:109:24: error: invalid conversion from 'const char*' to 'uint8_t {aka unsigned char}' [-fpermissive]

             f.write(str);

                        ^

In file included from sketch\spiffs.h:10:0,

                 from sketch\spiffs.cpp:7:

C:\Users\gilla\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\cores\esp8266/FS.h:54:12: error:   initializing argument 1 of 'virtual size_t fs::File::write(uint8_t)' [-fpermissive]

     size_t write(uint8_t) override;

            ^

sketch\spiffs.cpp: In function 'void spiffs::streamWrite(const char*, size_t)':

spiffs.cpp:153:50: error: invalid conversion from 'const char*' to 'const uint8_t* {aka const unsigned char*}' [-fpermissive]

         if (streamFile) streamFile.write(buf, len);

                                                  ^

In file included from sketch\spiffs.h:10:0,

                 from sketch\spiffs.cpp:7:

C:\Users\gilla\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\cores\esp8266/FS.h:55:12: error:   initializing argument 1 of 'virtual size_t fs::File::write(const uint8_t*, size_t)' [-fpermissive]

     size_t write(const uint8_t *buf, size_t size) override;

            ^

exit status 1
invalid conversion from 'const char*' to 'uint8_t {aka unsigned char}' [-fpermissive]

`serial.serialutil.SerialTimeoutException: Write timeout` when flashing ESP-12E on CJMCU-3212/DM-3212

I just followed the directions given. ATMEGA flashed fine. COM is there.

Expected behavior
Honestly, after ATMEGA flashed perfectly fine I expect this to work.

Executable segment sizes:
IROM   : 386384          - code in flash         (default or ICACHE_FLASH_ATTR) 
IRAM   : 28600   / 32768 - code in IRAM          (ICACHE_RAM_ATTR, ISRs...) 
DATA   : 1316  )         - initialized variables (global, static) in RAM/HEAP 
RODATA : 3920  ) / 81920 - constants             (global, static) in RAM/HEAP 
BSS    : 26664 )         - zeroed variables      (global, static) in RAM/HEAP 
Sketch uses 420220 bytes (40%) of program storage space. Maximum is 1044464 bytes.
Global variables use 31900 bytes (38%) of dynamic memory, leaving 50020 bytes for local variables. Maximum is 81920 bytes.
esptool.py v2.8
Serial port COM11
Connecting...
Traceback (most recent call last):
  File "C:\Users\didymus\Documents\ArduinoData\packages\wifiduck\hardware\esp8266\2.6.3/tools/upload.py", line 65, in <module>
    esptool.main(cmdline)
  File "C:/Users/didymus/Documents/ArduinoData/packages/wifiduck/hardware/esp8266/2.6.3/tools/esptool\esptool.py", line 2890, in main
    esp.connect(args.before)
  File "C:/Users/didymus/Documents/ArduinoData/packages/wifiduck/hardware/esp8266/2.6.3/tools/esptool\esptool.py", line 475, in connect
    last_error = self._connect_attempt(mode=mode, esp32r0_delay=False)
  File "C:/Users/didymus/Documents/ArduinoData/packages/wifiduck/hardware/esp8266/2.6.3/tools/esptool\esptool.py", line 455, in _connect_attempt
    self.sync()
  File "C:/Users/didymus/Documents/ArduinoData/packages/wifiduck/hardware/esp8266/2.6.3/tools/esptool\esptool.py", line 394, in sync
    timeout=SYNC_TIMEOUT)
  File "C:/Users/didymus/Documents/ArduinoData/packages/wifiduck/hardware/esp8266/2.6.3/tools/esptool\esptool.py", line 337, in command
    self.write(pkt)
  File "C:/Users/didymus/Documents/ArduinoData/packages/wifiduck/hardware/esp8266/2.6.3/tools/esptool\esptool.py", line 300, in write
    self._port.write(buf)
  File "C:/Users/didymus/Documents/ArduinoData/packages/wifiduck/hardware/esp8266/2.6.3/tools/pyserial\serial\serialwin32.py", line 323, in write
    raise writeTimeoutError
serial.serialutil.SerialTimeoutException: Write timeout
the selected serial port serial.serialutil.SerialTimeoutException: Write timeout
 does not exist or your board is not connected

Environment (please complete the following information):

  • OS: Win11 Pro 22000.120
  • Arduino IDE 1.8.15
  • CJMCU/DM-3212

Attempts

  • Downgraded the ESP-12E Wifi Duck boards version (previous edit shows this, updated with 2.6.3 output)
  • Tried as Generic ESP8266 instead of Node MCU ESP-12E (which it is)
    All of these changes still produce same error posted above.

Additional context
I went on the 8266 forum and maybe the module itself is bad? I'm not sure. This is the first Arduino thing I've messed with.

Maybe there is supposed to be some timeout specified in the code that ArduinoIDE looks for? I will look into this further after an unrelated appointment I have in a few minutes.

Auto run on insert

Thinking it would be cool to choose a script to auto run when the duck is inserted. This could be user configurable from the interface or potentaully with the dip switches on device itself. this way we can execute quick attacks without needing to wait for it to boot and connect via WiFi.

When I connect to the wifi duck it says that there is an internal connection problem

Describe the error
After connecting to the duck there is a yellow bar at the top saying that there is an internal connection problem. There is no output to the serial monitor and I can't type anything using the duck

Environment:

  • OS: Windows 10
  • Version: 1.0.4 (0)
  • Hardware: Arduino Pro Micro, Weimos D1 Mini, Spacehuhn's PCB

Attempts
I have tried connecting to the serial monitor without success and I have checked all the solder connections which are fine

Does anyone have any idea what the issue might be?

Change Device type

It would be awesome to add the functionality to be able to change the device type/PID live without needing to re program it with arduino studio.

I have a few ideas on how this can be done.

  • It may be possible to do it directly in code which would be the easiest way to do it
  • Have a way to flash flash the device (Like an OTA which you are currently working on) but being able to select the type you want there (Appley keyboard, Microsoft keyboard, etc...). Then it will just reflash with the ID you want

Internal Connection Problem, can't run certain scripts, unable to update firmware

Error:
I bought a fresh DSTIKE WiFi Duck, plugged it in, followed the basic instructions to connect to its network, change the SSID and password, and writing a script. Whenever I load the main page, an "Internal Connection Problem" banner appears at the top of the screen. I then attempted to run the following script, but it did not execute:

REM Hello World
DEFAULTDELAY 200
GUI SPACE
STRING terminal
ENTER
STRING ls

Despite these two issues, the following script will execute properly (though the internal connection problem banner remains):

STRING test

Environment:

  • OS: macOS (target/victim), iOS (wifi duck console)
  • Browser: Google Chrome (target/victim), Safari (wifi duck console)
  • Hardware: DSTIKE 1.0 software

Attempts:
I tried updating to the latest firmware, but was prevented from flashing to the ATMEGA due to an error:

Arduino: 1.8.10 (Mac OS X), Board: "DSTIKE WiFi Duck (ATmega32u4), Arduino Leonardo, Serial (115200b, newline)"

Sketch uses 14384 bytes (50%) of program storage space. Maximum is 28672 bytes.
Global variables use 1765 bytes (68%) of dynamic memory, leaving 795 bytes for local variables. Maximum is 2560 bytes.

avrdude: ser_recv(): read error: Device not configured
avrdude: butterfly_recv(): programmer is not responding
avrdude: ser_drain(): read error: Device not configured
avrdude: ser_send(): write error: Device not configured
avrdude: ser_recv(): read error: Device not configured
avrdude: butterfly_recv(): programmer is not responding
avrdude: ser_send(): write error: Device not configured
avrdude: ser_recv(): read error: Device not configured
avrdude: butterfly_recv(): programmer is not responding
avrdude: ser_recv(): read error: Device not configured
avrdude: butterfly_recv(): programmer is not responding
avrdude: ser_send(): write error: Device not configured
avrdude: ser_recv(): read error: Device not configured
avrdude: butterfly_recv(): programmer is not responding
Found programmer: Id = ""; type = �
    Software Version = �.�; Hardware Version = �.�
avrdude: ser_send(): write error: Device not configured
avrdude: ser_recv(): read error: Device not configured
avrdude: butterfly_recv(): programmer is not responding
avrdude: ser_send(): write error: Device not configured
avrdude: ser_recv(): read error: Device not configured
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: buffered memory access not supported. Maybe it isn't
a butterfly/AVR109 but a AVR910 device?
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: ser_send(): write error: Device not configured
avrdude: ser_recv(): read error: Device not configured
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: leave prog mode
avrdude: ser_send(): write error: Device not configured
avrdude: ser_recv(): read error: Device not configured
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: exit bootloader
avrdude: ser_close(): can't reset attributes for device: Device not configured
the selected serial port avrdude: ser_close(): can't reset attributes for device: Device not configured
 does not exist or your board is not connected

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Auto incrementing version numbers

We need a way to automatically increment the version number so we know what version we are using. I suggest using the Git Commit ID as it will be quite easy to do with that

Random Input

Hello,
I just received this today. I flashed the updated version. I tried to run a short script that checked the devices IP and it was having troubles. It would randomly open desktop shortcuts or only print 1/3rd of the string.

This is the script I used:

WINDOWS r
STRING powershell
ENTER
STRING ipconfig
ENTER

Thanks so much,

N.H

Does this work with the Cactus WHID?

Please search for existing (open and closed) issues to avoid duplicates.
I recently bought a Cactus WHID and when I checked the Github for it, it stated that the device has support for the original Wifi Ducky project. So I was wondering if this worked with this one too.

CJMCU-3212 PCB Support

Merry Christmas!

I just got a new chinese PCB called the CJMCU-32 12 that has the ESP module, AtMega and sdcard slot all in one pcb. I tried flashing it with your old version using a tutorial linked here , and it worked well. I first flashed the AtMega with the ESP programmer, bridged the pads (as the tutorial says) and got your old wifi_ducky repo to work on it. I try the same steps but this time using an esp bin file from the new repo WIFI DUCK, and flashed the new AtMega firmware, and I just think its incompatible. Is there a way this board could work? Its a nice pcb, and I'd like to take advantage of the new features of the new repo. I have the pinout linked, I think it doesnt work due to the way payloads are communicated between the esp and atmega modules.

Internal Connection Problem

I have an ATmega32u4 Arduino Pro Micro and ESP8266 12-E Modules (NodeMCU 1.0). ** I dont have any LED :)
I connected them on breadbord just like your Tutorial (with wire jumps)
I flashed the software, everything is fine but when I connect to the Esp interface to run the scripts it appears Internal Connection Problem

Can you guys give me any suggestion on what to do?
Thanks :)

string doesn't finish typing before next command

Having an issue where I have a string that is types out followed by another command. In this case ENTER.
What happens is it types out ENTER instead of pressing the enter key.
It only types out: https://grabify.link/8ESENTER
Where it should be typing out https://grabify.link/8ESCC1

This is the code:

DEFAULTDELAY 200
GUI r
STRING https://grabify.link/8ESCC1
ENTER

But splitting them onto 2 lines solves the issue e.g

DEFAULTDELAY 100
GUI r
STRING https://grabify.link/
STRING 8ESCC1
ENTER

can i use this in wifi cactus WHID

Please search for existing (open and closed) issues to avoid duplicates.
I have a wifi cactus WHID which is running ESPloitV2. so, how do I install wifi duck in that

ATMEGA32U4 ESP8266 - Steps to be followed

I have the ATMEGA32U4 ESP8266, which has both the Microcontroller part and the WIFI part in a single board. How do I use these scripts in this case?

Do I need to follow the same steps?

locale ES: Impossible to write apostrophe (')

Testing the ES layout on my WiFiDuck:

REM es char test
LOCALE ES
GUI r
notepad.exe
ENTER
DELAY 200
STRING !"#$%&'()*+,-./0123456789: =>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefghijklmnopqrstuvwxyz{|}~¿¡ñÑçǺª€·¨`
ENTER

returns the following in a notepad:


!"#$%&.()*+,-./0123456789: =>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefghijklmnopqrstuvwxyz{|}~¿¡ñÑçǺª€·¨`

As you can see, every character is translated correctly except for the 7th one, where the apostrophe (') is translated into a dot (.)

This is making it impossible for me to type powershell commands into the wifiduck, as that character is commonly required.

In a common spanish keyboard layout, (') is located just after the top numeric line, so it is like this:
ESC 1 2 3 4 5 6 7 8 9 0 ' ¡ BACKSPACE

Any advice will be appreciated. Thanks in advance.

Suggestion for new feature

I know you haven't worked on this project for a while but if you start making updates again you could add a Backup-Function (Downloading all Scripts with one click)

wifiducky send and receive

I study it about one years and have tried many version or applicaiton.
what i matter most is that, whether the wifiducky can send and receive data between target and host pc.
Can you solve it ????Attention, with no network else, just esp8266.
Nearly, most of wifiducky of github just could send commands from host to target, but it cannot download datas or files from target pc, just lile nc to nc ,ftp to ftp, c&c, even meterpreter of kali.
Now, what i do is as follows, under c/s model, plant a client.exe on the target, and communicate with it via server.exe on attact host. I finish it.
With no network else, do you have other way to communication (send and receive)???

New WifiDuck compatibility with WHID Cactus?

Is the new WifiDuck firmware compatible with WHID Cactus? Is there any tutorial on how to flash it in WHID? All I can find is flashing the old Wifi_ducky tutorials on the web. I had to buy WHID just because of the unavailability of Wifi Duck in my region.

bare esp12e connections?

hello im very new to esp boards, i have a 5v arduino pro micro and a bare esp12e, how can i connect them

Settings wont save

EEPROM does not seem to be working as any setting I change are not saved

Serial Support?

Hello, I bought a generic rubber ducky board a long time ago and noticed there was an updated version of the Wifi duck project(this repository), but i didnt read enough so I proceeded to flash it without noticing that the new code comunicates the ESP8266 with the 32u4 via i2c and not via serial like the older code.
Is there any chance of serial support for older boards?

Russian layout

Hello. I'd like to add a russian layout to your amazing project. I have wrote file locale_ru.h and made all needed changes as you explain. But instead russian word, for example, "мама" (mother in english) I see word "fVfFfVfF". Letters V and F on russian layout is in place of russian letters м and а, but why they are in english and what means a small letter f before each of them?
I have attached my file, but Githab have wanted me to change extention to .txt. Initially it was .h.

locale_ru.txt

SSID (and password) won't save

SSID, password and channel won't save.

This I think is either 2 thing. It's not saving the eeprom or the front end is not passing it through correctly. I'll investigate and push a fix through

Please tell me right connection of the electric circuit.

It was wrote on readme that " Here's a map of the pins that need to be connected. " .
There are three connections(D1 to SCL, D2 to SDA, GND to GND).

========================

ESP8266 Atmega32u4
D1 alias GPIO 5 3 alias SCL
D2 alias GPIO 4 2 alias SDA
GND GND

=========================

but, the image below the table shows that there is another connection.(5v to RAW?)
https://github.com/SpacehuhnTech/WiFiDuck/blob/master/img/diy_example.jpg

I've already tried the former pattern(=the three connection), but the system didn't move.
Please tell me right connection of the electric circuit.

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.