DevKitty-io / USB-Nugget

Run DuckyScript payloads on a USB Nugget!
https://usbnugget.com
MIT License
158 stars 19 forks source link

Key modifiers (CTRL, ALT, SHIFT) don't work in DuckyScript #35

Closed brandonpaiz closed 2 years ago

brandonpaiz commented 2 years ago

Ran script with unsaved document open in text editor:

STRING the script is running
DELAY 1000
CTRL S

Expected the save dialog to pop up. Output: the script is runnings. Note the s

I changed the line ending style from unix to dos just to see if that had any effect. I ran the script again and received output the script is running, but still no save dialog.

brandonpaiz commented 2 years ago

Flashed from latest release: v1.0.4 (beta) I think I've seen the release updated (and still named the same thing), so MD5 may be more specific: 6e281e2028942c818fec4dd713e58a05

Serial output when script has UNIX line endings

File size: 47 bytesFile successfully read!
STRING the script is running
String

DELAY 1000
Delayed!

CTRL S
looking for: CTRL
CTRL
 found!
5
S  83
22
looking for: 
Command not found
finished running payload

Serial output when script has DOS line endings

File size: 50 bytesFile successfully read!
STRING the script is running

String

DELAY 1000

Delayed!

CTRL S

looking for: CTRL
CTRL
 found!
5
looking for: 
Command not found
finished running payload
AlexLynd commented 2 years ago

Huh! This might be an issue with the EspTinyUSB library - it looks like hidkeyboard.cpp isn't properly appending the keycode array with modifiers. I forked the library and implemented a fix here that seems to be working, let me know what you think!