Python USB OTG HID (Keyboard) for Raspberry PI Zero (and other)
Python USB OTG HID (Keyboard) for Raspberry PI Zero (and other)
Inspired by RubberDucky, O.MG cable and other nice tools (e.g. Cactus WHID, BadUSB), I created this Python3 BullDog cli tool.
As I was a little unhappy with the DuckyScript and WHID syntax, I developed the new Barking syntax (which is very similar).
If you need to create a USB OTG HID, here you will find all information (for Raspberry PI Zero).
# install git and pip (Python 3.x)
$ sudo apt install git python3-pip
# clone repository
$ git clone https://github.com/Lupin3000/BullDog.git
# change into cloned directory
$ cd BullDog/
# install via pip3 (system wide or virtualenv)
$ pip3 install .
# show help (optional)
$ bulldog -h
# execute barking script
$ bulldog -b examples/macOS/woof.txt
# execute barking script with default delay
$ bulldog -b examples/macOS/woof.txt -d 0.05
# just test barking script (no need for /dev/hidg0)
$ bulldog -b examples/macOS/woof.txt -t
# write some string directly
$ bulldog --text "who am i" -t
# write some command directly
$ bulldog --command "GUI SPACE" -t
Note:
-b|--barking
,--text
and--command
cannot be used together!
Example of the barking script woof.txt
(simple text file)…
# This is a simple barking script example for macOS
#
# ,--._______,-.
# ,',' , . ,_`-.
# / / ,' , _` ``. | )
# (,';'""`/ '"`-._ ` \/
# : ,o.-`- ,o. )\` -'
# : , d8b ^-. '| `
# |/ __:_ `. | ,
# | ( ,-.`-. ;' ;
# | | , `. /
# `-'`:::._,`.__),'
#
[CMD] GUI SPACE
[DELAY] 1.0
Terminal
[CMD] ENTER
[DELAY] 1.0
who am i
[CMD] ENTER
#
[DELAY]
and value is in milliseconds[CMD]
Standard/Shifted Keys
Decimals from 4 till 39, 44, 45 till 56
Modifier Keys
Command Keys
ENTER, ESCAPE, BACKSPACE, TAB, SPACE, CAPS_LOCK, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PRINT, SCROLL_LOCK,
PAUSE, INSERT, HOME, PAGE_UP, DELETE, END, PAGE_DOWN, RIGHT_ARROW, LEFT_ARROW, DOWN_ARROW, UP_ARROW, LEFT_CONTROL,
LEFT_SHIFT, LEFT_ALT, LEFT_GUI, RIGHT_CONTROL, RIGHT_SHIFT, RIGHT_ALT, RIGHT_GUI
Keypad Keys
Maybe some time later ;)