converting python into exe files on kali

useful for when you have a privesc in python, but the target windows machine doesn’t have python installed

# install python for windows
wine msiexec /i python-2.7.8.msi
rm python-2.7.8.msi

# install pywin32
wine pywin32-220.win32-py2.7.exe
rm pywin32-220.win32-py2.7.exe

# install pyinstaller
unzip -d /opt

# convert python to exe
wine c:/Python27/python.exe /opt/PyInstaller-2.1/ –onefile

=> dist/evil.exe

note: modern antivirus might see pyinstaller generates EXEs as malicious… ┬ásome antivirus evasion products made heavy use of pyinstaller…

Leave a Reply

Your email address will not be published. Required fields are marked *