Table of Contents Hide
exe2powershell is used to convert EXE to BAT files, previously a well known tool for this was exe2bat, this is the version for modern Windows 8, 10.
exe2powershell allows you to convert any binary file (*.exe) into a BAT file, with the resulting BAT file containing only exe commands followed by a PowerShell command to recreate the original binary file.
Such a tool can be useful during a pentest when you need to start a shell without any boot function. With exe2 and PowerShell, the auditor can load any binary into the target system.
This version has been updated with exe2bat to work with current versions of Windows, as exe2bat had some limitations:
- Requires debug.exe on the destination computer (a 16-bit application that was removed in Windows 7 x64 but is available in Windows 7 x86).
- Limits the input exe file size to 64 KB.
exe2powershell replaces the need to use debug.exe with the PowerShell command line, which is available on all Windows starting with Windows 7 / 2008, and there is no more restriction on the size of the exe you type.
Using exe2powershell to convert EXE files to BAT files
To convert an exe file into a bat, run the following command:
exe2powershell.exe inputfile outputfile
For example we can convert nc.exe to nc.bat by typing:
exe2powershell.exe nc.exe nc.bat