Settings

Theme

A one-line X11 keylogger (2016)

techtrickery.net

4 points by davidshepherd7 2 years ago · 1 comment

Reader

yjftsjthsd-h 2 years ago

As the article notes, it's hard to be too worried from a security perspective since an attacker that can run arbitrary commands as you has already won.

From a utility perspective, though, this is pretty handy; I've used either this or something really close when I was trying to figure out how to design a better keyboard layout (including some interest in chords and shortcuts). So I just keylogged myself for a few hours (or days, I forget), then ran some simple analysis on the result to see what keys I used the most, and what combinations were most common (both in the sense of chords like ctrl-t, and sequences like "th"). Honestly the biggest takeaways I remember were that non-letter keys were really big (space/shift/ctrl/enter got used more than most if not all letters), and that I was hitting backspace enough that I really needed to prioritize getting my error rate down:P

IIRC it's easy to do the same thing without needing X (that is, in a way that works on console/X11/Wayland) by reading the raw /dev/input devices, though that requires either root or (depending on your OS, I assume) being in the input group.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection