MODULE

X11 Keylogger

Try Surface Command Get a continuous 360° view of your attack surface
Back to Search

X11 Keylogger

Disclosed
07/01/1997
Created
12/03/2024

Description

This module binds to an open X11 host to log keystrokes. This is a fairly close copy of the old xspy c program which has been on Kali for a long time. The module works by connecting to the X11 session, creating a background window, binding a keyboard to it and creating a notification alert when a key is pressed. One of the major limitations of xspy, and thus this module, is that it polls at a very fast rate, faster than a key being pressed is released (especially before the repeat delay is hit). To combat printing multiple characters for a single key press, repeat characters arent printed when typed in a very fast manor. This is also an imperfect keylogger in that keystrokes arent stored and forwarded but status displayed at poll time. Keys may be repeated or missing.

Author(s)

  • h00die
  • nir tzachar

Development

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use auxiliary/gather/x11_keyboard_spy
msf auxiliary(x11_keyboard_spy) > show actions
    ...actions...
msf auxiliary(x11_keyboard_spy) > set ACTION < action-name >
msf auxiliary(x11_keyboard_spy) > show options
    ...show and set options...
msf auxiliary(x11_keyboard_spy) > run 

Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.

– Jim O’Gorman | President, Offensive Security

;