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

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

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

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

工具目录

分类

查看所有分类
Loading categories
XLMMacroDeobfuscator — 提取并反混淆 XLM 宏(也称为 Excel 4.0 宏) | Kitploit
工具/GitHubGitHub/dissectmalware/xlmmacrodeobfuscator
静态分析动态分析 (沙盒)逆向工程恶意软件分析
GitHubdissectmalware/xlmmacrodeobfuscator

XLMMacroDeobfuscator

提取并反混淆 XLM 宏(也称为 Excel 4.0 宏)

查看仓库
5871184年前Kitploit 审核通过

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

XLMMacroDeobfuscator

XLMMacroDeobfuscator 可用于解码混淆的 XLM 宏(也称为 Excel 4.0 宏)。它利用内部 XLM 模拟器解释宏,而无需完全执行代码。

支持 xls、xlsm 和 xlsb 格式。

它使用 xlrd2、pyxlsb2 以及自己的解析器分别从 xls、xlsb 和 xlsm 文件中提取单元格和其他信息。

你还可以在 xlm-macro-lark.template 中找到 XLM 语法。

安装模拟器

  1. 使用 pip 安装
root@kitploit:~
pip install XLMMacroDeobfuscator --force

或

root@kitploit:~
pip install xlmmacrodeobfuscator[defusedxml] --force
  1. 安装最新开发版
root@kitploit:~
pip install -U https://github.com/DissectMalware/XLMMacroDeobfuscator/archive/master.zip --force

运行模拟器

对 Excel 文档中的宏进行去混淆:

root@kitploit:~
xlmdeobfuscator --file document.xlsm

仅提取 Excel 文档中的宏(不进行任何去混淆):

root@kitploit:~
xlmdeobfuscator --file document.xlsm -x

仅获取去混淆后的宏且不包含缩进:

root@kitploit:~
xlmdeobfuscator --file document.xlsm --no-indent --output-formula-format "[[INT-FORMULA]]"

以 JSON 格式导出输出:

root@kitploit:~
xlmdeobfuscator --file document.xlsm --export-json result.json

要查看 JSON 输出示例,请查看此链接。

使用配置文件:

root@kitploit:~
xlmdeobfuscator --file document.xlsm -c default.config

default.config 文件必须是一个有效的 JSON 文件,例如:

root@kitploit:~
{
	"no-indent": true,
	"output-formula-format": "[[CELL-ADDR]] [[INT-FORMULA]]",
	"non-interactive": true,
	"output-level": 1
}

命令行

root@kitploit:~

          _        _______
|\     /|( \      (       )
( \   / )| (      | () () |
 \ (_) / | |      | || || |
  ) _ (  | |      | |(_)| |
 / ( ) \ | |      | |   | |
( /   \ )| (____/\| )   ( |
|/     \|(_______/|/     \|
   ______   _______  _______  ______   _______           _______  _______  _______ _________ _______  _______
  (  __  \ (  ____ \(  ___  )(  ___ \ (  ____ \|\     /|(  ____ \(  ____ \(  ___  )\__   __/(  ___  )(  ____ )
  | (  \  )| (    \/| (   ) || (   ) )| (    \/| )   ( || (    \/| (    \/| (   ) |   ) (   | (   ) || (    )|
  | |   ) || (__    | |   | || (__/ / | (__    | |   | || (_____ | |      | (___) |   | |   | |   | || (____)|
  | |   | ||  __)   | |   | ||  __ (  |  __)   | |   | |(_____  )| |      |  ___  |   | |   | |   | ||     __)
  | |   ) || (      | |   | || (  \ \ | (      | |   | |      ) || |      | (   ) |   | |   | |   | || (\ (
  | (__/  )| (____/\| (___) || )___) )| )      | (___) |/\____) || (____/\| )   ( |   | |   | (___) || ) \ \__
  (______/ (_______/(_______)|/ \___/ |/       (_______)\_______)(_______/|/     \|   )_(   (_______)|/   \__/

    
XLMMacroDeobfuscator(v0.2.0) - https://github.com/DissectMalware/XLMMacroDeobfuscator

Error: --file is missing

usage: deobfuscator.py [-h] [-c FILE_PATH] [-f FILE_PATH] [-n] [-x]
                       [--sort-formulas] [--defined-names] [-2]
                       [--with-ms-excel] [-s] [-d DAY]
                       [--output-formula-format OUTPUT_FORMULA_FORMAT]
                       [--extract-formula-format EXTRACT_FORMULA_FORMAT]
                       [--no-indent] [--silent] [--export-json FILE_PATH]
                       [--start-point CELL_ADDR] [-p PASSWORD]
                       [-o OUTPUT_LEVEL] [--timeout N]

optional arguments:
  -h, --help            show this help message and exit
  -c FILE_PATH, --config-file FILE_PATH
                        Specify a config file (must be a valid JSON file)
  -f FILE_PATH, --file FILE_PATH
                        The path of a XLSM file
  -n, --noninteractive  Disable interactive shell
  -x, --extract-only    Only extract cells without any emulation
  --sort-formulas       Sort extracted formulas based on their cell address
                        (requires -x)
  --defined-names       Extract all defined names
  -2, --no-ms-excel     [Deprecated] Do not use MS Excel to process XLS files
  --with-ms-excel       Use MS Excel to process XLS files
  -s, --start-with-shell
                        Open an XLM shell before interpreting the macros in
                        the input
  -d DAY, --day DAY     Specify the day of month
  --output-formula-format OUTPUT_FORMULA_FORMAT
                        Specify the format for output formulas ([[CELL-ADDR]],
                        [[INT-FORMULA]], and [[STATUS]]
  --extract-formula-format EXTRACT_FORMULA_FORMAT
                        Specify the format for extracted formulas ([[CELL-
                        ADDR]], [[CELL-FORMULA]], and [[CELL-VALUE]]
  --no-indent           Do not show indent before formulas
  --silent              Do not print output
  --export-json FILE_PATH
                        Export the output to JSON
  --start-point CELL_ADDR
                        Start interpretation from a specific cell address
  -p PASSWORD, --password PASSWORD
                        Password to decrypt the protected document
  -o OUTPUT_LEVEL, --output-level OUTPUT_LEVEL
                        Set the level of details to be shown (0:all commands,
                        1: commands no jump 2:important commands 3:strings in
                        important commands).
  --timeout N           stop emulation after N seconds (0: not interruption
                        N>0: stop emulation after N seconds)

库

以下示例展示了如何在 Python 项目中使用 XLMMacroDeobfuscator 对 XLM 宏进行去混淆:

root@kitploit:~
from XLMMacroDeobfuscator.deobfuscator import process_file

result = process_file(file='path/to/an/excel/file', 
            noninteractive= True, 
            noindent= True, 
            output_formula_format='[[CELL-ADDR]], [[INT-FORMULA]]',
            return_deobfuscated= True,
            timeout= 30)

for record in result:
    print(record)
  • 注意:当作为库使用时,不会显示 xlmdeobfuscator 标志。

需求

请阅读 requirements.txt 以获取 XLMMacroDeobfuscator 依赖的 Python 库列表。

xlmdeobfuscator 可以在任何操作系统上执行,以提取和去混淆 xls、xlsm 和 xlsb 文件中的宏。你不需要安装 MS Excel。

注意:如果你想使用 MS Excel(在 Windows 上),你需要安装 pywin32 库并使用 --with-ms-excel 开关。 如果使用了 --with-ms-excel,xlmdeobfuscator 会首先尝试通过 MS Excel 加载 xls 文件,如果失败,则使用 xlrd2 库。

使用 XLMMacroDeobfuscator 的项目

XLMMacroDeobfuscator 已被以下项目采用:

  • CAPE Sandbox
  • FAME
  • REMNUX
  • IntelOwl
  • Assemblyline 4 by Canadian Centre for Cyber Security
  • oletools by @decalage2

如果你已将 XLMMacroDeobfuscator 集成到你的项目中,请与我联系。

如何贡献

如果你发现了错误或想提出改进建议,请在问题页面上创建一个新问题。

欢迎通过复刻本项目并提交 Pull Request 来贡献代码。

你可以通过直接消息在 Twitter 上联系我(@DissectMalware)。

下载工具