phishgen
is a python tool designed to create macro files, modify and inject them in existing .docx
files.
- Inject macros: Inject macros from a
.dotm
file to a.docx
document (needs to be created from.dotx
template). - Modify macros: Replace source code of the
.dotm
file using a provided string or external file. - Create documents: Generate Word documents with predefined configurations (
fulldoc
,empty
,full
,macro
). - Cross-platform support: Everything, except modifying macros is cross-platform. For modifying macro-files you need
Windows
and preinstalledWord
application.
git clone https://github.com/SelfScriptKiddies/phishgen.git
cd phishgen
pip install -e .
phishgen
provides three modes:
In this mode, phishgen
will inject .dotm macro in .docx file.
Important! .docx file must be created by template (.dotx file).
Example:
phishgen inject generated_document.docx macro.dotm -o patched_document.docx
Important! This mode is available only on Windows
systems with Word
application.
Idea is generating .dotm file with provided source code. Source code can be file (-f
option) or string (-s
option).
Default filename will be macro.dotm
in your current directory.
Example:
payload.txt:
Dim wsh As Object
Set wsh = CreateObject("WScript.Shell")
wsh.Run "calc.exe"
Set wsh = Nothing
phishgen macro -f payload.txt
Also source code as string:
phishgen macro -s "payload"
Just copies some templates from inner folder to provided filepath.
Modes:
- fulldoc: copies
.docx
resume, created by template, ready to injection - empty: copies empty
.dotx
pattern. Needed to create.docx
document with your content. - full: copies
.dotx
pattern of resume from step 1. You can edit this resume as you wish! - macro: copies empty
.dotm
. No source code included
phishgen create fulldoc -d test_folder/
phishgen create empty -d test_folder/
phishgen create full -d test_folder/
phishgen create macro -d test_folder/