Create a KeyLogger Program yourself using Python

Aditya Sadana
2 min readJun 28, 2020

--

Ever wanted to know what somebody is typing on a computer in your absence? Well, you have come to the right place. Today I am going to tell you a program that stores all the information of what has been typed on a computer and send it to your email after a particular interval.

Writing and understanding this program is too easy if you have a basic knowledge of python programming.

So, Let’s get started.

First import python modules named subprocess and os in your code by the command:

Now you would need two python modules which are not present by default so we are going to install by using subprocess module and import them. Basically subprocess is the module that is used to interact with the command prompt using python.

Now, our next step would be to record every strike on the keyboard. To do so we would make a function that would store the strikes in human readable manner.

After this, we would be making a function that will send an email to of the output to us using the smtplib module in python.

Now, we would make a function that would report us the strikes in every particular interval of time. In this, I have set time interval to be 20 seconds. You can change it by yourself.

Now, finally we would use pynput module in python that is used to record the keyboard strikes and send it to our email.

This makes our program complete.

To get the full code you can visit my github rerpository:

For more such interesting programs and projects visit my personal website:

Have a nice day :)

--

--

Aditya Sadana
0 Followers

To know more about me and find some interesting Technical projects navigate to: https://sadanaditya.web.app