sevagas / macro_pack

macro_pack is a tool by @EmericNasi used to automatize obfuscation and generation of Office documents, VB scripts, shortcuts, and other formats for pentest, demo, and social engineering assessments. The goal of macro_pack is to simplify exploitation, antimalware bypass, and automatize the process from malicious macro and script generation to final document generation. It also provides a lot of helpful features useful for redteam or security research.
https://blog.sevagas.com
Apache License 2.0
2.07k stars 397 forks source link

Cannot Embed Dll #87

Open russokiwi opened 1 year ago

russokiwi commented 1 year ago

When doing echo test | macro_pack.exe --template=EMBED_DLL --embed=payload.dll --obfuscate -G payload.hta compiles fun, but when running HTA., geting an error "Expected End of Statement" when looking at the particular line in the HTA, it reads: Private Declare Sub test Lib "Document1.asd" () is this right ? (the name of the DLL Function in question is test).

sevagas commented 1 year ago

It seems you have the VBA code instead of VBS that is in your HTA Are you having the same error with echo DllMain | macro_pack.exe --template=EMBED_DLL --embed=payload.dll --obfuscate -G payload.vbs ?

russokiwi commented 1 year ago

yep when running

d:\>cscript payload.vbs
D:\pentesting\tools\macropac\payload.vbs(3, 17) Microsoft VBScript compilation error: Expected end of statement
TheL1ghtVn commented 9 months ago

This bug appears in version 2.2.0. Use 1.5 solved the problem @russokiwi