Coder Social home page Coder Social logo

pzmarzly / x11-input-mirror Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 2.0 37 KB

Mirrors X11 (Xserver) input events from one PC to multiple over the network

Home Page: https://crates.io/crates/x11-input-mirror

License: MIT License

Rust 97.54% Shell 2.46%
x11 x11-cursor xserver xserver-xorg network keyboard mouse

x11-input-mirror's Introduction

X11/Xserver input mirroring utility

Captures mouse and keyboard events on one PC, then broadcasts them over the network. Then you can replay those events on other PCs. Thus, if they have the same screen resolution and keyboard mappings, you can effectively control multiple devices with GUI interface at once.

Security

It is highly recommended to just tunnel the traffic over SSH/OpenVPN/WireGuard etc.

There is an over-engineered ugly built-in encryption though, which you set up in SecurityConfig.toml. Setting password = "" will disable it. Set it to a non-empty string (12 characters or more is required) to enable. If an attacker has been recording your traffic and gets your password, they will be able to decrypt all the traffic they recorded (no PFS). This program simply uses XChaCha20 with password as a key, and random initial nonce being sent in plaintext. Then message is sent twice, encrypted using different nonces, as a simple integrity check.

Installation

Download the latest release.

sudo apt install xdotool numlockx xinput

Optionally, install and use screenkey for debugging.

Usage

Use grabber binary on master server, and server on slaves.

grabber requires GrabberConfig.toml and SecurityConfig.toml. server requires ServerConfig.toml and SecurityConfig.toml. Example files are in this repo.

If you want to use the program inside VirtualBox, you may need to disable Mouse Integration on slave servers.

Compiling

Download Rust nightly toolchain, then run cargo build --release.

X11 grabbing workaround

Since version 0.3, Chromium-based browsers work out-of-the-box, but you need to decrease keyboard_and_clicks_interval_ms (I recommend 1 ms now). If you need maximum performance, you can reverse commits "use slower method to grab clicks...", "update default grabber config values" and "remove unnecessary Xephyr stuff", and use Xephyr workaround for Chromium-based browsers.

Misc

Licensed MIT.

Exposes many functions and can be also used as a library. But since the crate is not well documented, I recommend browsing the source before using it.

Uses synchronous networking code, so may be not suited well for controlling multiple machines over high-latency networks.

The code is pretty bad, but it works for now. Feel free to improve it.

Please keep in mind that devices can de-synchronize due to external factors (e.g. connectivity problems, VM having uneven resources, leading to program requiring more time to start, RNG). If you open YouTube in 2 browsers with no cookies, same User Agent, at the same time, from the same IP, you will probably get different order of videos.

x11-input-mirror's People

Contributors

peterreid avatar pzmarzly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

x11-input-mirror's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.