Keylogger, every keystroke you make on your computer, it’s recorded, it can be tracked, and of course, sensitive information like usernames and passwords that you enter on websites. It’s pretty easy to do this in Python, but please don’t use it on someone else’s computer.

The tutorial

The PyNput module helps us with this, but it is not a standard library, so PIP needs to be installed:

Then write the following 11 lines of code and save them as key_track.py

Execute the script from the command line:

This prompt tells us to allow the application to access the keylog in the system Settings, which for MacOS is here:

Then enter the key, you can see the key record in log.txt, when the key is recorded, you will not feel anything unusual:

For those who want to learn more about programming basics and practical tips, please click hereVideo linkKeep learning ~

The last word

This article shares a Python keylogger script, which can be used to intercept passwords and other confidential information entered via the keyboard, posing a serious threat to users. This allows cybercriminals to obtain PIN and account numbers, passwords, email addresses, usernames and other personal information for electronic payments.