mame82 / duckencoder.py

Python port of infamous duckencoder for RubberDucky
136 stars 49 forks source link

special characters not accepted; debug message sent to stdout #8

Open doublehp opened 6 years ago

doublehp commented 6 years ago
# echo -e "\x1B" | python duckencoder/duckencoder.py -l us -r | hexdump -C
00000000  1b 20 69 6e 74 65 72 70  72 65 74 65 64 20 61 73  |. interpreted as|
00000010  20 41 53 43 49 49 5f 31  42 2c 20 62 75 74 20 6e  | ASCII_1B, but n|
00000020  6f 74 20 66 6f 75 6e 64  20 69 6e 20 63 68 6f 73  |ot found in chos|
00000030  65 6e 20 6c 61 6e 67 75  61 67 65 20 70 72 6f 70  |en language prop|
00000040  65 72 74 79 20 66 69 6c  65 2e 20 53 6b 69 70 70  |erty file. Skipp|
00000050  69 6e 67 20 63 68 61 72  61 63 74 65 72 21 0a 28  |ing character!.(|
00000060  00                                                |.|
00000061

This is wrong at several levels:

1B is a standart character, and used for many commands: http://www-ug.eecg.toronto.edu/~gizmodoc/demos/code/Colour_Escape/keyCodes.txt

The error message is sent to stdout instead of stderror; what means:

This implies the encoder can only work on pure alpha keys, and is unable to deal with ESC, arrows, function keys, or home ...

doublehp commented 6 years ago

Error message coming out of stdout issue lays in duckencoder.py line 313; similar issue is expected on lines 325 and 326.

mame82 commented 6 years ago

Good point, I need to review this

mame82 commented 6 years ago

Not sending errors to stdout is a good idea. Considering the missing characters in the layouts, this is a problem whuch arised because the logic (and the layouts) are mostly the same as in legacy DuckEncoder.

The whole tool needs a reimplementation, at least for P4wnP1.

Unfortunately I'm lacking the time to work on thus in near future