https://github.com/mulx10/pykeylogger
https://github.com/mulx10/pykeylogger
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/mulx10/pykeylogger
- Owner: MuLx10
- Created: 2017-06-24T06:22:32.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-04-24T05:32:45.000Z (over 8 years ago)
- Last Synced: 2024-12-30T13:10:37.642Z (over 1 year ago)
- Language: Python
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pyKeylogger
PyKeylogger is a proof of concept of a pure-python keylogger for linux. It uses Xlib (so you must have an X connection!) to monitor the state of the keyboard. Here's how you use it:
```python
import keylogger
import time
now = time.time()
done = lambda: time.time() > now + 60
def print_keys(t, modifiers, keys): print "%.2f %r %r" % (t, keys, modifiers)
keylogger.log(done, print_keys)
```
This will print key events to stdout for 60 seconds. If you wanted to be evil, instead of passing in a print callback, you could pass in a remote logging precedure.
Sample output:
1314238675.42 'o' {'left shift': False, 'right alt': False, 'right shift': False, 'left alt': False, 'left ctrl': False, 'right ctrl': False}
1314238675.51 'm' {'left shift': False, 'right alt': False, 'right shift': False, 'left alt': False, 'left ctrl': False, 'right ctrl': False}
1314238675.65 'g' {'left shift': False, 'right alt': False, 'right shift': False, 'left alt': False, 'left ctrl': False, 'right ctrl': False}