How to Set Up MinGW on Kali Using Wine
MinGW is a collection of windows development tools including compilers such as GCC and G++.
Using both MiniGW and Wine it is possible to compile windows code thus creating a portable executable (pe) which can be later run on a victim's machine. I'm going to show you one way to install MinGW on Kali.
Kali (obviously) Running with a GUI.
Note: Wine should be already installed on your version of Kali. If not, you can install it using
sudo apt-get install wine
EDIT: You may need to install the i386 version of wine using the following commands:
dpkg --add-architecture i386
apt-get install wine-bin:i386
You can go to SourceForge to download the installer.
There are a couple ways to do this:
- In a terminal use wine /path/to/file/mingw-get-setup.exe
- Double-Click on the file in the GUI.
Select "Run with GUI" option.
Note that you must have the GUI up in order to get the installer to run properly. You can run it in a terminal however it draws a GUI box for installation.
When the window appears, make sure to select mingw32-base. This is required to continue and make things work properly.
Select Installation and click Update Catalogue.
You want to get the right DLLs to be able to compile properly. You can find them here: Go Jhonny!
Unzip them into your Windows directory in wine. Its location should be /root/.wine/drive_c/windows
Great! Now you can use gcc.exe!
wine gcc.exe -o file.exe sourcefile.c
This tutorial was created as a side Tut for "Creating a (Almost) Fully Undetectable EXE using Kali and GCC"
Thanks to Go Jhonny! for the original tutorial.