How to Set Up MinGW on Kali Using Wine

Jan 14, 2015 06:13 PM
Jan 16, 2015 08:17 PM
635567965613640484.jpg
635568264143763158.jpg

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.

Requirements:

Wine

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 update

apt-get install wine-bin:i386

Step 1: Get the Installer from SourceForge

You can go to SourceForge to download the installer.

Step 2: Run the Installer with Wine

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.

Step 3: Select mingw32-Base

When the window appears, make sure to select mingw32-base. This is required to continue and make things work properly.

635567965613640484.jpg

Select Installation and click Update Catalogue.

The Final Step: Adding the Proper DLLs

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!

syntax:

cd /root/.wine/drive_c/MinGW/bin

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.

Comments

No Comments Exist

Be the first, drop a comment!