Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
msidump — MSI Dump - 一款分析恶意MSI安装包、提取文件、流、二进制数据并集成YARA扫描器的工具。 | Kitploit
工具/GitHubGitHub/mgeeky/msidump
静态分析取证分析恶意软件分析二进制分析
GitHubmgeeky/msidump

msidump

MSI Dump - 一款分析恶意MSI安装包、提取文件、流、二进制数据并集成YARA扫描器的工具。

查看仓库网站
2322043年前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

msidump

MSI Dump – 一款用于分析恶意 MSI 安装包的工具,支持提取文件、流、二进制数据,并集成 YARA 扫描器。

对于启用了宏的 Office 文档,我们可以快速使用 oletools mraptor 判断文档是否恶意。如果希望进一步分析,可以使用 oletools olevba 或 oledump。

对于恶意 MSI 文件的分解,目前为止我们只有一个可靠且值得信赖的工具:lessmsi。 然而,lessmsi 并不具备我所需的功能:

  • 快速分类
  • 二进制数据提取
  • YARA 扫描

因此,msidump 应运而生。

特性

该工具有助于快速分类以及详细检查恶意 MSI 文件集合。它能够:

  • 快速判断文件是否可疑。
  • 列出所有 MSI 表,并导出特定记录。
  • 提取二进制数据、所有 CAB 文件、自定义操作中的脚本。
  • 使用 YARA 规则扫描所有内部数据和记录。
  • 利用 file/MIME 类型推断确定内部数据类型。

它是作为我发布的博文配套工具而创建的:

  • MSI Shenanigans. Part 1 - Offensive Capabilities Overview

局限性

  • 该程序仍处于早期 alpha 版本,预期会出现问题,分类/解析逻辑可能会发生变化。
  • 由于该工具严重依赖 Win32 COM WindowsInstaller.Installer 接口,目前无法原生支持 Linux 平台。也许可以使用 wine python msidump.py,但我尚未尝试过。

使用场景

  1. 对可疑 MSI 进行快速分类,并配合 YARA 规则:
root@kitploit:~
cmd> python msidump.py evil.msi -y rules.yara

1.png

此处可见,输入的 MSI 被注入了可疑的 VBScript,并包含大量可执行文件。

  1. 现在希望仔细查看该 VBScript,仅提取该条记录。

从分类表中可以看到,它存在于 Binary 表中。让我们提取它:

root@kitploit:~
python msidump.py putty-backdoored.msi -l binary -i UBXtHArj

我们可以根据记录的名称/ID 或索引号(此处为 7)指定要导出的记录。

2.png

再看另一个例子。这次在 Binary 表中存储了一个可执行文件,会在安装过程中执行:

3.png

要提取该文件,我们可以使用:

root@kitploit:~
python msidump.py evil2.msi -x binary -i lmskBju -O extracted

其中:

  • -x binary 表示提取 Binary 表的内容
  • -i lmskBju 指定要提取的具体记录
  • -O extracted 设置输出目录

4.png

为获得最佳输出体验,请在最大化控制台窗口中运行工具,或将输出重定向到文件:

root@kitploit:~
python msidump.py [...] -o analysis.log

完整用法

root@kitploit:~
PS D:\> python .\msidump.py --help
options:
  -h, --help            show this help message and exit

Required arguments:
  infile                Input MSI file (or directory) for analysis.

Options:
  -q, --quiet           Surpress banner and unnecessary information. In triage mode, will display only verdict.
  -v, --verbose         Verbose mode.
  -d, --debug           Debug mode.
  -N, --nocolor         Dont use colors in text output.
  -n PRINT_LEN, --print-len PRINT_LEN
                        When previewing data - how many bytes to include in preview/hexdump. Default: 128
  -f {text,json,csv}, --format {text,json,csv}
                        Output format: text, json, csv. Default: text
  -o path, --outfile path
                        Redirect program output to this file.
  -m, --mime            When sniffing inner data type, report MIME types

Analysis Modes:
  -l what, --list what  List specific table contents. See help message to learn what can be listed.
  -x what, --extract what
                        Extract data from MSI. For what can be extracted, refer to help message.

Analysis Specific options:
  -i number|name, --record number|name
                        Can be a number or name. In --list mode, specifies which record to dump/display entirely. In --extract mode dumps only this particular record to --outdir
  -O path, --outdir path
                        When --extract mode is used, specifies output location where to extract data.
  -y path, --yara path  Path to YARA rule/directory with rules. YARA will be matched against Binary data, streams and inner files

------------------------------------------------------

- What can be listed:
    --list CustomAction     - Specific table
    --list Registry,File    - List multiple tables
    --list stats            - Print MSI database statistics
    --list all              - All tables and their contents
    --list olestream        - Prints all OLE streams & storages.
                              To display CABs embedded in MSI try: --list _Streams
    --list cabs             - Lists embedded CAB files
    --list binary           - Lists binary data embedded in MSI for its own purposes.
                              That typically includes EXEs, DLLs, VBS/JS scripts, etc

- What can be extracted:
    --extract all           - Extracts Binary data, all files from CABs, scripts from CustomActions
    --extract binary        - Extracts Binary data
    --extract files         - Extracts files
    --extract cabs          - Extracts cabinets
    --extract scripts       - Extracts scripts

------------------------------------------------------

待办事项

  • 分类逻辑仍不够稳定,我不太满意。因此将不断重新设计和扩展。
  • 在更广泛的测试样本集上进行测试。
  • 支持带密码的输入 ZIP 归档。
  • 支持读取包含多个 YARA 规则的目录,而不仅仅是单个文件。
  • 目前,该工具通过评估 CustomAction Type 的数字来匹配恶意类型,这容易被绕过。
    • 需要重新设计,正确解析 Type 数字并将其分解为标志位。

工具名称

显然,在命名我的工具时,我没有检查该名称是否已被占用。 还有一个名为 msidump 的工具,是 msitools GNU 包的一部分:

  • msidump

☕ 支持我 ☕

这个项目以及其他项目都是不眠之夜和大量辛勤工作的成果。如果你喜欢我所做的事情,并欣赏我总是回馈社区, 请考虑请我喝杯咖啡 (或者更好,喝杯啤酒) 以表示感谢!💪


root@kitploit:~
Mariusz Banach / mgeeky, (@mariuszbit)
<mb [at] binary-offensive.com>
下载工具