二、平台介绍
趋势榜单
解题榜单
re1_wp
public static void DecryptFile(string inputFilePath, string outputFilePath)
{
using (FileStream inputFileStream = new FileStream(inputFilePath, FileMode.Open, FileAccess.Read))
{
// 检查文件长度是否足够包含元数据
long totalLength = inputFileStream.Length;
if (totalLength < 56)
{
throw new InvalidOperationException("文件已损坏或格式不正确。");
}
// 读取末尾的56字节元数据(密钥 + IV + 标识符)
byte[] metadata = new byte[56];
inputFileStream.Seek(-56, SeekOrigin.End); // 定位到元数据起始位置
inputFileStream.Read(metadata, 0, 56);
// 分解元数据
byte[] key = metadata.Take(32).ToArray(); // 前32字节为密钥
byte[] iv = metadata.Skip(32).Take(16).ToArray(); // 接下来16字节为IV
byte[] identifierBytes = metadata.Skip(48).ToArray(); // 最后8字节为标识符
// 验证标识符
string actualIdentifier = Encoding.UTF8.GetString(identifierBytes);
if (actualIdentifier != identifier)
{
throw new InvalidOperationException("文件标识符不匹配,可能已被篡改。");
}
// 准备解密
using (Aes aesAlg = Aes.Create())
{
aesAlg.Key = key;
aesAlg.IV = iv;
aesAlg.Padding = PaddingMode.PKCS7;
aesAlg.Mode = CipherMode.CBC;
ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV);
// 计算加密数据部分的长度(总长度 - 元数据长度)
long encryptedDataLength = totalLength - 56;
// 回到文件开头读取加密数据
inputFileStream.Seek(0, SeekOrigin.Begin);
// 写入解密后的数据到输出文件
using (FileStream outputFileStream = new FileStream(outputFilePath, FileMode.Create, FileAccess.Write))
using (CryptoStream cryptoStream = new CryptoStream(outputFileStream, decryptor, CryptoStreamMode.Write))
{
byte[] buffer = new byte[4096];
int bytesRead;
long bytesLeft = encryptedDataLength;
while (bytesLeft > 0)
{
int readSize = (int)Math.Min(buffer.Length, bytesLeft);
bytesRead = inputFileStream.Read(buffer, 0, readSize);
if (bytesRead == 0) break;
cryptoStream.Write(buffer, 0, bytesRead);
bytesLeft -= bytesRead;
}
cryptoStream.FlushFinalBlock(); // 确保处理最后一块数据
}
}
}
Console.WriteLine($"文件 '{inputFilePath}' 已解密到 '{outputFilePath}'。");
}
暗链
暗链排查1
暗链排查2
确认主进程pid
ps -ef |grep nginx
检查内存映射
cat /proc/pid/maps |grep heap
将返回结果:
556096ebf000-556096f24000 rw-p 00000000 00:00 0 [heap]
使用gdb转储堆
gdb -p master_pid
(gdb)dump memory /target/file 0x556096ebf000 0x556096f24000
最终可获得/target/file 通过查看该文件即可得到nginx配置文件
单机取证
WP
溯源完整过程记录
1.帮助小王找到是什么漏洞导致了小王的运维生涯受到了打击?(回答攻击者利用的漏洞编号)
CNVD-2022-60632
在桌面文件下可以看到服务器运行oa为用友TPlus,在"C:Program Files (x86)ChanjetTPlusProWebServerserverlogs"可找到其日志。
2.请你帮助小王找到攻击者使用的信息收集工具。(回答工具名称)
mimikatz.exe
3.帮助小王找到攻击者创建的隐藏账户的密码。
666777888
ccc8d64785a1f7981dd70c11f0928bb2
4.小王发现系统中有什么文件一直被删除,你能找出来原因吗?(请回答包含的可疑域名)
0wwww.cyg2016.xyy
msdb
数据库中-
msdb.dbo.sysjobs
存储所有作业的基本信息(如作业名称、所有者、启用状态等)。 -
msdb.dbo.sysjobsteps
存储作业的步骤(Step)信息(如执行的命令、类型、成功/失败后的操作)。 -
msdb.dbo.sysschedules
存储作业的计划(Schedule)信息(如执行频率、时间)。 -
msdb.dbo.sysjobschedules
关联作业与计划(Job 和 Schedule 的对应关系)。 -
msdb.dbo.sysjobhistory
存储作业的执行历史记录(如开始时间、结束时间、执行状态)。
执行命令查看作业详细
USE msdbDATA;
SELECT * FROM dbo.sysjobsteps;
5.请你帮助小王找到攻击者隐藏的webshell后门,(请回答shell的md5值)
6e632aba24e8383a7e7a4d446dc285fc
可以在路径“C:Program Files (x86)ChanjetTPlusProWebSiteWorkFlow”下发现其近期修改的“config.aspx”文件
导出文件计算md5
FLAG
1.帮助小王找到是什么漏洞导致了小王的运维生涯受到了打击?(回答攻击者利用的漏洞编号)
flag{CNVD-2022-60632}
2.请你帮助小王找到攻击者使用的信息收集工具。(回答工具名称)
flag{mimikatz.exe}
3.帮助小王找到攻击者创建的隐藏账户的密码。
flag{666777888}
4.小王发现系统中有什么文件一直被删除,你能找出来原因吗?(请回答包含的可疑域名)
flag{0wwww.cyg2016.xyy}
5.请你帮助小王找到攻击者隐藏的webshell后门,(请回答shell的md5值)
flag{6e632aba24e8383a7e7a4d446dc285fc}
vmdk修复
通过查看其他虚拟机的vmdk文件 可发现格式应为
# Disk DescriptorFile
version=1
encoding="GBK"
CID=ee578b63
parentCID=ffffffff
createType="twoGbMaxExtentSparse"
# Extent description
RW 8323072 SPARSE "a-s001.vmdk"
# The Disk Data Base
#DDB
ddb.adapterType = "lsilogic"
ddb.geometry.cylinders = "15665"
ddb.geometry.heads = "255"
ddb.geometry.sectors = "63"
ddb.longContentID = "661640663b4c2e2767ac5685ee578b63"
ddb.toolsInstallType = "4"
ddb.toolsVersion = "12389"
ddb.uuid = "60 00 C2 9c 6c 76 ee 9f-e6 0b dc ed 20 04 11 b6"
ddb.virtualHWVersion = "21"
Header 部分
# Disk DescriptorFile
version=1
encoding="GBK" //使用的字符串编码(用于描述文件)
CID=ee578b63 //随机32位值
parentCID=ffffffff //表示没有父内容
createType="twoGbMaxExtentSparse" //disk类型
Extent descriptions 部分
# Extent description
RW 8323072 SPARSE "a-s001.vmdk" //8323072扇区 *512字节/扇区 = 4GB
//SPARSE稀疏型VMDK文件在创建时不会立即占用全部分配的空间
The Disk Data Base 部分
# The Disk Data Base
#DDB
ddb.adapterType = "lsilogic" //lsilogic 表示使用LSI Logic SAS控制器。
ddb.geometry.cylinders = "15665" //磁道数
ddb.geometry.heads = "255" //磁头数
ddb.geometry.sectors = "63" //扇区数
ddb.longContentID = "661640663b4c2e2767ac5685ee578b63" //虚拟磁盘的内容标识符,用于唯一标识该磁盘的内容
ddb.toolsInstallType = "4" //4 表示 VMware Tools 已经安装并且版本与虚拟机硬件版本兼容
ddb.toolsVersion = "12389" //VMware Tools 的版本号
ddb.uuid = "60 00 C2 9c 6c 76 ee 9f-e6 0b dc ed 20 04 11 b6" //唯一标识符
ddb.virtualHWVersion = "21"
DDB包含了关于虚拟磁盘的重要元数据和配置信息。
# Disk DescriptorFile
version=1
encoding="GBK"
CID=ee578b63
parentCID=ffffffff
createType="twoGbMaxExtentSparse"
# Extent description
RW 8323072 SPARSE "Ubuntusy-s001.vmdk"
RW 8323072 SPARSE "Ubuntusy-s002.vmdk"
RW 8323072 SPARSE "Ubuntusy-s003.vmdk"
RW 8323072 SPARSE "Ubuntusy-s004.vmdk"
RW 8323072 SPARSE "Ubuntusy-s005.vmdk"
RW 8323072 SPARSE "Ubuntusy-s006.vmdk"
RW 8323072 SPARSE "Ubuntusy-s007.vmdk"
RW 8323072 SPARSE "Ubuntusy-s008.vmdk"
RW 8323072 SPARSE "Ubuntusy-s009.vmdk"
RW 8323072 SPARSE "Ubuntusy-s010.vmdk"
RW 8323072 SPARSE "Ubuntusy-s011.vmdk"
RW 8323072 SPARSE "Ubuntusy-s012.vmdk"
RW 8323072 SPARSE "Ubuntusy-s013.vmdk"
RW 8323072 SPARSE "Ubuntusy-s014.vmdk"
RW 8323072 SPARSE "Ubuntusy-s015.vmdk"
RW 8323072 SPARSE "Ubuntusy-s016.vmdk"
RW 8323072 SPARSE "Ubuntusy-s017.vmdk"
RW 8323072 SPARSE "Ubuntusy-s018.vmdk"
RW 8323072 SPARSE "Ubuntusy-s019.vmdk"
RW 8323072 SPARSE "Ubuntusy-s020.vmdk"
RW 8323072 SPARSE "Ubuntusy-s021.vmdk"
RW 8323072 SPARSE "Ubuntusy-s022.vmdk"
RW 8323072 SPARSE "Ubuntusy-s023.vmdk"
RW 8323072 SPARSE "Ubuntusy-s024.vmdk"
RW 8323072 SPARSE "Ubuntusy-s025.vmdk"
RW 8323072 SPARSE "Ubuntusy-s026.vmdk"
RW 8323072 SPARSE "Ubuntusy-s027.vmdk"
RW 8323072 SPARSE "Ubuntusy-s028.vmdk"
RW 8323072 SPARSE "Ubuntusy-s029.vmdk"
RW 8323072 SPARSE "Ubuntusy-s030.vmdk"
RW 1966080 SPARSE "Ubuntusy-s031.vmdk"
# The Disk Data Base
#DDB
ddb.adapterType = "lsilogic"
ddb.geometry.cylinders = "15665"
ddb.geometry.heads = "255"
ddb.geometry.sectors = "63"
ddb.longContentID = "661640663b4c2e2767ac5685ee578b63"
ddb.toolsInstallType = "4"
ddb.toolsVersion = "12389"
ddb.uuid = "60 00 C2 9c 6c 76 ee 9f-e6 0b dc ed 20 04 11 b6"
ddb.virtualHWVersion = "21"
原文始发于微信公众号(solar应急响应团队):2025-2月Solar应急响应公益月赛排名及官方题解
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论