class documentation
class Ducky:
Constructor: Ducky(usb_device, storage, media_device, mouse_device, button_reader)
Read and execute DuckyScript commands.
| Method | __init__ |
Create an interpreter for a USB device and optional peripherals. |
| Method | exec |
Read a DuckyScript file from SD storage and execute it. |
| Method | run |
Execute DuckyScript source code synchronously. |
| Instance Variable | button |
Undocumented |
| Instance Variable | default |
Undocumented |
| Instance Variable | default |
Undocumented |
| Instance Variable | device |
Undocumented |
| Instance Variable | media |
Undocumented |
| Instance Variable | mouse |
Undocumented |
| Instance Variable | storage |
Undocumented |
| Instance Variable | usb |
Undocumented |
| Method | _alt |
Type one character using the ALT+numpad method. |
| Method | _alt |
Type a string using ALT+numpad character codes. |
| Method | _delay |
Apply the configured delay before a command. |
| Method | _execute |
Execute one parsed command. |
| Method | _globe |
Send a Globe/Fn key through an optional device hook. |
| Method | _hold |
Press a key without releasing it. |
| Method | _key |
Resolve a DuckyScript key expression. |
| Method | _key |
Split modifier-key syntax using spaces or hyphens. |
| Method | _media |
Send a consumer-control media key. |
| Method | _mouse |
Send a mouse click through an optional mouse device. |
| Method | _mouse |
Move the mouse by an x and y offset. |
| Method | _mouse |
Scroll the mouse by a signed distance. |
| Method | _number |
Parse an integer command argument. |
| Method | _parse |
Parse one source line into a command and argument. |
| Method | _press |
Press and release a key or key combination. |
| Method | _release |
Release all keys or the requested held key. |
| Method | _release |
Release all keys through the USB device. |
| Method | _repeat |
Repeat the previously executed command. |
| Method | _reset |
Reset per-script parser and key state. |
| Method | _restore |
Restore held keys after a press that released the report. |
| Method | _send |
Send a decimal code while holding the ALT modifier. |
| Method | _send |
Send the current held-key report. |
| Method | _send |
Send a key-down report through the USB device. |
| Method | _set |
Validate and apply a custom USB device ID when supported. |
| Method | _sleep |
Sleep for a number of milliseconds. |
| Method | _string |
Type a string using the configured string delay. |
| Method | _sysrq |
Send an ALT+PRINTSCREEN SysRq sequence. |
| Method | _wait |
Wait until the configured button source reports a press. |
| Constant | _ALIASES |
Undocumented |
| Constant | _KEYPAD |
Undocumented |
| Constant | _MEDIA |
Undocumented |
| Constant | _MODIFIERS |
Undocumented |
| Constant | _SPECIAL |
Undocumented |
| Instance Variable | _held |
Undocumented |
| Instance Variable | _held |
Undocumented |
| Instance Variable | _last |
Undocumented |
| Instance Variable | _string |
Undocumented |
def __init__(self, usb_device, storage=None, media_device=None, mouse_device=None, button_reader=None):
¶
Create an interpreter for a USB device and optional peripherals.
| Parameters | |
| usb | USB keyboard-compatible device. |
| storage | Optional storage instance used by exec. |
| media | Optional USB media-key device. |
| mouse | Optional USB mouse device. |
| button | Optional callable returning whether a button was pressed. |
Read a DuckyScript file from SD storage and execute it.
| Parameters | |
filestr | Path to the script on the SD card. |
| Returns | |
None | The script is executed synchronously. |
Execute DuckyScript source code synchronously.
| Parameters | |
code:str or bytes | DuckyScript source to execute. |
| Returns | |
None | The script is executed synchronously. |
Undocumented
| Value |
|
_MEDIA_KEYS =
¶
Undocumented
| Value |
|
_MODIFIERS =
¶
Undocumented
| Value |
|
_SPECIAL_KEYS =
¶
Undocumented
| Value |
|