1. Pedro Garcia
  2. PyXKeylogger





PyXKeylogger is a keylogger developed to run under Unix-like systems in x86 and AMD64 architectures. PyXKeylogger was created to be a simple Python script that sniffs all keystrokes using xinput. This code was developed based on Rutkowska's blog post "The Linux Security Circus: On GUI isolation" (check here).

PyXKeylogger differs from PyKL (check here) because of the approach used. PyKL sniffs all keystrokes from ioport 0x60, getting the information directly from hardware and requiring no GUI installed. Therefore, PyKL has the advantage of operating in environments with both GUI or text interface.

On the other hand, PyXKeylogger requires installed X environment. It works only while user is using the graphical interface. However, PyXKeylogger has the advantage over the PyKL since it not requires installation of third part libraries (IOPort). Furthermore, PyKL must be run as root, whereas PyXKeylogger can be run as local user.


PyXKeylogger is released under GPL version 2.


Python 2.6 and X-based graphical environment.

Advantages and Disadvantages


  • Simple and light python script.
  • Log of all users keystrokes.
  • Store all data as ASCII.
  • Not require being run as root.
  • Not require installations.


  • Requires a installed graphical environment.

Download and Instalation

You can download the sources directly from the repository https://bitbucket.org/kuraiev/pyxkeylogger or use mercurial

# hg clone https://bitbucket.org/kuraiev/pyxkeylogger

This repository contains a .idea directory, if you want to import the code in PyCharm IDE.

How to Use

Run python PyXKL.py. The pressed keys are stored in keyboard.log file.

How to contribute

If you want to contribute to this project you can report me bugs by mail sawp@sawp.com.br

More Informations

I have detailed the approach in this post: http://www.sawp.com.br/blog/?p=1982. It is in Portuguese, but I hope help you.