From cb27d192c27eb3e02f1fd27691a92279e41b7748 Mon Sep 17 00:00:00 2001 From: Kevin F Date: Thu, 8 Sep 2022 13:32:54 -0500 Subject: [PATCH] ReadMe contains the description of the project as well as the entrypoint and dependencies --- ReadMe.go.md | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 ReadMe.go.md diff --git a/ReadMe.go.md b/ReadMe.go.md new file mode 100644 index 0000000..0d35af3 --- /dev/null +++ b/ReadMe.go.md @@ -0,0 +1,99 @@ +# GoSmartKeyboard Daemon + + +# Introduction + +This is a simple websocket server meant to accept a single connection, authenticate it, and stream UTF16 characters and send them as key strokes into the window manager. + +The goal of this particular daemon is not to perfectly emulate a HID, so it may trip up on Windows UAC or game anticheat systems. + + +Some points about the design of this project: + +* Written in [literate go](https://github.com/justinmeiners/srcweave), so this +markdown book is actually the source code +* The project is test-driven +* KISS principle above All +* Small and light core +* Advanced features provided via plugins +* Well defined [threat model](ThreatModel.md) + + + +## Why a smart keyboard? + +Keyboards have been an essential element of computing since the beginning, however they have not evolved much. Everything has a smart variant, so why not keyboards? + +A smart keyboard could, for example, be used for the following: + +* Typical macros +* Buffer typed text before sending it to the client, preventing invalid commands or input. (This would also save some CPU on low power machines, this is how many early teletype systems worked) +* Clever CLI tricks, think `vim` or `cowsay` on your keyboard! +* Isolated password manager +* One Time Passwords +* Virtual keyboard switch or communicating with multiple daemons at once +* Easily attach to VMs +* Text storage, such as configuration or SSH pubkeys +* On-the-fly spell checking or translation +* On-the-fly encryption (ex: PGP sign every message you type), isolated from the perhaps untrusted computer +* Easy layout configuration +* Delay keystrokes by a few dozen or so milliseconds to reduce [key stroke timing biometrics](https://en.wikipedia.org/wiki/Keystroke_dynamics) + + +# Daemon Entrypoint + + +First, we call + +--- entrypoint +func main(){ + fmt.Println("Hello, World!") +} +--- + + +--- /main.go +@{includes} + +@{set network bind globals} + +@{entrypoint} + +--- + + +## Dependencies + +In order to avoid coding key press simulation for every major platform, we use [keybd_event](https://github.com/micmonay/keybd_event). This is a cross-platform library that uses the OS's native key press simulation. + + +--- include keybd event +import( + "github.com/micmonay/keybd_event" +) +--- + +We also rely on gorilla/websocket for the websocket server: + +--- include gorilla websocket +import( + "github.com/gorilla/websocket" +) +--- + +--- includes +package main +import( +"fmt" +) +--- + + +--- set network bind globals +var string unixSocketPath +var bool unixSocketPathExists +var string tcpBindAddress +var bool tcpBindAddressExists +var string tcpBindPort +var bool tcpBindPortExists +--- \ No newline at end of file