How to compile CrackMapExec for Windows - maaaaz/CrackMapExecWin GitHub Wiki
1. Set up the compilation environment
- python-2.7.10.msi
- Git-2.6.1-32-bit.exe to clone the impacket repo
- crackmapexec prerequisities with
pip install --upgrade -r requirements.txt
- VCForPython27.msi to be able to compile the
pyinstaller
core module - pyinstaller with
pip install pyinstaller
2. Monkey-Patch the original code
General rules to ensure Windows compatibility:
- Remove references to Unix stuff like
os.geteuid()
, that don't make sense on Windows - Patch the code section related to term colors from
from termcolor import cprint, colored
to
from termcolor import cprint, colored
import colorama
colorama.init()
Take a look at the following link for more information on that topic.
- Remove illegal chars in created/accessed filenames
3. Compile
pyinstaller --clean --onefile crackmapexec.py
4. Profit
Find the around-6MB executable in the created dist
folder