Can be useful when you have a priv esc exploit in python but target Windows machine does not have python installed.

Most reliable way, that seems to work every time, is compiling the python via PyInstaller on a Windows box.

Following compiles an exe based on the specified Python script.

Using pyinstaller on Kali to convert a Python script to Exe file:




Convert Python to Exe files