项目作者: Lupin3000

项目描述 :
Python USB OTG HID (Keyboard) for Raspberry PI Zero (and other)
高级语言: Python
项目地址: git://github.com/Lupin3000/BullDog.git
创建时间: 2021-04-23T12:29:56Z
项目社区:https://github.com/Lupin3000/BullDog

开源协议:

下载


BullDog

BullDog

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).

Preparation

If you need to create a USB OTG HID, here you will find all information (for Raspberry PI Zero).

  1. # install git and pip (Python 3.x)
  2. $ sudo apt install git python3-pip

Usage

  1. # clone repository
  2. $ git clone https://github.com/Lupin3000/BullDog.git
  3. # change into cloned directory
  4. $ cd BullDog/
  5. # install via pip3 (system wide or virtualenv)
  6. $ pip3 install .
  7. # show help (optional)
  8. $ bulldog -h
  9. # execute barking script
  10. $ bulldog -b examples/macOS/woof.txt
  11. # execute barking script with default delay
  12. $ bulldog -b examples/macOS/woof.txt -d 0.05
  13. # just test barking script (no need for /dev/hidg0)
  14. $ bulldog -b examples/macOS/woof.txt -t
  15. # write some string directly
  16. $ bulldog --text "who am i" -t
  17. # write some command directly
  18. $ bulldog --command "GUI SPACE" -t

Note: -b|--barking, --text and --command cannot be used together!

The Barking script

Example of the barking script woof.txt (simple text file)…

  1. # This is a simple barking script example for macOS
  2. #
  3. # ,--._______,-.
  4. # ,',' , . ,_`-.
  5. # / / ,' , _` ``. | )
  6. # (,';'""`/ '"`-._ ` \/
  7. # : ,o.-`- ,o. )\` -'
  8. # : , d8b ^-. '| `
  9. # |/ __:_ `. | ,
  10. # | ( ,-.`-. ;' ;
  11. # | | , `. /
  12. # `-'`:::._,`.__),'
  13. #
  14. [CMD] GUI SPACE
  15. [DELAY] 1.0
  16. Terminal
  17. [CMD] ENTER
  18. [DELAY] 1.0
  19. who am i
  20. [CMD] ENTER
  • Comment starts with a #
  • Specific delays do start with [DELAY] and value is in milliseconds
  • Standard and/or Shifted keystrokes are just written
  • Commands and/or Modifier start with [CMD]

Supported Keyboard Keys

Standard/Shifted Keys

Decimals from 4 till 39, 44, 45 till 56

Modifier Keys

  • LEFTCONTROL or RIGHT_CONTROL (_or simply CONTROL)
  • LEFTSHIFT or RIGHT_SHIFT (_or simply SHIFT)
  • LEFTALT or RIGHT_ALT (_or simply ALT)
  • LEFTGUI or RIGHT_GUI (_or simply GUI or WIN)

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 ;)

ToDo’s

  • Add triple and quadruple keystrokes