XLMMacroDeoBFusator是一个用Python 3编写的XLM仿真引擎,旨在分析和消除MS Excel文件(XLS、XLSM和XLSB)中包含的恶意XLM宏(也称为Excel 4.0宏)。
XLMMacroDeobfuscator的Python项目详细描述
XLM微波炉
XLMMacroDeoBFusator可用于解码混淆的XLM宏(也称为Excel 4.0宏)。它利用一个内部的XLM仿真器来解释宏,而不完全执行代码。在
它同时支持xls、xlsm和xlsb格式。在
它使用xlrd2、pyxlsb2和自己的解析器分别从xls、xlsb和xlsm文件中提取单元格和其他信息。在
也可以在XLM宏中找到XLM语法-百灵鸟在
安装仿真器
- 使用pip安装
pip install XLMMacroDeobfuscator
- 安装最新开发
运行模拟器
要取消Excel文档中宏的浮动,请执行以下操作:
xlmdeobfuscator --file document.xlsm
要只获取已除名的宏而不进行任何缩进,请执行以下操作:
xlmdeobfuscator --file document.xlsm --no-indent --output-formula-format "[[INT-FORMULA]]"
以JSON格式导出输出
xlmdeobfuscator --file document.xlsm --export-json result.json
要查看示例JSON输出,请检查this linkout。在
命令行
_ _______
|\ /|( \ ( )
( \ / )| ( | () () |
\ (_) / | | | || || |
) _ ( | | | |(_)| |
/ ( ) \ | | | | | |
( / \ )| (____/\| ) ( |
|/ \|(_______/|/ \|
______ _______ _______ ______ _______ _______ _______ _______ _________ _______ _______
( __ \ ( ____ \( ___ )( ___ \ ( ____ \|\ /|( ____ \( ____ \( ___ )\__ __/( ___ )( ____ )
| ( \ )| ( \/| ( ) || ( ) )| ( \/| ) ( || ( \/| ( \/| ( ) | ) ( | ( ) || ( )|
| | ) || (__ | | | || (__/ / | (__ | | | || (_____ | | | (___) | | | | | | || (____)|
| | | || __) | | | || __ ( | __) | | | |(_____ )| | | ___ | | | | | | || __)
| | ) || ( | | | || ( \ \ | ( | | | | ) || | | ( ) | | | | | | || (\ (
| (__/ )| (____/\| (___) || )___) )| ) | (___) |/\____) || (____/\| ) ( | | | | (___) || ) \ \__
(______/ (_______/(_______)|/ \___/ |/ (_______)\_______)(_______/|/ \| )_( (_______)|/ \__/
XLMMacroDeobfuscator(v0.1.4) - https://github.com/DissectMalware/XLMMacroDeobfuscator
usage: deobfuscator.py [-h] [-f FILE_PATH] [-n] [-x] [-2] [--with-ms-excel]
[-s] [-d DAY]
[--output-formula-format OUTPUT_FORMULA_FORMAT]
[--no-indent] [--export-json FILE_PATH]
[--start-point CELL_ADDR] [-p PASSWORD]
optional arguments:
-h, --help show this help message and exit
-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
-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]]
--no-indent Do not show indent before formulas
--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
图书馆
下面的示例演示如何在python项目中使用XLMMacroDeoBFusator来对XLM宏进行除错:
fromXLMMacroDeobfuscator.deobfuscatorimportprocess_fileresult=process_file(file='path/to/an/excel/file',noninteractive=True,noindent=True,output_formula_format='[[CELL_ADDR]], [[INT-FORMULA]]',return_deobfuscated=True)forrecordinresult:print(record)
要求
请阅读要求.txt以获取xlmmacrodeobfusator所依赖的python库的列表。在
xlmdeobflocastor可以在任何操作系统上执行,以提取和消除xls、xlsm和xlsb文件中的宏。不需要安装MS。在
注意:如果要使用MS Excel(在Windows上),则需要安装pywin32库并使用--with MS Excel开关。 如果使用--with ms excel,xlmdeobfuscator首先尝试用ms excel加载xls文件,如果失败,则使用xlrd2 library。在
如何作出贡献
如果您发现了一个错误或想提出改进建议,请在issues page上创建一个新问题。在
你可以自由地为这个项目做贡献,把这个项目分成几个部分,然后提交一个请求。在
您可以通过直接消息联系me (@DissectMlaware) on Twitter。在
*该代码仍在大量开发中。希望看到代码中的根本变化。在
- 项目
标签: