Skip to content

lucache2000/DuckScriptInterpreter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DuckScriptInterpreter

DuckScriptInterpreter is a C++ interpreter for files written in a Ducky like language. It is intended for use as a library in embedded systems (e.g ESP32). As such the implementation of specific actions, such as turning LEDs on or pressing keys, needs to be provided by the caller. The interpreter is highly extendable, allowing users to define their own DuckyScript commands.

Features

  • Parses and executes Ducky-like script files.
  • Designed for embedded systems.
  • Easily extendable with user-defined functionality.
  • Supports control flow constructs, repetition, functions, and extensions.
  • Keyboard layouts

Installation

To include DuckScriptInterpreter in your project, clone the repository and include the necessary files in your build system.

git clone https://github.com/i-am-shodan/DuckScriptInterpreter
cd DuckScriptInterpreter/example
chmod run.sh
./run.sh

Usage

Include the DuckScriptInterpreter library in your project and implement the required hardware-specific functions.

Supported Functionality

  • DELAY
  • STRING
  • STRINGLN
  • System keypresses (GUI, LSHIFT etc)
  • WAIT_FOR_BUTTON_PRESS
  • LED functions including LED_ON, LED_OFF, LED_R ,LEDG
  • REM
  • IF/ELSE IF
  • VAR
  • WHILE
  • DEFINE
  • ATTACKMODE
  • RESTART_PAYLOAD
  • RESET

Supported keyboard layouts

The following layouts are currently support and are given in the format. <OS><Country code> or <OS><Locale>.

  • win_be
  • win_ca-FR
  • win_ca
  • win_ch
  • win_cs-CZ
  • win_de-DE
  • win_da-DK
  • win_en-GB
  • win_es
  • win_es-MX
  • win_fi
  • win_fr
  • win_hr-HR
  • win_hu-HU
  • win_it
  • win_ja-JP
  • win_no
  • win_pt-BR
  • win_pt-PT
  • win_se
  • win_si
  • win_sk-SK
  • win_tr-TR

Note

Memory usage for devices that want to use this library is often at a premium. To reduce memory, in order to use these layouts they must first be 'compiled in'. Take your layout and replace the - character (if it exists) with _ character then use that as a #define. For example to use win_en-GB I need to add the #define win_en_GB compiler directive.

Planned Functionality but not yet implemented

  • INJECT_MOD WINDOWS
  • BUTTON_DEF
  • DISABLE_BUTTON
  • ENABLE_BUTTON
  • RANDOM
  • HOLD RELEASE
  • STOP_PAYLOAD
  • JITTER
  • WAIT_FOR_CAPS_ON
  • SAVE_HOST_KEYBOARD_LOCK_STATE

Unit tests are provided in the tests/ directory. A simple example that can be run on a desktop machine is provided in the example/ directory. This example demonstrates basic usage of the DuckScriptInterpreter library.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Legal

For clarity this project is neither endorsed or supported by Hak5.

About

C++ interpreter for DuckScript3 and similar scripting languages

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 63.5%
  • C 36.0%
  • Shell 0.5%