Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

simple sudoless X11 keylogger

NotificationsYou must be signed in to change notification settings

anko/xkbcat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple X11 keylogger.

  • Simple output format: One line onstdout per key event.
  • Simple to audit: One short file of modern C.
  • Simple to run: Does not needsudo.

Examples

Keypresses only

Given no options,xkbcat prints only keypresses, one per line. Here's theoutput when I type "Hi":

Shift_Lhi

Keypresses and key-ups

With key-ups enabled (xkbcat -up), the format changes to show them:

+Shift_L+h-h-Shift_L+i-i

Lines starting+ are key-downs;- are key-ups.

Compilation

Justmake.

Don't haveX11/extensions/XInput2.h? Install your distro'slibxi-develpackage.

Usage

Options you can pass (all optional):

  • -display <display>: set target X display (default:0)
  • -up: also prepend key-ups (default: don't)
  • -help: print usage hints and exit

Then just use your computer as usual. Interrupt signal (C-c) to quit.

Related programs

Other keyloggers

  • If you need to log keys across a whole Linux system (also in theframebuffer—not just in X11), trykeysniffer. It works via a kernelmodule, and needssudo.
  • If you want to see what characters the user actually typed (with modifierkeys, backspace, etc resolved into text),xspy orlogkeysmight be better for you.

Programs that work well together withxkbcat

  • If you want to add timestamps to each line for logging purposes, I recommendpiping to themoreutils package'sts.These answers featurevarious other tools good for the purpose.
  • If you only want to see key names when you press keys in the same terminalwherexkbcat is running, you can temporarily disable terminal echo withstty -echo && xkbcat. (stty is in coreutils.)

Programs for logging other X11 events

  • xinput invoked asxinput --test-xi2 --root logs everythinginput-related; even mouse movements and clicks, and touchpad stuff. Itsoutput is very comprehensive, but harder to parse.

  • If you need to log X11 events more generally, various protocol monitoringprograms are listed in theX11 debugging guide.

Versioning

The git-tagged version numbers followsemver.

Error outputs (on stderr) are intended to be read by people. Changes to theirwording are not considered breaking changes. Don't parse themprogrammatically.

License

ISC.

About

simple sudoless X11 keylogger

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp