https://github.com/ryhkml/keylogger
Keylogger for Linux. Leaks your keyboard input
https://github.com/ryhkml/keylogger
c keylogger keystroke linux overlay-obs rootless websocket
Last synced: 3 months ago
JSON representation
Keylogger for Linux. Leaks your keyboard input
- Host: GitHub
- URL: https://github.com/ryhkml/keylogger
- Owner: ryhkml
- License: mit
- Created: 2025-01-06T15:47:52.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-02-17T15:44:48.000Z (3 months ago)
- Last Synced: 2025-02-17T16:38:54.639Z (3 months ago)
- Topics: c, keylogger, keystroke, linux, overlay-obs, rootless, websocket
- Language: C
- Homepage:
- Size: 1.84 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Keylogger

## Build and Usage
```sh
make
```Use `sudo` to run. The keylogger outputs to the `/tmp/.keylogger.log` file. You can also get output via a WebSocket. However, this requires the [libwebsockets](https://libwebsockets.org) library. Install libwebsockets and then run:
```sh
make USE_LIBWEBSOCKETS=1
```If target device is incorrect. Use the `--dev ` option to specify a device event. List available devices run `ls -l /dev/input/by-id/`
```sh
sudo out/keylogger --dev /dev/input/event7
```There is a list of options available
| Option | Default Value | Description |
| ---------- | ------------------- | ------------------------------- |
| `--dev` | `/dev/input/event*` | Specify the device event to use |
| `--printk` | | Show keystrokes in terminal |
| `--port` | `33300` | Specify websocket port |### WebSocket Secure (wss)
The keylogger server also supports secure WebSocket connections. Set an environment variable with the path to your certificate and private key files.
```sh
# Required
export KEYLOGGER_SSL_CERT_PATH=PATH_TO_CERT.pem
export KEYLOGGER_SSL_KEY_PATH=PATH_TO_KEY.pem
# Optional
export KEYLOGGER_SSL_CA_PATH=
``````html
const ws = new WebSocket("wss://localhost:33300");
ws.onmessage = ({ data }) => {
// Do something..
};
```
> [!NOTE]
>
> Please note that you also need to add the authority certificate file to the browser you are using.
> This file is usually in the `.crt` format.#### Example
A keylogger used as an overlay in OBS:

### Test
```sh
make test
```### Rootless
> [!WARNING]
>
> Rootless method gives you direct access to your keyboard.To run rootless, follow these steps:
1. Create a udev rules file (for example, /etc/udev/rules.d/90-keylogger.rules)
```sh
echo "SUBSYSTEM==\"input\", OWNER=\"$USER\", MODE=\"0660\"" | sudo tee /etc/udev/rules.d/90-keylogger.rules > /dev/null
```1. Reload udev rules
```sh
sudo udevadm control --reload-rules
sudo udevadm trigger
```## Formatter
`~/.clang-format` base from [Google](https://google.github.io/styleguide/cppguide.html)
```
BasedOnStyle: Google
IndentWidth: 4
ColumnLimit: 120
```_In Google i trust_